QUDA  0.9.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
quda::RNG Class Reference

Class declaration to initialize and hold CURAND RNG states. More...

#include <random_quda.h>

Public Member Functions

 RNG (int rng_sizes, int seedin, const int XX[4])
 
 RNG (int rng_sizes, int seedin)
 
void Release ()
 Release Device memory for CURAND RNG states. More...
 
void Init ()
 Initialize CURAND RNG states. More...
 
int Size ()
 return curand rng array size More...
 
int Node_Offset ()
 
int Seed ()
 
__host__ __device__ __inline__ cuRNGStateState ()
 
void restore ()
 Restore CURAND array states initialization. More...
 
void backup ()
 Backup CURAND array states initialization. More...
 

Private Member Functions

void AllocateRNG ()
 allocate curand rng states array in device memory More...
 
void INITRNG (int rng_sizes, int seedin, int offsetin)
 CURAND array states initialization. More...
 

Private Attributes

cuRNGStatestate
 
cuRNGStatebackup_state
 
int seed
 
int rng_size
 number of curand states More...
 
int node_offset
 offset in the index, in case of multigpus More...
 
int X [4]
 

Detailed Description

Class declaration to initialize and hold CURAND RNG states.

Definition at line 23 of file random_quda.h.

Constructor & Destructor Documentation

◆ RNG() [1/2]

quda::RNG::RNG ( int  rng_sizes,
int  seedin,
const int  XX[4] 
)

Definition at line 122 of file random.cu.

References comm_rank(), fused_exterior_ndeg_tm_dslash_cuda_gen::i, node_offset, printfQuda, rng_size, seed, state, and X.

Here is the call graph for this function:

◆ RNG() [2/2]

quda::RNG::RNG ( int  rng_sizes,
int  seedin 
)

Definition at line 103 of file random.cu.

References comm_rank(), fused_exterior_ndeg_tm_dslash_cuda_gen::i, node_offset, printfQuda, rng_size, seed, state, and X.

Here is the call graph for this function:

Member Function Documentation

◆ AllocateRNG()

void quda::RNG::AllocateRNG ( )
private

allocate curand rng states array in device memory

Allocate Device memory for CURAND RNG states.

Definition at line 155 of file random.cu.

References CUDA_SAFE_CALL, device_malloc, errorQuda, printfQuda, rng_size, and state.

Referenced by Init().

Here is the caller graph for this function:

◆ backup()

void quda::RNG::backup ( )

Backup CURAND array states initialization.

Definition at line 189 of file random.cu.

References backup_state, err, errorQuda, host_free, printfQuda, rng_size, safe_malloc, and state.

Referenced by quda::GaussSpinor< FloatIn, Ns, Nc, InOrder >::preTune().

Here is the caller graph for this function:

◆ Init()

void quda::RNG::Init ( )

Initialize CURAND RNG states.

initialize curand rng states with seed

Definition at line 146 of file random.cu.

References AllocateRNG(), quda::launch_kernel_random(), node_offset, rng_size, seed, state, and X.

Referenced by gaussGaugeQuda(), main(), and quda::spinorGauss().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ INITRNG()

void quda::RNG::INITRNG ( int  rng_sizes,
int  seedin,
int  offsetin 
)
private

CURAND array states initialization.

◆ Node_Offset()

int quda::RNG::Node_Offset ( )
inline

Definition at line 33 of file random_quda.h.

References node_offset.

◆ Release()

void quda::RNG::Release ( )

Release Device memory for CURAND RNG states.

free array

Definition at line 168 of file random.cu.

References device_free, printfQuda, rng_size, and state.

Referenced by gaussGaugeQuda(), main(), and quda::spinorGauss().

Here is the caller graph for this function:

◆ restore()

void quda::RNG::restore ( )

Restore CURAND array states initialization.

Definition at line 179 of file random.cu.

References backup_state, err, errorQuda, host_free, printfQuda, rng_size, and state.

Referenced by quda::GaussSpinor< FloatIn, Ns, Nc, InOrder >::postTune().

Here is the caller graph for this function:

◆ Seed()

int quda::RNG::Seed ( )
inline

Definition at line 34 of file random_quda.h.

References seed.

◆ Size()

int quda::RNG::Size ( )
inline

return curand rng array size

Definition at line 32 of file random_quda.h.

References rng_size.

◆ State()

__host__ __device__ __inline__ cuRNGState* quda::RNG::State ( )
inline

Definition at line 35 of file random_quda.h.

References state.

Referenced by quda::gaussSpinor(), and quda::gaussSpinorKernel().

Here is the caller graph for this function:

Member Data Documentation

◆ backup_state

cuRNGState* quda::RNG::backup_state
private

array for backup of current curand rng state

Definition at line 44 of file random_quda.h.

Referenced by backup(), and restore().

◆ node_offset

int quda::RNG::node_offset
private

offset in the index, in case of multigpus

Definition at line 50 of file random_quda.h.

Referenced by Init(), Node_Offset(), and RNG().

◆ rng_size

int quda::RNG::rng_size
private

number of curand states

Definition at line 48 of file random_quda.h.

Referenced by AllocateRNG(), backup(), Init(), Release(), restore(), RNG(), and Size().

◆ seed

int quda::RNG::seed
private

initial rng seed

Definition at line 46 of file random_quda.h.

Referenced by Init(), RNG(), and Seed().

◆ state

cuRNGState* quda::RNG::state
private

array with current curand rng state

Definition at line 42 of file random_quda.h.

Referenced by AllocateRNG(), backup(), Init(), Release(), restore(), RNG(), and State().

◆ X

int quda::RNG::X[4]
private

Definition at line 51 of file random_quda.h.

Referenced by Init(), and RNG().


The documentation for this class was generated from the following files: