This project is read-only.

curand_init and curand_uniform

Sep 23, 2013 at 7:08 PM
Hi. Congratulations for the amazing CUDAfy Project.

Could you give an example how to use the setup seeds curand_init and curand_uniform in CUDAfy?

In CUDA C will be something like:

global void setup_kernel ( curandState * state, unsigned long seed )
{
int id = threadIdx.x;
curand_init ( seed, id, 0, &state[id] );
}

global void generate( curandState* globalState, float *Vector )
{
int ind = threadIdx.x;
curandState localState = globalState[ind];
Vector[ind] = curand_uniform( &localState );
globalState[ind] = localState; 
}

Thanks in advance.

Thieberson
Sep 24, 2013 at 9:11 AM
Hello there,
You could look at the CURANDTests.cs in the Cudafy.Host.UnitTests project.
Nick
Sep 24, 2013 at 5:25 PM
Edited Sep 24, 2013 at 5:26 PM
Hey, thank you.

It was all I need.

Excelent job.

Thieberson