I would like to ask for your suggestions on generating random data inside device function codes.
I need to convert this function from C++ to device function. The function is something like this:
while ( value > threshold )
value1 = rand();
value2 = rand();
However, I couldn’t figure out how to get a lot of random data inside device codes. I’ve checked the sample codes using curand library as listed here: https://developer.nvidia.com/curand and tested in my codes. It seems that I keep getting same “random data” in some of the threads.
Could any one give any hints? Thanks a lot!