Hi,

I have some trouble when using curand()

I am porting my code (which runs on CPU) into nvcc. I used the following random number generator

#define P1 16807

#define N 2147483647

int rand_naive(int xn){

return (xn*P1)%N;

}

Then I use rand_naive/N to give a float number in [0,1)

I use each random number only once, then drop it and find another. (I want to secure that the result is the same every time I run it).

However, it is a little difficult for me to find a similar function in curand. curand_init() gives a sequence, but I don’t know it maximum value (i.e., N) and I don’t want to store the whole sequence, I just want to find the next random number in each call.

I wonder if anyone could give some suggestions?

Thanks in advance