Change memset kernel to use memcpy instead of placement new. Simplify indexers.

This commit is contained in:
Alex Voicu
2017-11-28 19:45:47 +00:00
parent 6a0efb7ed2
commit d5c8de3f41
2 changed files with 7 additions and 13 deletions
+4 -1
View File
@@ -1311,7 +1311,10 @@ namespace
size_t idx = blockIdx.x * block_dim + threadIdx.x;
while (idx < n) {
new (&f[idx]) T{value};
__builtin_memcpy(
reinterpret_cast<void*>(&f[idx]),
reinterpret_cast<const void*>(&value),
sizeof(T));
idx += grid_dim;
}
}