cuda random number initialization - same seed different sequence for each state

This commit is contained in:
Uldis Locans
2016-11-23 21:15:20 +01:00
parent e8386869dc
commit 7abc9fdbd3

View File

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