QUDA  v1.1.0
A library for QCD on GPUs
Public Member Functions | Friends | List of all members
quda::cudaCloverField Class Reference

#include <clover_field.h>

+ Inheritance diagram for quda::cudaCloverField:

Public Member Functions

 cudaCloverField (const CloverFieldParam &param)
 
virtual ~cudaCloverField ()
 
void copy (const CloverField &src, bool inverse=true)
 Copy into this CloverField from the generic CloverField src. More...
 
void loadCPUField (const cpuCloverField &cpu)
 
void saveCPUField (cpuCloverField &cpu) const
 
void prefetch (QudaFieldLocation mem_space, qudaStream_t stream=0) const
 If managed memory and prefetch is enabled, prefetch the clover, the norm field (as appropriate), and the inverse fields (as appropriate) to the CPU or the GPU. More...
 
void prefetch (QudaFieldLocation mem_space, qudaStream_t stream, CloverPrefetchType type, QudaParity parity=QUDA_INVALID_PARITY) const
 If managed memory and prefetch is enabled, prefetch the clover, norm field and/or the inverse fields as specified to the CPU or the GPU. More...
 
virtual void copy_to_buffer (void *buffer) const
 Copy all contents of the field to a host buffer. More...
 
virtual void copy_from_buffer (void *buffer)
 Copy all contents of the field from a host buffer to this field. More...
 
- Public Member Functions inherited from quda::CloverField
 CloverField (const CloverFieldParam &param)
 
virtual ~CloverField ()
 
void * V (bool inverse=false)
 
void * Norm (bool inverse=false)
 
const void * V (bool inverse=false) const
 
const void * Norm (bool inverse=false) const
 
bool isNative () const
 
double * TrLog () const
 
QudaCloverFieldOrder Order () const
 
size_t Bytes () const
 
size_t NormBytes () const
 
size_t TotalBytes () const
 
int Ncolor () const
 
int Nspin () const
 
double Csw () const
 
double Coeff () const
 
bool Twisted () const
 
double Mu2 () const
 
double Rho () const
 
void setRho (double rho)
 Bakes in the rho factor into the clover field, (for real diagonal additive Hasenbusch), e.g., A + rho. More...
 
double norm1 (bool inverse=false) const
 Compute the L1 norm of the field. More...
 
double norm2 (bool inverse=false) const
 Compute the L2 norm squared of the field. More...
 
double abs_max (bool inverse=false) const
 Compute the absolute maximum of the field (Linfinity norm) More...
 
double abs_min (bool inverse=false) const
 Compute the absolute minimum of the field. More...
 
virtual int full_dim (int d) const
 
- Public Member Functions inherited from quda::LatticeField
 LatticeField (const LatticeFieldParam &param)
 
 LatticeField (const LatticeField &field)
 
virtual ~LatticeField ()
 
void allocateGhostBuffer (size_t ghost_bytes) const
 Allocate the static ghost buffers. More...
 
void createComms (bool no_comms_fill=false, bool bidir=true)
 
void destroyComms ()
 
void createIPCComms ()
 
bool ipcCopyComplete (int dir, int dim)
 
bool ipcRemoteCopyComplete (int dir, int dim)
 
const cudaEvent_t & getIPCCopyEvent (int dir, int dim) const
 
const cudaEvent_t & getIPCRemoteCopyEvent (int dir, int dim) const
 
int Ndim () const
 
const int * X () const
 
size_t Volume () const
 
size_t VolumeCB () const
 
size_t LocalVolume () const
 
size_t LocalVolumeCB () const
 
const int * SurfaceCB () const
 
int SurfaceCB (const int i) const
 
size_t Stride () const
 
int Pad () const
 
const int * R () const
 
QudaGhostExchange GhostExchange () const
 
QudaPrecision Precision () const
 
QudaPrecision GhostPrecision () const
 
double Scale () const
 
void Scale (double scale_)
 Set the scale factor for a fixed-point field. More...
 
virtual QudaSiteSubset SiteSubset () const
 
virtual QudaMemoryType MemType () const
 
int Nvec () const
 
QudaFieldLocation Location () const
 
size_t GBytes () const
 
void checkField (const LatticeField &a) const
 
virtual void read (char *filename)
 
virtual void write (char *filename)
 
void * myFace_h (int dir, int dim) const
 Return pointer to the local pinned my_face buffer in a given direction and dimension. More...
 
void * myFace_hd (int dir, int dim) const
 Return pointer to the local mapped my_face buffer in a given direction and dimension. More...
 
void * myFace_d (int dir, int dim) const
 Return pointer to the device send buffer in a given direction and dimension. More...
 
void * remoteFace_d (int dir, int dim) const
 Return base pointer to a remote device buffer for direct sending in a given direction and dimension. Since this is a base pointer, one still needs to take care of offsetting to the correct point for each direction/dimension. More...
 
void * remoteFace_r () const
 Return base pointer to the ghost recv buffer. Since this is a base pointer, one still needs to take care of offsetting to the correct point for each direction/dimension. More...
 
virtual void gather (int nFace, int dagger, int dir, qudaStream_t *stream_p=NULL)
 
virtual void commsStart (int nFace, int dir, int dagger=0, qudaStream_t *stream_p=NULL, bool gdr_send=false, bool gdr_recv=true)
 
virtual int commsQuery (int nFace, int dir, int dagger=0, qudaStream_t *stream_p=NULL, bool gdr_send=false, bool gdr_recv=true)
 
virtual void commsWait (int nFace, int dir, int dagger=0, qudaStream_t *stream_p=NULL, bool gdr_send=false, bool gdr_recv=true)
 
virtual void scatter (int nFace, int dagger, int dir)
 
const char * VolString () const
 
const char * AuxString () const
 
virtual void backup () const
 Backs up the LatticeField. More...
 
virtual void restore () const
 Restores the LatticeField. More...
 
- Public Member Functions inherited from quda::Object
 Object ()
 
virtual ~Object ()
 

Friends

class DiracClover
 
class DiracCloverPC
 
class DiracTwistedClover
 
class DiracTwistedCloverPC
 
struct FullClover
 

Additional Inherited Members

- Public Types inherited from quda::CloverField
using param_type = CloverFieldParam
 
- Static Public Member Functions inherited from quda::CloverField
static CloverFieldCreate (const CloverFieldParam &param)
 
- Static Public Member Functions inherited from quda::LatticeField
static void freeGhostBuffer (void)
 Free statically allocated ghost buffers. More...
 
static void destroyIPCComms ()
 
- Static Public Member Functions inherited from quda::Object
static void * operator new (std::size_t size)
 
static void operator delete (void *p)
 
static void * operator new[] (std::size_t size)
 
static void operator delete[] (void *p)
 
- Static Public Attributes inherited from quda::LatticeField
static int bufferIndex = 0
 
static bool ghost_field_reset = false
 
- Protected Member Functions inherited from quda::LatticeField
virtual void setTuningString ()
 
void precisionCheck ()
 
- Protected Attributes inherited from quda::CloverField
size_t bytes
 
size_t norm_bytes
 
size_t length
 
size_t real_length
 
int nColor
 
int nSpin
 
void * clover
 
void * norm
 
void * cloverInv
 
void * invNorm
 
double csw
 
double coeff
 
bool twisted
 
double mu2
 
double rho
 
QudaCloverFieldOrder order
 
QudaFieldCreate create
 
double trlog [2]
 
- Protected Attributes inherited from quda::LatticeField
size_t volume
 
size_t volumeCB
 
size_t localVolume
 
size_t localVolumeCB
 
size_t stride
 
int pad
 
size_t total_bytes
 
int nDim
 
int x [QUDA_MAX_DIM]
 
int surface [QUDA_MAX_DIM]
 
int surfaceCB [QUDA_MAX_DIM]
 
int r [QUDA_MAX_DIM]
 
QudaPrecision precision
 
QudaPrecision ghost_precision
 
bool ghost_precision_reset
 
double scale
 
QudaSiteSubset siteSubset
 
QudaGhostExchange ghostExchange
 
int nDimComms
 
size_t ghost_bytes
 
size_t ghost_bytes_old
 
size_t ghost_face_bytes [QUDA_MAX_DIM]
 
size_t ghost_face_bytes_aligned [QUDA_MAX_DIM]
 
size_t ghost_offset [QUDA_MAX_DIM][2]
 
void * my_face_h [2]
 
void * my_face_hd [2]
 
void * my_face_d [2]
 
void * my_face_dim_dir_h [2][QUDA_MAX_DIM][2]
 
void * my_face_dim_dir_hd [2][QUDA_MAX_DIM][2]
 
void * my_face_dim_dir_d [2][QUDA_MAX_DIM][2]
 
void * from_face_h [2]
 
void * from_face_hd [2]
 
void * from_face_d [2]
 
void * from_face_dim_dir_h [2][QUDA_MAX_DIM][2]
 
void * from_face_dim_dir_hd [2][QUDA_MAX_DIM][2]
 
void * from_face_dim_dir_d [2][QUDA_MAX_DIM][2]
 
MsgHandlemh_recv_fwd [2][QUDA_MAX_DIM]
 
MsgHandlemh_recv_back [2][QUDA_MAX_DIM]
 
MsgHandlemh_send_fwd [2][QUDA_MAX_DIM]
 
MsgHandlemh_send_back [2][QUDA_MAX_DIM]
 
MsgHandlemh_recv_rdma_fwd [2][QUDA_MAX_DIM]
 
MsgHandlemh_recv_rdma_back [2][QUDA_MAX_DIM]
 
MsgHandlemh_send_rdma_fwd [2][QUDA_MAX_DIM]
 
MsgHandlemh_send_rdma_back [2][QUDA_MAX_DIM]
 
bool initComms
 
char vol_string [TuneKey::volume_n]
 
char aux_string [TuneKey::aux_n]
 
QudaMemoryType mem_type
 
char * backup_h
 
char * backup_norm_h
 
bool backed_up
 
- Static Protected Attributes inherited from quda::LatticeField
static void * ghost_send_buffer_d [2] = {nullptr, nullptr}
 
static void * ghost_recv_buffer_d [2] = {nullptr, nullptr}
 
static void * ghost_pinned_send_buffer_h [2] = {nullptr, nullptr}
 
static void * ghost_pinned_recv_buffer_h [2] = {nullptr, nullptr}
 
static void * ghost_pinned_send_buffer_hd [2] = {nullptr, nullptr}
 
static void * ghost_pinned_recv_buffer_hd [2] = {nullptr, nullptr}
 
static void * ghost_remote_send_buffer_d [2][QUDA_MAX_DIM][2]
 
static size_t ghostFaceBytes = 0
 
static bool initGhostFaceBuffer = false
 
static MsgHandlemh_send_p2p_fwd [2][QUDA_MAX_DIM] { }
 
static MsgHandlemh_send_p2p_back [2][QUDA_MAX_DIM] { }
 
static MsgHandlemh_recv_p2p_fwd [2][QUDA_MAX_DIM] { }
 
static MsgHandlemh_recv_p2p_back [2][QUDA_MAX_DIM] { }
 
static int buffer_send_p2p_fwd [2][QUDA_MAX_DIM] { }
 
static int buffer_recv_p2p_fwd [2][QUDA_MAX_DIM] { }
 
static int buffer_send_p2p_back [2][QUDA_MAX_DIM] { }
 
static int buffer_recv_p2p_back [2][QUDA_MAX_DIM] { }
 
static cudaEvent_t ipcCopyEvent [2][2][QUDA_MAX_DIM]
 
static cudaEvent_t ipcRemoteCopyEvent [2][2][QUDA_MAX_DIM]
 
static bool initIPCComms = false
 

Detailed Description

Definition at line 253 of file clover_field.h.

Constructor & Destructor Documentation

◆ cudaCloverField()

quda::cudaCloverField::cudaCloverField ( const CloverFieldParam param)

Definition at line 85 of file clover_field.cpp.

◆ ~cudaCloverField()

quda::cudaCloverField::~cudaCloverField ( )
virtual

Definition at line 162 of file clover_field.cpp.

Member Function Documentation

◆ copy()

void quda::cudaCloverField::copy ( const CloverField src,
bool  inverse = true 
)

Copy into this CloverField from the generic CloverField src.

Parameters
srcThe clover field from which we want to copy
inverseAre we copying the inverse or direct field

Definition at line 174 of file clover_field.cpp.

◆ copy_from_buffer()

void quda::cudaCloverField::copy_from_buffer ( void *  buffer)
virtual

Copy all contents of the field from a host buffer to this field.

Parameters
[in]thehost buffer to copy from.

Implements quda::LatticeField.

Definition at line 287 of file clover_field.cpp.

◆ copy_to_buffer()

void quda::cudaCloverField::copy_to_buffer ( void *  buffer) const
virtual

Copy all contents of the field to a host buffer.

Parameters
[in]thehost buffer to copy to.

Implements quda::LatticeField.

Definition at line 267 of file clover_field.cpp.

◆ loadCPUField()

void quda::cudaCloverField::loadCPUField ( const cpuCloverField cpu)

Copy into this CloverField from the cpuCloverField cpu

Parameters
cpuThe cpu clover field from which we want to copy

Definition at line 232 of file clover_field.cpp.

◆ prefetch() [1/2]

void quda::cudaCloverField::prefetch ( QudaFieldLocation  mem_space,
qudaStream_t  stream,
CloverPrefetchType  type,
QudaParity  parity = QUDA_INVALID_PARITY 
) const

If managed memory and prefetch is enabled, prefetch the clover, norm field and/or the inverse fields as specified to the CPU or the GPU.

Parameters
[in]mem_spaceMemory space we are prefetching to
[in]streamWhich stream to run the prefetch in
[in]typeWhether to grab the clover, inverse, or both
[in]parityWhether to grab the full clover or just the even/odd parity

Definition at line 312 of file clover_field.cpp.

◆ prefetch() [2/2]

void quda::cudaCloverField::prefetch ( QudaFieldLocation  mem_space,
qudaStream_t  stream = 0 
) const
virtual

If managed memory and prefetch is enabled, prefetch the clover, the norm field (as appropriate), and the inverse fields (as appropriate) to the CPU or the GPU.

Parameters
[in]mem_spaceMemory space we are prefetching to
[in]streamWhich stream to run the prefetch in (default 0)

Reimplemented from quda::LatticeField.

Definition at line 307 of file clover_field.cpp.

◆ saveCPUField()

void quda::cudaCloverField::saveCPUField ( cpuCloverField cpu) const

Copy from this CloverField into cpuCloverField cpu

Parameters
cpuThe cpu clover destination field

Definition at line 234 of file clover_field.cpp.

Friends And Related Function Documentation

◆ DiracClover

friend class DiracClover
friend

Definition at line 324 of file clover_field.h.

◆ DiracCloverPC

friend class DiracCloverPC
friend

Definition at line 325 of file clover_field.h.

◆ DiracTwistedClover

friend class DiracTwistedClover
friend

Definition at line 326 of file clover_field.h.

◆ DiracTwistedCloverPC

friend class DiracTwistedCloverPC
friend

Definition at line 327 of file clover_field.h.

◆ FullClover

friend struct FullClover
friend

Definition at line 328 of file clover_field.h.


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