1 #ifndef _LATTICE_FIELD_H 2 #define _LATTICE_FIELD_H 24 class ColorSpinorField;
25 class cudaColorSpinorField;
26 class cpuColorSpinorField;
29 class cudaEigValueSet;
41 class cudaCloverField;
120 std::ostream&
operator<<(std::ostream& output,
const LatticeFieldParam&
param);
415 const int*
X()
const {
return x; }
452 const int*
R()
const {
return r; }
500 virtual void read(
char *filename);
506 virtual void write(
char *filename);
508 virtual void gather(
int nFace,
int dagger,
int dir, cudaStream_t *stream_p=NULL)
511 virtual void commsStart(
int nFace,
int dir,
int dagger=0, cudaStream_t *stream_p=NULL,
bool gdr_send=
false,
bool gdr_recv=
true)
514 virtual int commsQuery(
int nFace,
int dir,
int dagger=0, cudaStream_t *stream_p=NULL,
bool gdr_send=
false,
bool gdr_recv=
true)
515 {
errorQuda(
"Not implemented");
return 0; }
517 virtual void commsWait(
int nFace,
int dir,
int dagger=0, cudaStream_t *stream_p=NULL,
bool gdr_send=
false,
bool gdr_recv=
true)
542 if (
a.Location() ==
b.Location()) location =
a.Location();
543 else errorQuda(
"Locations %d %d do not match (%s:%d in %s())\n",
544 a.Location(),
b.Location(), file, line,
func);
555 template <
typename... Args>
561 #define checkLocation(...)Location_(__func__, __FILE__, __LINE__, __VA_ARGS__) 572 if (
a.Precision() ==
b.Precision()) precision =
a.Precision();
573 else errorQuda(
"Precisions %d %d do not match (%s:%d in %s())\n",
574 a.Precision(),
b.Precision(), file, line,
func);
585 template <
typename... Args>
588 const Args &...
args) {
592 #define checkPrecision(...) Precision_(__func__, __FILE__, __LINE__, __VA_ARGS__) 612 #endif // _LATTICE_FIELD_H static int buffer_recv_p2p_back[2][QUDA_MAX_DIM]
QudaPrecision Precision_(const char *func, const char *file, int line, const LatticeField &a, const LatticeField &b)
Helper function for determining if the precision of the fields is the same.
bool ipcRemoteCopyComplete(int dir, int dim)
QudaFieldLocation reorder_location()
Return whether data is reordered on the CPU or GPU. This can set at QUDA initialization using the env...
QudaGhostExchange ghostExchange
virtual void read(char *filename)
void allocateGhostBuffer(size_t ghost_bytes) const
Allocate the static ghost buffers.
int ghostNormOffset[QUDA_MAX_DIM][2]
enum QudaPrecision_s QudaPrecision
void * my_face_dim_dir_d[2][QUDA_MAX_DIM][2]
void createComms(bool no_comms_fill=false)
virtual void commsWait(int nFace, int dir, int dagger=0, cudaStream_t *stream_p=NULL, bool gdr_send=false, bool gdr_recv=true)
static void * ghost_pinned_buffer_hd[2]
QudaSiteSubset siteSubset
virtual int commsQuery(int nFace, int dir, int dagger=0, cudaStream_t *stream_p=NULL, bool gdr_send=false, bool gdr_recv=true)
static __inline__ dim3 dim3 void size_t cudaStream_t int dim
int SurfaceCB(const int i) const
const char * VolString() const
virtual void restore()
Restores the cpuGaugeField.
static MsgHandle * mh_send_p2p_back[2][QUDA_MAX_DIM]
const int * SurfaceCB() const
void * from_face_dim_dir_hd[2][QUDA_MAX_DIM][2]
LatticeFieldParam(const QudaGaugeParam ¶m)
Constructor for creating a LatticeFieldParam from a QudaGaugeParam. Used for wrapping around a CPU re...
virtual void setTuningString()
MsgHandle * mh_send_rdma_fwd[2][QUDA_MAX_DIM]
bool ipcCopyComplete(int dir, int dim)
static bool initGhostFaceBuffer
QudaSiteSubset siteSubset
std::ostream & operator<<(std::ostream &output, const CloverFieldParam ¶m)
static int buffer_recv_p2p_fwd[2][QUDA_MAX_DIM]
virtual QudaMemoryType MemType() const
void * my_face_dim_dir_hd[2][QUDA_MAX_DIM][2]
static void * ghost_pinned_buffer_h[2]
MsgHandle * mh_send_rdma_back[2][QUDA_MAX_DIM]
static MsgHandle * mh_recv_p2p_fwd[2][QUDA_MAX_DIM]
const cudaEvent_t & getIPCCopyEvent(int dir, int dim) const
static bool ghost_field_reset
void checkField(const LatticeField &a) const
MsgHandle * mh_recv_back[2][QUDA_MAX_DIM]
enum QudaGhostExchange_s QudaGhostExchange
MsgHandle * mh_recv_rdma_fwd[2][QUDA_MAX_DIM]
QudaGhostExchange ghostExchange
static void * ghost_remote_send_buffer_d[2][QUDA_MAX_DIM][2]
const cudaEvent_t & getIPCRemoteCopyEvent(int dir, int dim) const
virtual void backup() const
Backs up the LatticeField.
char vol_string[TuneKey::volume_n]
virtual void write(char *filename)
void * from_face_dim_dir_d[2][QUDA_MAX_DIM][2]
size_t ghost_face_bytes[QUDA_MAX_DIM]
static void destroyIPCComms()
MsgHandle * mh_send_fwd[2][QUDA_MAX_DIM]
static int buffer_send_p2p_fwd[2][QUDA_MAX_DIM]
enum QudaSiteSubset_s QudaSiteSubset
QudaFieldLocation Location() const
static QudaFieldLocation reorder_location_
static int buffer_send_p2p_back[2][QUDA_MAX_DIM]
static size_t ghostFaceBytes
static void * ghost_send_buffer_d[2]
int surface[QUDA_MAX_DIM]
enum QudaFieldLocation_s QudaFieldLocation
int ghostOffset[QUDA_MAX_DIM][2]
void * from_face_dim_dir_h[2][QUDA_MAX_DIM][2]
virtual void scatter(int nFace, int dagger, int dir)
Main header file for the QUDA library.
static MsgHandle * mh_send_p2p_fwd[2][QUDA_MAX_DIM]
static void * ghost_recv_buffer_d[2]
virtual QudaSiteSubset SiteSubset() const
MsgHandle * mh_recv_rdma_back[2][QUDA_MAX_DIM]
static cudaEvent_t ipcCopyEvent[2][2][QUDA_MAX_DIM]
LatticeFieldParam()
Default constructor for LatticeFieldParam.
int surfaceCB[QUDA_MAX_DIM]
static cudaEvent_t ipcRemoteCopyEvent[2][2][QUDA_MAX_DIM]
#define QUDA_MAX_DIM
Maximum number of dimensions supported by QUDA. In practice, no routines make use of more than 5...
MsgHandle * mh_recv_fwd[2][QUDA_MAX_DIM]
static MsgHandle * mh_recv_p2p_back[2][QUDA_MAX_DIM]
QudaGhostExchange GhostExchange() const
virtual void commsStart(int nFace, int dir, int dagger=0, cudaStream_t *stream_p=NULL, bool gdr_send=false, bool gdr_recv=true)
static const int volume_n
LatticeFieldParam(int nDim, const int *x, int pad, QudaPrecision precision, QudaGhostExchange ghostExchange=QUDA_GHOST_EXCHANGE_PAD)
Constructor for creating a LatticeFieldParam from a set of parameters.
QudaPrecision Precision() const
void * my_face_dim_dir_h[2][QUDA_MAX_DIM][2]
void reorder_location_set(QudaFieldLocation reorder_location_)
Set whether data is reorderd on the CPU or GPU. This can set at QUDA initialization using the environ...
static void freeGhostBuffer(void)
Free statically allocated ghost buffers.
LatticeField(const LatticeFieldParam ¶m)
QudaFieldLocation Location_(const char *func, const char *file, int line, const LatticeField &a, const LatticeField &b)
Helper function for determining if the location of the fields is the same.
virtual void gather(int nFace, int dagger, int dir, cudaStream_t *stream_p=NULL)
MsgHandle * mh_send_back[2][QUDA_MAX_DIM]
enum QudaMemoryType_s QudaMemoryType