Using MersenneTwister to generate random numbers Can random sequence be continued?

Hi all,

I’d like to generate pseudo random numbers for a Monte Carlo application. Included in the CUDA SDK distribution is a Mersenne-Twister generator. There are also other random number generators available [1],[2].

First question: I’d like to generate more random numbers than will fit in device memory. One Mersenne-Twister kernel call won’t be enough. Is it possible to “continue” the Mersenne-Twister sequence between kernel calls? If not, what is the recommended way to generate a lot of random numbers?

Second question: Is there any common wisdom about which pseudo RNG’s work well with CUDA?

Thanks,
Kip

[1]
[url=“http://arxiv.org/pdf/0709.3225v1”]http://arxiv.org/pdf/0709.3225v1[/url]
[url=“http://www.amolf.nl/~vanmeel/mdgpu/download.html”]http://www.amolf.nl/~vanmeel/mdgpu/download.html[/url]

[2]
[url=“http://forums.nvidia.com/index.php?showtopic=31159&pid=247608&mode=threaded&show=&st=20&#entry247608”]http://forums.nvidia.com/index.php?showtop...20&#entry247608[/url]

Linear congruential generators implemented in CUDA

As a follow up, I am currently using a modification of:

[url=“http://arxiv.org/pdf/0709.3225v1”]http://arxiv.org/pdf/0709.3225v1[/url]
[url=“http://www.amolf.nl/~vanmeel/mdgpu/download.html”]http://www.amolf.nl/~vanmeel/mdgpu/download.html[/url]

The generated random sequence is exactly that of the rand48 algorithm provided by the C standard library, but the implementation has been parallelized in a clever way. I’ve modified this implementation so that random numbers can be generated, one at a time, within a CUDA device function. The code is attached.

In a different thread there is a discussion of other (simple) random number generators which parallelize well. I’m considering using this one:
RNG discussion
rand48_cu.txt (4.34 KB)