8 #include <curand_kernel.h>
14 #elif defined(MRG32k3a)
28 unsigned long long seed;
55 unsigned long long Seed() {
return seed; };
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);
Class declaration to initialize and hold CURAND RNG states.
void backup()
Backup CURAND array states initialization.
RNG(const LatticeFieldParam ¶m, unsigned long long seedin)
Constructor that takes its metadata from a param.
RNG(const LatticeField &meta, unsigned long long seedin)
allocate curand rng states array in device memory
__host__ __device__ __inline__ cuRNGState * State()
unsigned long long Seed()
void restore()
Restore CURAND array states initialization.
__device__ float Random< float >(cuRNGState &state, float a, float b)
__device__ double Random< double >(cuRNGState &state, double a, double b)
__device__ Real Random(cuRNGState &state, Real a, Real b)
Return a random number between a and b.
struct curandStateMRG32k3a cuRNGState
static __device__ double rand(cuRNGState &state)
static __device__ float rand(cuRNGState &state)