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

#include <color_spinor_field.h>

+ Inheritance diagram for quda::cudaColorSpinorField:

Public Member Functions

 cudaColorSpinorField (const cudaColorSpinorField &)
 
 cudaColorSpinorField (const ColorSpinorField &, const ColorSpinorParam &)
 
 cudaColorSpinorField (const ColorSpinorField &)
 
 cudaColorSpinorField (const ColorSpinorParam &)
 
virtual ~cudaColorSpinorField ()
 
ColorSpinorFieldoperator= (const ColorSpinorField &)
 
cudaColorSpinorFieldoperator= (const cudaColorSpinorField &)
 
cudaColorSpinorFieldoperator= (const cpuColorSpinorField &)
 
void copy (const cudaColorSpinorField &)
 
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...
 
void switchBufferPinned ()
 
void createComms (int nFace, bool spin_project=true)
 Create the communication handlers and buffers. More...
 
void allocateGhostBuffer (int nFace, bool spin_project=true) const
 Allocate the ghost buffers. More...
 
void packGhost (const int nFace, const QudaParity parity, const int dim, const QudaDirection dir, const int dagger, qudaStream_t *stream, MemoryLocation location[2 *QUDA_MAX_DIM], MemoryLocation location_label, bool spin_project, double a=0, double b=0, double c=0, int shmem=0)
 Packs the cudaColorSpinorField's ghost zone. More...
 
void packGhostExtended (const int nFace, const int R[], const QudaParity parity, const int dim, const QudaDirection dir, const int dagger, qudaStream_t *stream, bool zero_copy=false)
 
void sendGhost (void *ghost_spinor, const int nFace, const int dim, const QudaDirection dir, const int dagger, qudaStream_t *stream)
 
void unpackGhost (const void *ghost_spinor, const int nFace, const int dim, const QudaDirection dir, const int dagger, qudaStream_t *stream)
 
void unpackGhostExtended (const void *ghost_spinor, const int nFace, const QudaParity parity, const int dim, const QudaDirection dir, const int dagger, qudaStream_t *stream, bool zero_copy)
 
void streamInit (qudaStream_t *stream_p)
 
void pack (int nFace, int parity, int dagger, int stream_idx, MemoryLocation location[], MemoryLocation location_label, bool spin_project=true, double a=0, double b=0, double c=0, int shmem=0)
 
void packExtended (const int nFace, const int R[], const int parity, const int dagger, const int dim, qudaStream_t *stream_p, const bool zeroCopyPack=false)
 
void gather (int nFace, int dagger, int dir, qudaStream_t *stream_p=NULL)
 
void recvStart (int nFace, int dir, int dagger=0, qudaStream_t *stream_p=nullptr, bool gdr=false)
 Initiate halo communication receive. More...
 
void sendStart (int nFace, int d, int dagger=0, qudaStream_t *stream_p=nullptr, bool gdr=false, bool remote_write=false)
 Initiate halo communication sending. More...
 
void commsStart (int nFace, int d, int dagger=0, qudaStream_t *stream_p=nullptr, bool gdr_send=false, bool gdr_recv=false)
 Initiate halo communication. More...
 
int commsQuery (int nFace, int d, int dagger=0, qudaStream_t *stream_p=nullptr, bool gdr_send=false, bool gdr_recv=false)
 Non-blocking query if the halo communication has completed. More...
 
void commsWait (int nFace, int d, int dagger=0, qudaStream_t *stream_p=nullptr, bool gdr_send=false, bool gdr_recv=false)
 Wait on halo communication to complete. More...
 
void scatter (int nFace, int dagger, int dir, qudaStream_t *stream_p)
 
void scatter (int nFace, int dagger, int dir)
 
void scatterExtended (int nFace, int parity, int dagger, int dir)
 
const void * Ghost2 () const
 
void exchangeGhost (QudaParity parity, int nFace, int dagger, const MemoryLocation *pack_destination=nullptr, const MemoryLocation *halo_location=nullptr, bool gdr_send=false, bool gdr_recv=false, QudaPrecision ghost_precision=QUDA_INVALID_PRECISION) const
 This is a unified ghost exchange function for doing a complete halo exchange regardless of the type of field. All dimensions are exchanged and no spin projection is done in the case of Wilson fermions. More...
 
cudaColorSpinorFieldComponent (const int idx) const
 for composite fields: More...
 
CompositeColorSpinorFieldComponents () const
 
void CopySubset (cudaColorSpinorField &dst, const int range, const int first_element=0) const
 
void zero ()
 
void Source (const QudaSourceType sourceType, const int st=0, const int s=0, const int c=0)
 
void PrintVector (unsigned int x) const
 
void backup () const
 Backs up the cudaColorSpinorField. More...
 
void restore () const
 Restores the cudaColorSpinorField. More...
 
void prefetch (QudaFieldLocation mem_space, qudaStream_t stream=0) const
 If managed memory and prefetch is enabled, prefetch the spinor, the norm field (as appropriate), to the CPU or the GPU. More...
 
- Public Member Functions inherited from quda::ColorSpinorField
 ColorSpinorField (const ColorSpinorField &)
 
 ColorSpinorField (const ColorSpinorParam &)
 
virtual ~ColorSpinorField ()
 
int Ncolor () const
 
int Nspin () const
 
int Nvec () const
 
QudaTwistFlavorType TwistFlavor () const
 
int Ndim () const
 
const int * X () const
 
int X (int d) const
 
size_t RealLength () const
 
size_t Length () const
 
size_t Stride () const
 
size_t Volume () const
 
size_t VolumeCB () const
 
int Pad () const
 
size_t Bytes () const
 
size_t NormBytes () const
 
size_t TotalBytes () const
 
size_t GhostBytes () const
 
size_t GhostFaceBytes (int i) const
 
size_t GhostNormBytes () const
 
void PrintDims () const
 
void * V ()
 
const void * V () const
 
void * Norm ()
 
const void * Norm () const
 
virtual int full_dim (int d) const
 
void exchange (void **ghost, void **sendbuf, int nFace=1) const
 
bool isNative () const
 
bool IsComposite () const
 
bool IsComponent () const
 
int CompositeDim () const
 
int ComponentId () const
 
int ComponentVolume () const
 
int ComponentVolumeCB () const
 
int ComponentStride () const
 
size_t ComponentLength () const
 
size_t ComponentRealLength () const
 
size_t ComponentBytes () const
 
size_t ComponentNormBytes () const
 
QudaPCType PCType () const
 
QudaParity SuggestedParity () const
 
void setSuggestedParity (QudaParity suggested_parity)
 
QudaSiteSubset SiteSubset () const
 
QudaSiteOrder SiteOrder () const
 
QudaFieldOrder FieldOrder () const
 
QudaGammaBasis GammaBasis () const
 
const int * GhostFace () const
 
const int * GhostFaceCB () const
 
size_t GhostOffset (const int dim, const int dir) const
 
void * Ghost (const int i)
 
const void * Ghost (const int i) const
 
void * GhostNorm (const int i)
 
const void * GhostNorm (const int i) const
 
void *const * Ghost () const
 
const DslashConstantgetDslashConstant () const
 Get the dslash_constant structure from this field. More...
 
const ColorSpinorFieldEven () const
 
const ColorSpinorFieldOdd () const
 
ColorSpinorFieldEven ()
 
ColorSpinorFieldOdd ()
 
ColorSpinorFieldComponent (const int idx) const
 
ColorSpinorFieldComponent (const int idx)
 
CompositeColorSpinorFieldComponents ()
 
void PrintVector (unsigned int x_cb, unsigned int parity) const
 Thin wrapper around PrintVector that takes in a checkerboard index and a parity instead of a full index. More...
 
void LatticeIndex (int *y, int i) const
 
void OffsetIndex (int &i, int *y) const
 
ColorSpinorFieldCreateAlias (const ColorSpinorParam &param)
 Create a field that aliases this field's storage. The alias field can use a different precision than this field, though it cannot be greater. This functionality is useful for the case where we have multiple temporaries in different precisions, but do not need them simultaneously. Use this functionality with caution. More...
 
ColorSpinorFieldCreateCoarse (const int *geoBlockSize, int spinBlockSize, int Nvec, QudaPrecision precision=QUDA_INVALID_PRECISION, QudaFieldLocation location=QUDA_INVALID_FIELD_LOCATION, QudaMemoryType mem_Type=QUDA_MEMORY_INVALID)
 Create a coarse color-spinor field, using this field to set the meta data. More...
 
ColorSpinorFieldCreateFine (const int *geoblockSize, int spinBlockSize, int Nvec, QudaPrecision precision=QUDA_INVALID_PRECISION, QudaFieldLocation location=QUDA_INVALID_FIELD_LOCATION, QudaMemoryType mem_type=QUDA_MEMORY_INVALID)
 Create a fine color-spinor field, using this field to set the meta data. More...
 
- 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 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...
 
const char * VolString () const
 
const char * AuxString () const
 
- Public Member Functions inherited from quda::Object
 Object ()
 
virtual ~Object ()
 

Friends

class cpuColorSpinorField
 
std::ostream & operator<< (std::ostream &out, const cudaColorSpinorField &)
 

Additional Inherited Members

- Public Types inherited from quda::ColorSpinorField
using param_type = ColorSpinorParam
 
- Static Public Member Functions inherited from quda::ColorSpinorField
static ColorSpinorFieldCreate (const ColorSpinorParam &param)
 
static ColorSpinorFieldCreate (const ColorSpinorField &src, const ColorSpinorParam &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::ColorSpinorField
void createGhostZone (int nFace, bool spin_project=true) const
 
void reset (const ColorSpinorParam &)
 
void fill (ColorSpinorParam &) const
 
void setTuningString ()
 Set the vol_string and aux_string for use in tuning. More...
 
- Protected Member Functions inherited from quda::LatticeField
void precisionCheck ()
 
- Static Protected Member Functions inherited from quda::ColorSpinorField
static void checkField (const ColorSpinorField &, const ColorSpinorField &)
 
- Protected Attributes inherited from quda::ColorSpinorField
bool init
 
QudaPrecision ghost_precision_allocated
 
int nColor
 
int nSpin
 
int nVec
 
int nDim
 
int x [QUDA_MAX_DIM]
 
size_t volume
 
size_t volumeCB
 
size_t pad
 
size_t stride
 
QudaTwistFlavorType twistFlavor
 
QudaPCType pc_type
 
QudaParity suggested_parity
 
size_t real_length
 
size_t length
 
void * v
 
void * norm
 
void * v_h
 
void * norm_h
 
void * ghost [2][QUDA_MAX_DIM]
 
void * ghostNorm [2][QUDA_MAX_DIM]
 
int ghostFace [QUDA_MAX_DIM]
 
int ghostFaceCB [QUDA_MAX_DIM]
 
void * ghost_buf [2 *QUDA_MAX_DIM]
 
DslashConstant dslash_constant
 
size_t bytes
 
size_t norm_bytes
 
QudaSiteSubset siteSubset
 
QudaSiteOrder siteOrder
 
QudaFieldOrder fieldOrder
 
QudaGammaBasis gammaBasis
 
ColorSpinorFieldeven
 
ColorSpinorFieldodd
 
CompositeColorSpinorFieldDescriptor composite_descr
 used for deflation eigenvector sets etc.: More...
 
CompositeColorSpinorField components
 
- 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 682 of file color_spinor_field.h.

Constructor & Destructor Documentation

◆ cudaColorSpinorField() [1/4]

quda::cudaColorSpinorField::cudaColorSpinorField ( const cudaColorSpinorField src)

Definition at line 38 of file cuda_color_spinor_field.cpp.

◆ cudaColorSpinorField() [2/4]

quda::cudaColorSpinorField::cudaColorSpinorField ( const ColorSpinorField src,
const ColorSpinorParam param 
)

Definition at line 48 of file cuda_color_spinor_field.cpp.

◆ cudaColorSpinorField() [3/4]

quda::cudaColorSpinorField::cudaColorSpinorField ( const ColorSpinorField src)

Definition at line 97 of file cuda_color_spinor_field.cpp.

◆ cudaColorSpinorField() [4/4]

quda::cudaColorSpinorField::cudaColorSpinorField ( const ColorSpinorParam param)

Definition at line 16 of file cuda_color_spinor_field.cpp.

◆ ~cudaColorSpinorField()

quda::cudaColorSpinorField::~cudaColorSpinorField ( )
virtual

Definition at line 142 of file cuda_color_spinor_field.cpp.

Member Function Documentation

◆ allocateGhostBuffer()

void quda::cudaColorSpinorField::allocateGhostBuffer ( int  nFace,
bool  spin_project = true 
) const

Allocate the ghost buffers.

Parameters
[in]nFaceDepth of each halo
[in]spin_projectWhether the halos are spin projected (Wilson-type fermions only)

Definition at line 498 of file cuda_color_spinor_field.cpp.

◆ backup()

void quda::cudaColorSpinorField::backup ( ) const
virtual

Backs up the cudaColorSpinorField.

Reimplemented from quda::LatticeField.

Definition at line 297 of file cuda_color_spinor_field.cpp.

◆ commsQuery()

int quda::cudaColorSpinorField::commsQuery ( int  nFace,
int  d,
int  dagger = 0,
qudaStream_t stream_p = nullptr,
bool  gdr_send = false,
bool  gdr_recv = false 
)
virtual

Non-blocking query if the halo communication has completed.

Parameters
[in]Depthof face exchange
[in]dd=[2*dim+dir], where dim is dimension and dir is the scatter-centric direction (0=backwards,1=forwards)
[in]daggerWhether this exchange is for the conjugate operator
[in]streamCUDA stream to be used (unused)
[in]gdr_sendWhether we are using GDR on the send side
[in]gdr_recvWhether we are using GDR on the receive side

Reimplemented from quda::LatticeField.

Definition at line 872 of file cuda_color_spinor_field.cpp.

◆ commsStart()

void quda::cudaColorSpinorField::commsStart ( int  nFace,
int  d,
int  dagger = 0,
qudaStream_t stream_p = nullptr,
bool  gdr_send = false,
bool  gdr_recv = false 
)
virtual

Initiate halo communication.

Parameters
[in]Depthof face exchange
[in]dd=[2*dim+dir], where dim is dimension and dir is the scatter-centric direction (0=backwards,1=forwards)
[in]daggerWhether this exchange is for the conjugate operator
[in]streamCUDA stream to be used (unused)
[in]gdr_sendWhether we are using GDR on the send side
[in]gdr_recvWhether we are using GDR on the receive side

Reimplemented from quda::LatticeField.

Definition at line 860 of file cuda_color_spinor_field.cpp.

◆ commsWait()

void quda::cudaColorSpinorField::commsWait ( int  nFace,
int  d,
int  dagger = 0,
qudaStream_t stream_p = nullptr,
bool  gdr_send = false,
bool  gdr_recv = false 
)
virtual

Wait on halo communication to complete.

Parameters
[in]Depthof face exchange
[in]dd=[2*dim+dir], where dim is dimension and dir is the scatter-centric direction (0=backwards,1=forwards)
[in]daggerWhether this exchange is for the conjugate operator
[in]streamCUDA stream to be used (unused)
[in]gdr_sendWhether we are using GDR on the send side
[in]gdr_recvWhether we are using GDR on the receive side

Reimplemented from quda::LatticeField.

Definition at line 941 of file cuda_color_spinor_field.cpp.

◆ Component()

cudaColorSpinorField & quda::cudaColorSpinorField::Component ( const int  idx) const

for composite fields:

Definition at line 1209 of file cuda_color_spinor_field.cpp.

◆ Components()

CompositeColorSpinorField& quda::cudaColorSpinorField::Components ( ) const

◆ copy()

void quda::cudaColorSpinorField::copy ( const cudaColorSpinorField src)

Definition at line 385 of file cuda_color_spinor_field.cpp.

◆ copy_from_buffer()

void quda::cudaColorSpinorField::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 1309 of file cuda_color_spinor_field.cpp.

◆ copy_to_buffer()

void quda::cudaColorSpinorField::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 1301 of file cuda_color_spinor_field.cpp.

◆ CopySubset()

void quda::cudaColorSpinorField::CopySubset ( cudaColorSpinorField dst,
const int  range,
const int  first_element = 0 
) const

Definition at line 1224 of file cuda_color_spinor_field.cpp.

◆ createComms()

void quda::cudaColorSpinorField::createComms ( int  nFace,
bool  spin_project = true 
)

Create the communication handlers and buffers.

Parameters
[in]nFaceDepth of each halo
[in]spin_projectWhether the halos are spin projected (Wilson-type fermions only)

Definition at line 646 of file cuda_color_spinor_field.cpp.

◆ exchangeGhost()

void quda::cudaColorSpinorField::exchangeGhost ( QudaParity  parity,
int  nFace,
int  dagger,
const MemoryLocation pack_destination = nullptr,
const MemoryLocation halo_location = nullptr,
bool  gdr_send = false,
bool  gdr_recv = false,
QudaPrecision  ghost_precision = QUDA_INVALID_PRECISION 
) const
virtual

This is a unified ghost exchange function for doing a complete halo exchange regardless of the type of field. All dimensions are exchanged and no spin projection is done in the case of Wilson fermions.

Parameters
[in]parityField parity
[in]nFaceDepth of halo exchange
[in]daggerIs this for a dagger operator (only relevant for spin projected Wilson)
[in]pack_destinationDestination of the packing buffer
[in]halo_locationDestination of the halo reading buffer
[in]gdr_sendAre we using GDR for sending
[in]gdr_recvAre we using GDR for receiving
[in]ghost_precisionThe precision used for the ghost exchange

Implements quda::ColorSpinorField.

Definition at line 1037 of file cuda_color_spinor_field.cpp.

◆ gather()

void quda::cudaColorSpinorField::gather ( int  nFace,
int  dagger,
int  dir,
qudaStream_t stream_p = NULL 
)
virtual

Reimplemented from quda::LatticeField.

Definition at line 705 of file cuda_color_spinor_field.cpp.

◆ Ghost2()

const void* quda::cudaColorSpinorField::Ghost2 ( ) const
inlinevirtual

Reimplemented from quda::ColorSpinorField.

Definition at line 918 of file color_spinor_field.h.

◆ operator=() [1/3]

ColorSpinorField & quda::cudaColorSpinorField::operator= ( const ColorSpinorField src)
virtual

Reimplemented from quda::ColorSpinorField.

Definition at line 106 of file cuda_color_spinor_field.cpp.

◆ operator=() [2/3]

cudaColorSpinorField & quda::cudaColorSpinorField::operator= ( const cpuColorSpinorField src)

Definition at line 131 of file cuda_color_spinor_field.cpp.

◆ operator=() [3/3]

cudaColorSpinorField & quda::cudaColorSpinorField::operator= ( const cudaColorSpinorField src)

Definition at line 117 of file cuda_color_spinor_field.cpp.

◆ pack()

void quda::cudaColorSpinorField::pack ( int  nFace,
int  parity,
int  dagger,
int  stream_idx,
MemoryLocation  location[],
MemoryLocation  location_label,
bool  spin_project = true,
double  a = 0,
double  b = 0,
double  c = 0,
int  shmem = 0 
)

Pack the field halos in preparation for halo exchange, e.g., for Dslash

Parameters
[in]nFaceDepth of faces
[in]parityField parity
[in]daggerWhether this exchange is for the conjugate operator
[in]streamCUDA stream index to be used for packing kernel
[in]locationArray of field locations where each halo will be sent (Host, Device or Remote)
[in]location_labelConsistent label used for labeling the packing tunekey since location can be difference for each process
[in]spin_projectWhether we are spin projecting when face packing
[in]aUsed for twisted mass (scale factor)
[in]bUsed for twisted mass (chiral twist factor)
[in]cUsed for twisted mass (flavor twist factor)

Definition at line 683 of file cuda_color_spinor_field.cpp.

◆ packExtended()

void quda::cudaColorSpinorField::packExtended ( const int  nFace,
const int  R[],
const int  parity,
const int  dagger,
const int  dim,
qudaStream_t stream_p,
const bool  zeroCopyPack = false 
)

Definition at line 695 of file cuda_color_spinor_field.cpp.

◆ packGhost()

void quda::cudaColorSpinorField::packGhost ( const int  nFace,
const QudaParity  parity,
const int  dim,
const QudaDirection  dir,
const int  dagger,
qudaStream_t stream,
MemoryLocation  location[2 *QUDA_MAX_DIM],
MemoryLocation  location_label,
bool  spin_project,
double  a = 0,
double  b = 0,
double  c = 0,
int  shmem = 0 
)

Packs the cudaColorSpinorField's ghost zone.

Parameters
[in]nFaceHow many faces to pack (depth)
[in]parityParity of the field
[in]dimLabels space-time dimensions
[in]dirPack data to send in forward of backward directions, or both
[in]daggerWhether the operator is the Hermitian conjugate or not
[in]streamWhich stream to use for the kernel
[out]bufferOptional parameter where the ghost should be stored (default is to use cudaColorSpinorField::ghostFaceBuffer)
[in]locationAre we packing directly into local device memory, zero-copy memory or remote memory
[in]location_labelConsistent label used for labeling the packing tunekey since location can be difference for each process
[in]spin_projectWhether we are spin projecting when face packing
[in]aTwisted mass parameter (scale factor, default=0)
[in]bTwisted mass parameter (flavor twist factor, default=0)
[in]cTwisted mass parameter (chiral twist factor, default=0)

Definition at line 505 of file cuda_color_spinor_field.cpp.

◆ packGhostExtended()

void quda::cudaColorSpinorField::packGhostExtended ( const int  nFace,
const int  R[],
const QudaParity  parity,
const int  dim,
const QudaDirection  dir,
const int  dagger,
qudaStream_t stream,
bool  zero_copy = false 
)

Definition at line 629 of file cuda_color_spinor_field.cpp.

◆ prefetch()

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

If managed memory and prefetch is enabled, prefetch the spinor, the norm field (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 320 of file cuda_color_spinor_field.cpp.

◆ PrintVector()

void quda::cudaColorSpinorField::PrintVector ( unsigned int  x) const
virtual

Implements quda::ColorSpinorField.

Definition at line 1299 of file cuda_color_spinor_field.cpp.

◆ recvStart()

void quda::cudaColorSpinorField::recvStart ( int  nFace,
int  dir,
int  dagger = 0,
qudaStream_t stream_p = nullptr,
bool  gdr = false 
)

Initiate halo communication receive.

Parameters
[in]Depthof face exchange
[in]dd=[2*dim+dir], where dim is dimension and dir is the scatter-centric direction (0=backwards,1=forwards)
[in]daggerWhether this exchange is for the conjugate operator
[in]streamCUDA stream to be used (unused)
[in]gdrWhether we are using GDR on the receive side

Definition at line 725 of file cuda_color_spinor_field.cpp.

◆ restore()

void quda::cudaColorSpinorField::restore ( ) const
virtual

Restores the cudaColorSpinorField.

Reimplemented from quda::LatticeField.

Definition at line 308 of file cuda_color_spinor_field.cpp.

◆ scatter() [1/2]

void quda::cudaColorSpinorField::scatter ( int  nFace,
int  dagger,
int  dir 
)
virtual

Reimplemented from quda::LatticeField.

Definition at line 1015 of file cuda_color_spinor_field.cpp.

◆ scatter() [2/2]

void quda::cudaColorSpinorField::scatter ( int  nFace,
int  dagger,
int  dir,
qudaStream_t stream_p 
)

Definition at line 1002 of file cuda_color_spinor_field.cpp.

◆ scatterExtended()

void quda::cudaColorSpinorField::scatterExtended ( int  nFace,
int  parity,
int  dagger,
int  dir 
)

Definition at line 1028 of file cuda_color_spinor_field.cpp.

◆ sendGhost()

void quda::cudaColorSpinorField::sendGhost ( void *  ghost_spinor,
const int  nFace,
const int  dim,
const QudaDirection  dir,
const int  dagger,
qudaStream_t stream 
)

Initiate the gpu to cpu send of the ghost zone (halo)

Parameters
ghost_spinorWhere to send the ghost zone
nFaceNumber of face to send
dimThe lattice dimension we are sending
dirThe direction (QUDA_BACKWARDS or QUDA_FORWARDS)
daggerWhether the operator is daggerer or not
streamThe array of streams to use

Definition at line 550 of file cuda_color_spinor_field.cpp.

◆ sendStart()

void quda::cudaColorSpinorField::sendStart ( int  nFace,
int  d,
int  dagger = 0,
qudaStream_t stream_p = nullptr,
bool  gdr = false,
bool  remote_write = false 
)

Initiate halo communication sending.

Parameters
[in]nFaceDepth of face exchange
[in]dd=[2*dim+dir], where dim is dimension and dir is the scatter-centric direction (0=backwards,1=forwards)
[in]daggerWhether this exchange is for the conjugate operator
[in]streamCUDA stream that we will post the p2p event synchronization to (if nullptr then stream+d will be used
[in]gdrWhether we are using GDR on the send side
[in]remote_writeWhether we are writing direct to remote memory (or using copy engines)

Definition at line 757 of file cuda_color_spinor_field.cpp.

◆ Source()

void quda::cudaColorSpinorField::Source ( const QudaSourceType  sourceType,
const int  st = 0,
const int  s = 0,
const int  c = 0 
)
virtual

Implements quda::ColorSpinorField.

Definition at line 1282 of file cuda_color_spinor_field.cpp.

◆ streamInit()

void quda::cudaColorSpinorField::streamInit ( qudaStream_t stream_p)

Definition at line 681 of file cuda_color_spinor_field.cpp.

◆ switchBufferPinned()

void quda::cudaColorSpinorField::switchBufferPinned ( )

◆ unpackGhost()

void quda::cudaColorSpinorField::unpackGhost ( const void *  ghost_spinor,
const int  nFace,
const int  dim,
const QudaDirection  dir,
const int  dagger,
qudaStream_t stream 
)

Initiate the cpu to gpu send of the ghost zone (halo)

Parameters
ghost_spinorSource of the ghost zone
nFaceNumber of face to send
dimThe lattice dimension we are sending
dirThe direction (QUDA_BACKWARDS or QUDA_FORWARDS)
daggerWhether the operator is daggerer or not
streamThe array of streams to use

Definition at line 618 of file cuda_color_spinor_field.cpp.

◆ unpackGhostExtended()

void quda::cudaColorSpinorField::unpackGhostExtended ( const void *  ghost_spinor,
const int  nFace,
const QudaParity  parity,
const int  dim,
const QudaDirection  dir,
const int  dagger,
qudaStream_t stream,
bool  zero_copy 
)

Initiate the cpu to gpu copy of the extended border region

Parameters
ghost_spinorSource of the ghost zone
parityParity of the field
nFaceNumber of face to send
dimThe lattice dimension we are sending
dirThe direction (QUDA_BACKWARDS or QUDA_FORWARDS)
daggerWhether the operator is daggered or not
streamThe array of streams to use
zero_copyWhether we are unpacking from zero_copy memory

Definition at line 637 of file cuda_color_spinor_field.cpp.

◆ zero()

void quda::cudaColorSpinorField::zero ( )

Definition at line 332 of file cuda_color_spinor_field.cpp.

Friends And Related Function Documentation

◆ cpuColorSpinorField

friend class cpuColorSpinorField
friend

Definition at line 684 of file color_spinor_field.h.

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const cudaColorSpinorField a 
)
friend

Definition at line 1199 of file cuda_color_spinor_field.cpp.


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