I have a question regarding the random generators in CUDA . I am using Curand to generate random numbers with the following code:
__device__ float priceValue(int threadid){
unsigned int seed = threadid ;
curandState s;
curand_init (seed , 0, 0, &s);
float randomWalk = 2;
while (abs(randomWalk)> 1) {
randomWalk = curand_normal(&s);
}
return randomWalk;
}
I have tried to relaunch this code many times, I have always the same output. I could not find what’s wrong in this code. The threads give the same Ids but the curand_normal functions should change at each launching, right?