8 #include <curand_kernel.h> 14 #elif defined(MRG32k3a) 25 RNG(
int rng_sizes,
int seedin,
const int XX[4]);
26 RNG(
int rng_sizes,
int seedin);
55 void INITRNG(
int rng_sizes,
int seedin,
int offsetin);
77 return a + (
b -
a) * curand_uniform(&state);
82 return a + (
b -
a) * curand_uniform_double(&state);
98 return curand_uniform(&state);
103 return curand_uniform_double(&state);
113 return curand_uniform(&state);
120 return curand_uniform_double(&state);
132 return curand_normal(&state);
139 return curand_normal_double(&state);
void AllocateRNG()
allocate curand rng states array in device memory
static __device__ double rand(cuRNGState &state)
void Init()
Initialize CURAND RNG states.
struct curandStateMRG32k3a cuRNGState
RNG(int rng_sizes, int seedin, const int XX[4])
__device__ Real Random(cuRNGState &state, Real a, Real b)
Return a random number between a and b.
void backup()
Backup CURAND array states initialization.
int Size()
return curand rng array size
void Release()
Release Device memory for CURAND RNG states.
void restore()
Restore CURAND array states initialization.
__device__ float Random< float >(cuRNGState &state, float a, float b)
Class declaration to initialize and hold CURAND RNG states.
int rng_size
number of curand states
void INITRNG(int rng_sizes, int seedin, int offsetin)
CURAND array states initialization.
cuRNGState * backup_state
static __device__ float rand(cuRNGState &state)
__host__ __device__ __inline__ cuRNGState * State()
__device__ double Random< double >(cuRNGState &state, double a, double b)
int node_offset
offset in the index, in case of multigpus