init randoms - each thread gets same seed but different sequence

This commit is contained in:
Uldis Locans
2016-11-28 16:23:29 +01:00
parent b3a12e02a8
commit 3a74d6cdee

View File

@ -8,7 +8,7 @@ __global__ void initcuRandState(curandState *state, int size, int seed = 0) {
int idx = blockIdx.x * blockDim.x + threadIdx.x;
if (idx < size) {
curand_init(seed + idx, 0, 0, &state[idx]);
curand_init(seed, idx, 0, &state[idx]);
}
}