I have a question about random generators in CUDA. I use 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 tried to repeat this code many times, I always have the same output. I could not find what was wrong in this code. Threads give the same identifiers, but curand_normal functions should change every time they start, right?
source share