8 #include <curand_kernel.h> 14 #elif defined(MRG32k3a) 82 return a + (b - a) * curand_uniform(&state);
87 return a + (b - a) * curand_uniform_double(&state);
103 return curand_uniform(&state);
108 return curand_uniform_double(&state);
118 return curand_uniform(&state);
125 return curand_uniform_double(&state);
137 return curand_normal(&state);
144 return curand_normal_double(&state);
void AllocateRNG()
local lattice dimensions
static __device__ double rand(cuRNGState &state)
void Init()
Initialize CURAND RNG states.
struct curandStateMRG32k3a cuRNGState
__device__ Real Random(cuRNGState &state, Real a, Real b)
Return a random number between a and b.
void backup()
Backup CURAND array states initialization.
unsigned long long Seed()
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.
cuRNGState * backup_state
RNG(const LatticeField &meta, unsigned long long seedin)
allocate curand rng states array in device memory
static __device__ float rand(cuRNGState &state)
__host__ __device__ __inline__ cuRNGState * State()
__device__ double Random< double >(cuRNGState &state, double a, double b)
int size_cb
number of curand states
int X[4]
number of curand states checkerboarded (equal to size if we have a single parity) ...