diff options
author | Adrian Kummerlaender | 2021-08-23 22:04:50 +0200 |
---|---|---|
committer | Adrian Kummerlaender | 2021-08-23 22:04:50 +0200 |
commit | 8691f6f7306914d8fc9d5afc8a347ebf5ce0a7d7 (patch) | |
tree | 677c40069c559c6f10da4100e0d5de82bf1886d0 /tangle/LLBM/propagate.h | |
parent | ec18c110e5852997727683663b48ba3919902617 (diff) | |
download | LiterateLB-8691f6f7306914d8fc9d5afc8a347ebf5ce0a7d7.tar LiterateLB-8691f6f7306914d8fc9d5afc8a347ebf5ce0a7d7.tar.gz LiterateLB-8691f6f7306914d8fc9d5afc8a347ebf5ce0a7d7.tar.bz2 LiterateLB-8691f6f7306914d8fc9d5afc8a347ebf5ce0a7d7.tar.lz LiterateLB-8691f6f7306914d8fc9d5afc8a347ebf5ce0a7d7.tar.xz LiterateLB-8691f6f7306914d8fc9d5afc8a347ebf5ce0a7d7.tar.zst LiterateLB-8691f6f7306914d8fc9d5afc8a347ebf5ce0a7d7.zip |
Replace InitializeO by memset
Diffstat (limited to 'tangle/LLBM/propagate.h')
-rw-r--r-- | tangle/LLBM/propagate.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tangle/LLBM/propagate.h b/tangle/LLBM/propagate.h index d63ccd8..acb1d6c 100644 --- a/tangle/LLBM/propagate.h +++ b/tangle/LLBM/propagate.h @@ -79,7 +79,7 @@ CyclicPopulationBuffer<DESCRIPTOR,S>::CyclicPopulationBuffer( for (unsigned iPop=0; iPop < DESCRIPTOR::q; ++iPop) { // per-population handle until cuMemMap accepts non-zero offset - cuMemCreate(&_handle[iPop], _volume, &_prop, 0); + cuMemCreate(&_handle[iPop], _volume, &_prop, 0); cuMemMap(_ptr + iPop * 2 * _volume, _volume, 0, _handle[iPop], 0); cuMemMap(_ptr + iPop * 2 * _volume + _volume, _volume, 0, _handle[iPop], 0); } @@ -88,7 +88,11 @@ CyclicPopulationBuffer<DESCRIPTOR,S>::CyclicPopulationBuffer( _access.location.id = 0; _access.flags = CU_MEM_ACCESS_FLAGS_PROT_READWRITE; cuMemSetAccess(_ptr, 2 * _volume * DESCRIPTOR::q, &_access, 1); - cuMemsetD8(_ptr, 0, 2 * _volume * DESCRIPTOR::q); + + for (unsigned iPop=0; iPop < DESCRIPTOR::q; ++iPop) { + float eq = descriptor::weight<DESCRIPTOR>(iPop); + cuMemsetD32(_ptr + iPop * 2 * _volume, *reinterpret_cast<int*>(&eq), 2 * (_volume / sizeof(S))); + } for (unsigned iPop=0; iPop < DESCRIPTOR::q; ++iPop) { _base[iPop] = device() + iPop * 2 * (_volume / sizeof(S)); |