QUDA
1.0.0
|
#include <color_spinor_field.h>
Public Member Functions | |
cpuColorSpinorField (const cpuColorSpinorField &) | |
cpuColorSpinorField (const ColorSpinorField &) | |
cpuColorSpinorField (const ColorSpinorField &, const ColorSpinorParam &) | |
cpuColorSpinorField (const ColorSpinorParam &) | |
virtual | ~cpuColorSpinorField () |
ColorSpinorField & | operator= (const ColorSpinorField &) |
cpuColorSpinorField & | operator= (const cpuColorSpinorField &) |
cpuColorSpinorField & | operator= (const cudaColorSpinorField &) |
void | Source (const QudaSourceType sourceType, const int st=0, const int s=0, const int c=0) |
void | PrintVector (unsigned int x) const |
void | allocateGhostBuffer (int nFace) const |
Allocate the ghost buffers. More... | |
void | packGhost (void **ghost, const QudaParity parity, const int nFace, const int dagger) const |
void | unpackGhost (void *ghost_spinor, const int dim, const QudaDirection dir, const int dagger) |
void | copy (const cpuColorSpinorField &) |
void | zero () |
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... | |
void | backup () const |
Backs up the cpuColorSpinorField. More... | |
void | restore () const |
Restores the cpuColorSpinorField. More... | |
![]() | |
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 |
int | Stride () const |
int | Volume () const |
int | VolumeCB () const |
int | Pad () const |
size_t | Bytes () const |
size_t | NormBytes () const |
size_t | GhostBytes () const |
size_t | GhostNormBytes () const |
void | PrintDims () const |
void * | V () |
const void * | V () const |
void * | Norm () |
const void * | Norm () const |
virtual const void * | Ghost2 () 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 |
QudaSiteSubset | SiteSubset () const |
QudaSiteOrder | SiteOrder () const |
QudaFieldOrder | FieldOrder () const |
QudaGammaBasis | GammaBasis () const |
const int * | GhostFace () const |
const int * | GhostFaceCB () const |
int | GhostOffset (const int i) const |
int | GhostOffset (const int i, const int j) const |
int | GhostNormOffset (const int i) const |
int | GhostNormOffset (const int i, const int j) 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 DslashConstant & | getDslashConstant () const |
Get the dslash_constant structure from this field. More... | |
const ColorSpinorField & | Even () const |
const ColorSpinorField & | Odd () const |
ColorSpinorField & | Even () |
ColorSpinorField & | Odd () |
ColorSpinorField & | Component (const int idx) const |
ColorSpinorField & | Component (const int idx) |
CompositeColorSpinorField & | Components () |
void | LatticeIndex (int *y, int i) const |
void | OffsetIndex (int &i, int *y) const |
ColorSpinorField * | CreateCoarse (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... | |
ColorSpinorField * | CreateFine (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... | |
![]() | |
LatticeField (const LatticeFieldParam ¶m) | |
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 |
int | Volume () const |
int | VolumeCB () const |
const int * | SurfaceCB () const |
int | SurfaceCB (const int i) const |
int | 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) |
virtual void | gather (int nFace, int dagger, int dir, cudaStream_t *stream_p=NULL) |
virtual void | commsStart (int nFace, int dir, int dagger=0, cudaStream_t *stream_p=NULL, bool gdr_send=false, bool gdr_recv=true) |
virtual int | commsQuery (int nFace, int dir, int dagger=0, cudaStream_t *stream_p=NULL, bool gdr_send=false, bool gdr_recv=true) |
virtual void | commsWait (int nFace, int dir, int dagger=0, cudaStream_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 |
![]() | |
Object () | |
virtual | ~Object () |
Static Public Member Functions | |
static int | Compare (const cpuColorSpinorField &a, const cpuColorSpinorField &b, const int resolution=1) |
Perform a component by component comparison of two color-spinor fields. In doing we normalize with respect to the first colorspinor field, e.g., we compare || a_i - b_i || / || a ||. More... | |
static void | freeGhostBuffer (void) |
![]() | |
static ColorSpinorField * | Create (const ColorSpinorParam ¶m) |
static ColorSpinorField * | Create (const ColorSpinorField &src, const ColorSpinorParam ¶m) |
![]() | |
static void | freeGhostBuffer (void) |
Free statically allocated ghost buffers. More... | |
static void | destroyIPCComms () |
![]() | |
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 | |
static void * | fwdGhostFaceBuffer [QUDA_MAX_DIM] |
static void * | backGhostFaceBuffer [QUDA_MAX_DIM] |
static void * | fwdGhostFaceSendBuffer [QUDA_MAX_DIM] |
static void * | backGhostFaceSendBuffer [QUDA_MAX_DIM] |
static int | initGhostFaceBuffer =0 |
static size_t | ghostFaceBytes [QUDA_MAX_DIM] = { } |
![]() | |
static int | bufferIndex = 0 |
static bool | ghost_field_reset = false |
Private Member Functions | |
void | create (const QudaFieldCreate) |
void | destroy () |
Private Attributes | |
bool | init |
bool | reference |
Friends | |
class | cudaColorSpinorField |
Definition at line 865 of file color_spinor_field.h.
quda::cpuColorSpinorField::cpuColorSpinorField | ( | const cpuColorSpinorField & | src | ) |
Definition at line 39 of file cpu_color_spinor_field.cpp.
References quda::ColorSpinorField::bytes, create(), QUDA_COPY_FIELD_CREATE, and quda::ColorSpinorField::v.
Referenced by create(), and operator=().
quda::cpuColorSpinorField::cpuColorSpinorField | ( | const ColorSpinorField & | src | ) |
Definition at line 45 of file cpu_color_spinor_field.cpp.
References quda::ColorSpinorField::bytes, create(), errorQuda, QUDA_COPY_FIELD_CREATE, and quda::ColorSpinorField::v.
quda::cpuColorSpinorField::cpuColorSpinorField | ( | const ColorSpinorField & | src, |
const ColorSpinorParam & | param | ||
) |
Definition at line 60 of file cpu_color_spinor_field.cpp.
References quda::ColorSpinorParam::create, create(), errorQuda, quda::ColorSpinorField::norm, quda::ColorSpinorField::Norm(), QUDA_FULL_SITE_SUBSET, QUDA_PARITY_SITE_SUBSET, QUDA_REFERENCE_FIELD_CREATE, quda::ColorSpinorField::reset(), quda::LatticeFieldParam::siteSubset, quda::ColorSpinorField::SiteSubset(), quda::ColorSpinorField::v, and quda::ColorSpinorField::V().
quda::cpuColorSpinorField::cpuColorSpinorField | ( | const ColorSpinorParam & | param | ) |
Definition at line 19 of file cpu_color_spinor_field.cpp.
References quda::ColorSpinorParam::create, create(), errorQuda, QUDA_NULL_FIELD_CREATE, QUDA_REFERENCE_FIELD_CREATE, QUDA_ZERO_FIELD_CREATE, reference, quda::ColorSpinorParam::v, quda::ColorSpinorField::v, and zero().
|
virtual |
Definition at line 82 of file cpu_color_spinor_field.cpp.
References destroy().
void quda::cpuColorSpinorField::allocateGhostBuffer | ( | int | nFace | ) | const |
Allocate the ghost buffers.
[in] | nFace | Depth of each halo |
Definition at line 260 of file cpu_color_spinor_field.cpp.
References backGhostFaceBuffer, backGhostFaceSendBuffer, freeGhostBuffer(), fwdGhostFaceBuffer, fwdGhostFaceSendBuffer, ghostFaceBytes, initGhostFaceBuffer, quda::ColorSpinorField::nColor, quda::LatticeField::nDimComms, quda::ColorSpinorField::nSpin, quda::LatticeField::precision, safe_malloc, quda::ColorSpinorField::siteSubset, and quda::LatticeField::surfaceCB.
Referenced by exchangeGhost().
|
virtual |
Backs up the cpuColorSpinorField.
Reimplemented from quda::LatticeField.
Definition at line 214 of file cpu_color_spinor_field.cpp.
References quda::LatticeField::backed_up, quda::LatticeField::backup_h, quda::LatticeField::backup_norm_h, quda::ColorSpinorField::bytes, errorQuda, quda::ColorSpinorField::norm, quda::ColorSpinorField::norm_bytes, and quda::ColorSpinorField::v.
|
static |
Perform a component by component comparison of two color-spinor fields. In doing we normalize with respect to the first colorspinor field, e.g., we compare || a_i - b_i || / || a ||.
[in] | a | Ground truth color spinor field |
[in] | b | Field we are checking |
[in] | resolution | How many bins per order of magnitude to use. The default resolution=1 means that we have 16 bins covering the range [1e-15,1.0]. |
Definition at line 251 of file cpu_color_spinor_field.cpp.
References quda::ColorSpinorField::checkField(), and quda::genericCompare().
Referenced by packTest(), TEST(), and TEST_P().
void quda::cpuColorSpinorField::copy | ( | const cpuColorSpinorField & | src | ) |
Definition at line 202 of file cpu_color_spinor_field.cpp.
References quda::ColorSpinorField::bytes, quda::ColorSpinorField::Bytes(), quda::ColorSpinorField::checkField(), quda::copyGenericColorSpinor(), quda::ColorSpinorField::fieldOrder, quda::ColorSpinorField::nDim, QUDA_CPU_FIELD_LOCATION, QUDA_QOP_DOMAIN_WALL_FIELD_ORDER, quda::ColorSpinorField::v, and quda::ColorSpinorField::x.
Referenced by operator=().
|
private |
Definition at line 121 of file cpu_color_spinor_field.cpp.
References ALIGNMENT_ADJUST, quda::ColorSpinorField::bytes, quda::ColorSpinorField::Bytes(), quda::ColorSpinorParam::component_id, quda::ColorSpinorField::composite_descr, quda::ColorSpinorParam::composite_dim, cpuColorSpinorField(), quda::ColorSpinorParam::create, errorQuda, quda::ColorSpinorField::even, quda::ColorSpinorField::fieldOrder, quda::CompositeColorSpinorFieldDescriptor::id, init, quda::CompositeColorSpinorFieldDescriptor::is_component, quda::ColorSpinorParam::is_component, quda::ColorSpinorParam::is_composite, quda::ColorSpinorField::isNative(), quda::ColorSpinorField::length, Ls, quda::LatticeFieldParam::nDim, quda::ColorSpinorField::nDim, quda::ColorSpinorParam::norm, quda::ColorSpinorField::norm, quda::ColorSpinorField::norm_bytes, quda::ColorSpinorField::odd, quda::ColorSpinorField::pad, param, quda::LatticeField::precision, QUDA_FULL_SITE_SUBSET, QUDA_HALF_PRECISION, QUDA_PADDED_SPACE_SPIN_COLOR_FIELD_ORDER, QUDA_PARITY_SITE_SUBSET, QUDA_QDPJIT_FIELD_ORDER, QUDA_QOP_DOMAIN_WALL_FIELD_ORDER, QUDA_QUARTER_PRECISION, QUDA_REFERENCE_FIELD_CREATE, QUDA_SPACE_COLOR_SPIN_FIELD_ORDER, QUDA_SPACE_SPIN_COLOR_FIELD_ORDER, safe_malloc, quda::LatticeFieldParam::siteSubset, quda::ColorSpinorField::siteSubset, quda::ColorSpinorParam::v, quda::ColorSpinorField::v, quda::LatticeFieldParam::x, and quda::ColorSpinorField::x.
Referenced by cpuColorSpinorField(), and operator=().
|
private |
Definition at line 186 of file cpu_color_spinor_field.cpp.
References quda::ColorSpinorField::even, quda::ColorSpinorField::fieldOrder, host_free, init, quda::ColorSpinorField::nDim, quda::ColorSpinorField::odd, QUDA_FULL_SITE_SUBSET, QUDA_QOP_DOMAIN_WALL_FIELD_ORDER, quda::ColorSpinorField::siteSubset, quda::ColorSpinorField::v, and quda::ColorSpinorField::x.
Referenced by operator=(), and ~cpuColorSpinorField().
|
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.
[in] | parity | Field parity |
[in] | nFace | Depth of halo exchange |
[in] | dagger | Is this for a dagger operator (only relevant for spin projected Wilson) |
[in] | pack_destination | Destination of the packing buffer |
[in] | halo_location | Destination of the halo reading buffer |
[in] | gdr_send | Dummy for CPU |
[in] | gdr_recv | Dummy for GPU |
[in] | ghost_precision | The precision used for the ghost exchange |
Implements quda::ColorSpinorField.
Definition at line 313 of file cpu_color_spinor_field.cpp.
References allocateGhostBuffer(), backGhostFaceBuffer, backGhostFaceSendBuffer, quda::ColorSpinorField::exchange(), fwdGhostFaceBuffer, fwdGhostFaceSendBuffer, quda::ColorSpinorField::ghost_buf, host_free, quda::LatticeField::nDimComms, packGhost(), and safe_malloc.
Referenced by dslash_4_4d(), dw_dslash(), matdagmat(), staggered_dslash(), and wil_dslash().
|
static |
Definition at line 285 of file cpu_color_spinor_field.cpp.
References backGhostFaceBuffer, backGhostFaceSendBuffer, fwdGhostFaceBuffer, fwdGhostFaceSendBuffer, host_free, and initGhostFaceBuffer.
Referenced by allocateGhostBuffer(), and endQuda().
|
virtual |
Reimplemented from quda::ColorSpinorField.
Definition at line 86 of file cpu_color_spinor_field.cpp.
References cpuColorSpinorField(), and errorQuda.
cpuColorSpinorField & quda::cpuColorSpinorField::operator= | ( | const cpuColorSpinorField & | src | ) |
Definition at line 97 of file cpu_color_spinor_field.cpp.
References copy(), create(), destroy(), quda::ColorSpinorField::init, quda::ColorSpinorField::operator=(), QUDA_COPY_FIELD_CREATE, and reference.
cpuColorSpinorField & quda::cpuColorSpinorField::operator= | ( | const cudaColorSpinorField & | src | ) |
Definition at line 110 of file cpu_color_spinor_field.cpp.
References create(), destroy(), quda::ColorSpinorField::init, quda::ColorSpinorField::operator=(), QUDA_COPY_FIELD_CREATE, reference, and quda::cudaColorSpinorField::saveSpinorField().
void quda::cpuColorSpinorField::packGhost | ( | void ** | ghost, |
const QudaParity | parity, | ||
const int | nFace, | ||
const int | dagger | ||
) | const |
Definition at line 299 of file cpu_color_spinor_field.cpp.
References quda::genericPackGhost().
Referenced by exchangeGhost().
|
virtual |
Implements quda::ColorSpinorField.
Definition at line 258 of file cpu_color_spinor_field.cpp.
References quda::genericPrintVector().
|
virtual |
Restores the cpuColorSpinorField.
Reimplemented from quda::LatticeField.
Definition at line 228 of file cpu_color_spinor_field.cpp.
References quda::LatticeField::backed_up, quda::LatticeField::backup_h, quda::LatticeField::backup_norm_h, quda::ColorSpinorField::bytes, errorQuda, quda::ColorSpinorField::norm, quda::ColorSpinorField::norm_bytes, and quda::ColorSpinorField::v.
|
virtual |
Implements quda::ColorSpinorField.
Definition at line 247 of file cpu_color_spinor_field.cpp.
References quda::genericSource().
Referenced by init(), and quda::cudaColorSpinorField::Source().
void quda::cpuColorSpinorField::unpackGhost | ( | void * | ghost_spinor, |
const int | dim, | ||
const QudaDirection | dir, | ||
const int | dagger | ||
) |
Definition at line 305 of file cpu_color_spinor_field.cpp.
References errorQuda, QUDA_FULL_SITE_SUBSET, and quda::ColorSpinorField::siteSubset.
void quda::cpuColorSpinorField::zero | ( | ) |
Definition at line 242 of file cpu_color_spinor_field.cpp.
References quda::ColorSpinorField::bytes, quda::ColorSpinorField::fieldOrder, memset(), quda::ColorSpinorField::nDim, QUDA_QOP_DOMAIN_WALL_FIELD_ORDER, quda::ColorSpinorField::v, and quda::ColorSpinorField::x.
Referenced by cpuColorSpinorField().
|
friend |
Definition at line 867 of file color_spinor_field.h.
|
static |
Definition at line 871 of file color_spinor_field.h.
Referenced by allocateGhostBuffer(), dslash_4_4d(), dw_dslash(), exchangeGhost(), freeGhostBuffer(), matdagmat(), staggered_dslash(), and wil_dslash().
|
static |
Definition at line 873 of file color_spinor_field.h.
Referenced by allocateGhostBuffer(), exchangeGhost(), and freeGhostBuffer().
|
static |
Definition at line 870 of file color_spinor_field.h.
Referenced by allocateGhostBuffer(), dslash_4_4d(), dw_dslash(), exchangeGhost(), freeGhostBuffer(), matdagmat(), staggered_dslash(), and wil_dslash().
|
static |
Definition at line 872 of file color_spinor_field.h.
Referenced by allocateGhostBuffer(), exchangeGhost(), and freeGhostBuffer().
|
static |
Definition at line 875 of file color_spinor_field.h.
Referenced by allocateGhostBuffer().
|
private |
Definition at line 880 of file color_spinor_field.h.
|
static |
Definition at line 874 of file color_spinor_field.h.
Referenced by allocateGhostBuffer(), and freeGhostBuffer().
|
private |
Definition at line 881 of file color_spinor_field.h.
Referenced by cpuColorSpinorField(), and operator=().