26 class ColorSpinorField;
27 class cudaColorSpinorField;
28 class cpuColorSpinorField;
31 class cudaEigValueSet;
43 class cudaCloverField;
93 for (
int i=0; i<
nDim; i++) {
114 for (
int i=0; i<
nDim; i++) {
131 for (
int i=0; i<
nDim; i++) {
143 std::ostream&
operator<<(std::ostream& output,
const LatticeFieldParam&
param);
450 void createComms(
bool no_comms_fill=
false,
bool bidir=
true);
505 const int*
X()
const {
return x; }
557 const int*
R()
const {
return r; }
621 virtual void read(
char *filename);
627 virtual void write(
char *filename);
678 bool gdr_recv =
true)
682 bool gdr_recv =
true)
683 {
errorQuda(
"Not implemented");
return 0; }
686 bool gdr_recv =
true)
742 else errorQuda(
"Locations %d %d do not match (%s:%d in %s())\n",
754 template <
typename... Args>
760 #define checkLocation(...) Location_(__func__, __FILE__, __LINE__, __VA_ARGS__)
772 else errorQuda(
"Precisions %d %d do not match (%s:%d in %s())\n",
784 template <
typename... Args>
787 const Args &... args) {
791 #define checkPrecision(...) Precision_(__func__, __FILE__, __LINE__, __VA_ARGS__)
800 if (!a.
isNative())
errorQuda(
"Non-native field detected (%s:%d in %s())\n", file, line, func);
810 template <
typename... Args>
811 inline bool Native_(
const char *func,
const char *file,
int line,
const LatticeField &a,
const Args &... args)
813 return (
Native_(func, file, line, a) &
Native_(func, file, line, args...));
816 #define checkNative(...) Native_(__func__, __FILE__, __LINE__, __VA_ARGS__)
QudaGhostExchange ghostExchange
void * remoteFace_r() const
Return base pointer to the ghost recv buffer. Since this is a base pointer, one still needs to take c...
virtual void scatter(int nFace, int dagger, int dir)
int SurfaceCB(const int i) const
static bool initGhostFaceBuffer
MsgHandle * mh_send_fwd[2][QUDA_MAX_DIM]
QudaSiteSubset siteSubset
virtual void commsStart(int nFace, int dir, int dagger=0, qudaStream_t *stream_p=NULL, bool gdr_send=false, bool gdr_recv=true)
void * myFace_h(int dir, int dim) const
Return pointer to the local pinned my_face buffer in a given direction and dimension.
static int buffer_recv_p2p_fwd[2][QUDA_MAX_DIM]
virtual void copy_from_buffer(void *buffer)=0
Copy all contents of the field from a host buffer to this field.
MsgHandle * mh_recv_rdma_back[2][QUDA_MAX_DIM]
size_t LocalVolumeCB() const
bool ghost_precision_reset
MsgHandle * mh_send_rdma_fwd[2][QUDA_MAX_DIM]
void * from_face_dim_dir_d[2][QUDA_MAX_DIM][2]
const char * AuxString() const
static MsgHandle * mh_recv_p2p_back[2][QUDA_MAX_DIM]
bool ipcCopyComplete(int dir, int dim)
virtual void backup() const
Backs up the LatticeField.
virtual QudaSiteSubset SiteSubset() const
const char * VolString() const
MsgHandle * mh_send_rdma_back[2][QUDA_MAX_DIM]
static void * ghost_pinned_send_buffer_hd[2]
void * my_face_dim_dir_h[2][QUDA_MAX_DIM][2]
void * from_face_dim_dir_h[2][QUDA_MAX_DIM][2]
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....
void * myFace_d(int dir, int dim) const
Return pointer to the device send buffer in a given direction and dimension.
static MsgHandle * mh_send_p2p_fwd[2][QUDA_MAX_DIM]
static MsgHandle * mh_recv_p2p_fwd[2][QUDA_MAX_DIM]
static void * ghost_pinned_recv_buffer_h[2]
QudaPrecision GhostPrecision() const
size_t ghost_offset[QUDA_MAX_DIM][2]
QudaPrecision ghost_precision
QudaPrecision Precision() const
size_t LocalVolume() const
QudaFieldLocation Location() const
const int * SurfaceCB() const
void * myFace_hd(int dir, int dim) const
Return pointer to the local mapped my_face buffer in a given direction and dimension.
void * my_face_dim_dir_d[2][QUDA_MAX_DIM][2]
static void destroyIPCComms()
static void * ghost_pinned_recv_buffer_hd[2]
size_t ghost_face_bytes[QUDA_MAX_DIM]
char aux_string[TuneKey::aux_n]
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 write(char *filename)
void Scale(double scale_)
Set the scale factor for a fixed-point field.
static size_t ghostFaceBytes
virtual bool isNative() const =0
char vol_string[TuneKey::volume_n]
static void * ghost_pinned_send_buffer_h[2]
static void * ghost_remote_send_buffer_d[2][QUDA_MAX_DIM][2]
void * from_face_dim_dir_hd[2][QUDA_MAX_DIM][2]
static MsgHandle * mh_send_p2p_back[2][QUDA_MAX_DIM]
virtual void restore() const
Restores the LatticeField.
static int buffer_send_p2p_fwd[2][QUDA_MAX_DIM]
virtual void setTuningString()
static bool ghost_field_reset
int surfaceCB[QUDA_MAX_DIM]
int surface[QUDA_MAX_DIM]
virtual void prefetch(QudaFieldLocation mem_space, qudaStream_t stream=0) const
If managed memory and prefetch is enabled, prefetch all relevant memory fields to the current device ...
static int buffer_recv_p2p_back[2][QUDA_MAX_DIM]
bool ipcRemoteCopyComplete(int dir, int dim)
void checkField(const LatticeField &a) const
const cudaEvent_t & getIPCCopyEvent(int dir, int dim) const
virtual void gather(int nFace, int dagger, int dir, qudaStream_t *stream_p=NULL)
virtual int full_dim(int d) const =0
MsgHandle * mh_send_back[2][QUDA_MAX_DIM]
virtual QudaMemoryType MemType() const
void * my_face_dim_dir_hd[2][QUDA_MAX_DIM][2]
QudaGhostExchange GhostExchange() const
static cudaEvent_t ipcCopyEvent[2][2][QUDA_MAX_DIM]
static cudaEvent_t ipcRemoteCopyEvent[2][2][QUDA_MAX_DIM]
const cudaEvent_t & getIPCRemoteCopyEvent(int dir, int dim) const
MsgHandle * mh_recv_fwd[2][QUDA_MAX_DIM]
static int buffer_send_p2p_back[2][QUDA_MAX_DIM]
void allocateGhostBuffer(size_t ghost_bytes) const
Allocate the static ghost buffers.
virtual void read(char *filename)
MsgHandle * mh_recv_rdma_fwd[2][QUDA_MAX_DIM]
size_t ghost_face_bytes_aligned[QUDA_MAX_DIM]
virtual int commsQuery(int nFace, int dir, int dagger=0, qudaStream_t *stream_p=NULL, bool gdr_send=false, bool gdr_recv=true)
static void * ghost_recv_buffer_d[2]
MsgHandle * mh_recv_back[2][QUDA_MAX_DIM]
void createComms(bool no_comms_fill=false, bool bidir=true)
LatticeField(const LatticeFieldParam ¶m)
static void freeGhostBuffer(void)
Free statically allocated ghost buffers.
static void * ghost_send_buffer_d[2]
virtual void copy_to_buffer(void *buffer) const =0
Copy all contents of the field to a host buffer.
enum QudaPrecision_s QudaPrecision
@ QUDA_CUDA_FIELD_LOCATION
@ QUDA_INVALID_FIELD_LOCATION
@ QUDA_INVALID_SITE_SUBSET
enum QudaSiteSubset_s QudaSiteSubset
enum QudaFieldLocation_s QudaFieldLocation
@ QUDA_GHOST_EXCHANGE_PAD
enum QudaGhostExchange_s QudaGhostExchange
enum QudaMemoryType_s QudaMemoryType
const char * compile_type_str(const LatticeField &meta, QudaFieldLocation location_=QUDA_INVALID_FIELD_LOCATION)
Helper function for setting auxilary string.
QudaFieldLocation reorder_location()
Return whether data is reordered on the CPU or GPU. This can set at QUDA initialization using the env...
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...
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.
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.
bool Native_(const char *func, const char *file, int line, const LatticeField &a)
Helper function for determining if the field is in native order.
std::ostream & operator<<(std::ostream &output, const CloverFieldParam ¶m)
Main header file for the QUDA library.
cudaStream_t qudaStream_t
#define QUDA_MAX_DIM
Maximum number of dimensions supported by QUDA. In practice, no routines make use of more than 5.
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.
LatticeFieldParam()
Default constructor for LatticeFieldParam.
QudaPrecision GhostPrecision() const
QudaGhostExchange ghostExchange
LatticeFieldParam(const QudaGaugeParam ¶m)
Constructor for creating a LatticeFieldParam from a QudaGaugeParam. Used for wrapping around a CPU re...
QudaPrecision ghost_precision
QudaSiteSubset siteSubset
QudaPrecision Precision() const
static const int volume_n