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
förälder 6a0efb7ed2
incheckning d5c8de3f41
2 ändrade filer med 7 tillägg och 13 borttagningar
+4 -1
Visa fil
@@ -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;
}
}