I’m implementing a simple genetic algorithm on GPU and I need to use a random function. Because it’s not for big scientific purpose, I use the rand() function in my C version of the algorithm.
Is there a way to make a thread generate a random number? :unsure:
I read other post on the forum and it seem complicated. Somebody a hint?
I was thinking doing what Tom suggested but I don’t know if it will be efficient. I mean doing copy to the global memory has a cost in time. Do you hink using the mesenne-twister is faster?
MT SDK sample - looks to be having some problem. I cant vouch. But there is a recent discussion thread from some “King…dude…”. Check that thread out before using that
Finally I tried the Tom method. But I think I’ll encounter a problem. Indeed, my genetic algorithm require 27 millions of randoms numbers. I don’t think to read 27 millions of value from the global memory is effective. Maybe I should try the mesenne-twister?