QUDA
1.0.0
|
Class declaration to initialize and hold CURAND RNG states. More...
#include <random_quda.h>
Public Member Functions | |
RNG (const LatticeField &meta, unsigned long long seedin) | |
allocate curand rng states array in device memory More... | |
RNG (const LatticeFieldParam ¶m, unsigned long long seedin) | |
Constructor that takes its metadata from a param. More... | |
void | Release () |
Release Device memory for CURAND RNG states. More... | |
void | Init () |
Initialize CURAND RNG states. More... | |
unsigned long long | Seed () |
__host__ __device__ __inline__ cuRNGState * | State () |
void | restore () |
Restore CURAND array states initialization. More... | |
void | backup () |
Backup CURAND array states initialization. More... | |
Private Member Functions | |
void | AllocateRNG () |
local lattice dimensions More... | |
Private Attributes | |
cuRNGState * | state |
cuRNGState * | backup_state |
unsigned long long | seed |
int | size |
int | size_cb |
number of curand states More... | |
int | X [4] |
number of curand states checkerboarded (equal to size if we have a single parity) More... | |
Class declaration to initialize and hold CURAND RNG states.
Definition at line 23 of file random_quda.h.
quda::RNG::RNG | ( | const LatticeField & | meta, |
unsigned long long | seedin | ||
) |
allocate curand rng states array in device memory
Constructor that takes its metadata from a field
[in] | meta | The field whose data we use |
[in] | seed | Seed to initialize the RNG |
Definition at line 85 of file random.cu.
References getVerbosity(), printfQuda, QUDA_VERBOSE, state, X, and quda::LatticeField::X().
quda::RNG::RNG | ( | const LatticeFieldParam & | param, |
unsigned long long | seedin | ||
) |
Constructor that takes its metadata from a param.
[in] | param | The param whose data we use |
[in] | seed | Seed to initialize the RNG |
Definition at line 101 of file random.cu.
References getVerbosity(), printfQuda, QUDA_VERBOSE, quda::LatticeFieldParam::siteSubset, size, size_cb, state, X, and quda::LatticeFieldParam::x.
|
private |
local lattice dimensions
Allocate Device memory for CURAND RNG states.
Definition at line 130 of file random.cu.
References CUDA_SAFE_CALL, device_malloc, errorQuda, getVerbosity(), printfQuda, QUDA_DEBUG_VERBOSE, size, and state.
Referenced by Init().
void quda::RNG::backup | ( | ) |
Backup CURAND array states initialization.
Definition at line 166 of file random.cu.
References backup_state, errorQuda, host_free, safe_malloc, size, and state.
Referenced by quda::SpinorNoise< real, Ns, Nc, type, Arg >::preTune(), and State().
void quda::RNG::Init | ( | ) |
Initialize CURAND RNG states.
initialize curand rng states with seed
Definition at line 122 of file random.cu.
References AllocateRNG(), quda::launch_kernel_random(), seed, size, size_cb, state, and X.
Referenced by quda::gaugeGauss(), main(), quda::MG::MG(), quda::TRLM::operator()(), and quda::spinorNoise().
void quda::RNG::Release | ( | ) |
Release Device memory for CURAND RNG states.
free array
Definition at line 145 of file random.cu.
References device_free, getVerbosity(), printfQuda, QUDA_DEBUG_VERBOSE, size, and state.
Referenced by quda::gaugeGauss(), main(), quda::TRLM::operator()(), quda::spinorNoise(), and quda::MG::~MG().
void quda::RNG::restore | ( | ) |
Restore CURAND array states initialization.
Definition at line 156 of file random.cu.
References backup_state, errorQuda, host_free, size, and state.
Referenced by quda::SpinorNoise< real, Ns, Nc, type, Arg >::postTune(), and State().
|
inline |
Definition at line 55 of file random_quda.h.
References seed.
|
inline |
Definition at line 57 of file random_quda.h.
References backup(), restore(), and state.
Referenced by quda::SpinorNoiseCPU(), and quda::SpinorNoiseGPU().
|
private |
array with current curand rng state
Definition at line 27 of file random_quda.h.
|
private |
array for backup of current curand rng state
Definition at line 28 of file random_quda.h.
|
private |
initial rng seed
Definition at line 29 of file random_quda.h.
Referenced by AllocateRNG(), backup(), Init(), Release(), restore(), and RNG().
|
private |
number of curand states
Definition at line 30 of file random_quda.h.
|
private |
Definition at line 26 of file random_quda.h.
Referenced by AllocateRNG(), backup(), Init(), Release(), restore(), RNG(), and State().
|
private |
number of curand states checkerboarded (equal to size if we have a single parity)
Definition at line 31 of file random_quda.h.