Hello,
I’m using curandCreateGenerator.
How could i use curandGenerateUniform and curandGenerate to limit the random numbers generated to a given min/max range ?
Thanks a lot !
Hello,
I’m using curandCreateGenerator.
How could i use curandGenerateUniform and curandGenerate to limit the random numbers generated to a given min/max range ?
Thanks a lot !
The host API generate options are here. None of them allow for user-specified ranges.
So you would have to post-process the data (after generation) in some fashion. Since the generated data is in device memory (when using curandCreateGenerator
), the efficient way to do that would be via a CUDA kernel. If you’re going to do it via CUDA kernel, one possible approach would be to switch to the device API, and perhaps do something like this.