a) is there any way to invoke a simple random number function from inside a cuda fortran kernel. Until now I use a simple random number generator which I adapted as a device subroutine which, however, is not so easy to use because I have to manually manage the parallelism of calls to avoid that the different threads extract the same random sequence (i.e., I use an array of seeds and of saved variable).
b) Moreover, the subroutine can be called only with a predefined thread grid, and not in different loops. Any suggestion on how to avoid that?
c) Finally, I would like to call it from an automatically generated cuf directive kernel. Is it possibile?
d) curand seems quite complicated to use, is there any prepared fortran interface to call it in cuda fortran?
I do not need an optimal random number generator, ran2.f of numerical recipes could be perfect for me.