9 location(u.Location()),
12 reconstruct(u.Reconstruct()),
14 fixed(u.GaugeFixed()),
15 link_type(u.LinkType()),
16 t_boundary(u.TBoundary()),
21 geometry(u.Geometry()),
22 compute_fat_link_max(false),
23 staggeredPhaseType(u.StaggeredPhase()),
24 staggeredPhaseApplied(u.StaggeredPhaseApplied()),
26 site_offset(u.SiteOffset()),
27 site_size(u.SiteSize())
37 geometry(
param.geometry),
38 reconstruct(
param.reconstruct),
42 link_type(
param.link_type),
43 t_boundary(
param.t_boundary),
45 tadpole(
param.tadpole),
48 staggeredPhaseType(
param.staggeredPhaseType),
49 staggeredPhaseApplied(
param.staggeredPhaseApplied),
51 site_offset(
param.site_offset),
52 site_size(
param.site_size)
62 errorQuda(
"Anisotropy only supported for Wilson links");
64 errorQuda(
"Temporal gauge fixing only supported for Wilson links");
80 errorQuda(
"Cannot request a 12/8 reconstruct type without SU(3) link type");
90 half_phase_bytes = ((half_phase_bytes + (512-1))/512)*512;
91 half_gauge_bytes = ((half_gauge_bytes + (512-1))/512)*512;
95 bytes = (half_gauge_bytes + half_phase_bytes)*2;
113 snprintf(
aux_string, aux_string_n,
"vol=%lu,stride=%lu,precision=%d,geometry=%d,Nc=%d,r=%d%d%d%d",
115 snprintf(
aux_string, aux_string_n,
"vol=%lu,stride=%lu,precision=%d,geometry=%d,Nc=%d",
117 if (check < 0 || check >= aux_string_n)
errorQuda(
"Error writing aux string");
132 for (
int i=0; i<
nDim; i++) {
196 send[i] = link_sendbuf[i];
197 receive[i] = ghost_link[i];
199 if (no_comms_fill) memcpy(ghost_link[i], link_sendbuf[i],
bytes[i]);
207 qudaMemcpy(send[i], link_sendbuf[i],
bytes[i], cudaMemcpyDeviceToHost);
209 if (no_comms_fill)
qudaMemcpy(ghost_link[i], link_sendbuf[i],
bytes[i], cudaMemcpyDeviceToDevice);
243 qudaMemcpy(ghost_link[i], receive[i],
bytes[i], cudaMemcpyHostToDevice);
269 catch(std::bad_cast &e) {
270 errorQuda(
"Failed to cast reference to GaugeField");
275 output << static_cast<const LatticeFieldParam &>(
param);
276 output <<
"nColor = " <<
param.nColor << std::endl;
277 output <<
"nFace = " <<
param.nFace << std::endl;
281 output <<
"nInternal = " << nInternal << std::endl;
282 output <<
"order = " <<
param.order << std::endl;
283 output <<
"fixed = " <<
param.fixed << std::endl;
284 output <<
"link_type = " <<
param.link_type << std::endl;
287 output <<
"tadpole = " <<
param.tadpole << std::endl;
288 output <<
"create = " <<
param.create << std::endl;
289 output <<
"geometry = " <<
param.geometry << std::endl;
290 output <<
"staggeredPhaseType = " <<
param.staggeredPhaseType << std::endl;
291 output <<
"staggeredPhaseApplied = " <<
param.staggeredPhaseApplied << std::endl;
304 errorQuda(
"Casting a GaugeField into ColorSpinorField not possible in half or quarter precision");
308 spinor_param.
nSpin = 1;
310 for (
int d=0; d<a.
Ndim(); d++) spinor_param.
x[d] = a.
X()[d];
311 spinor_param.
pad = a.
Pad();
317 spinor_param.
v = (
void*)a.
Gauge_p();
374 for (
int d = 0; d < 4; d++) {
375 gParamEx.
x[d] += 2 * R[d];
376 gParamEx.
r[d] = R[d];
387 out->exchangeExtendedGhost(R, profile, redundant_comms);
400 for (
int d = 0; d < 4; d++) {
401 gauge_field_param.
x[d] += 2 * R[d];
402 gauge_field_param.
r[d] = R[d];
static ColorSpinorField * Create(const ColorSpinorParam ¶m)
QudaGammaBasis gammaBasis
QudaFieldLocation location
void setPrecision(QudaPrecision precision, QudaPrecision ghost_precision=QUDA_INVALID_PRECISION, bool force_native=false)
QudaFieldGeometry Geometry() const
void removeStaggeredPhase()
void setTuningString()
Set the vol_string and aux_string for use in tuning.
QudaGaugeFieldOrder order
QudaLinkType LinkType() const
bool staggeredPhaseApplied
QudaStaggeredPhase staggeredPhaseType
GaugeField(const GaugeFieldParam ¶m)
QudaGaugeFieldOrder FieldOrder() const
static GaugeField * Create(const GaugeFieldParam ¶m)
Create the gauge field, with meta data specified in the parameter struct.
void exchange(void **recv, void **send, QudaDirection dir) const
Exchange the buffers across all dimensions in a given direction.
void applyStaggeredPhase(QudaStaggeredPhase phase=QUDA_STAGGERED_PHASE_INVALID)
uint64_t checksum(bool mini=false) const
int ghostFace[QUDA_MAX_DIM]
void checkField(const LatticeField &) const
QudaFieldGeometry geometry
QudaReconstructType reconstruct
double Anisotropy() const
void createGhostZone(const int *R, bool no_comms_fill, bool bidir=true) const
QudaReconstructType Reconstruct() const
QudaGhostExchange ghostExchange
size_t ghost_offset[QUDA_MAX_DIM][2]
QudaPrecision ghost_precision
QudaPrecision Precision() const
QudaFieldLocation Location() const
size_t ghost_face_bytes[QUDA_MAX_DIM]
char aux_string[TuneKey::aux_n]
virtual void setTuningString()
int surfaceCB[QUDA_MAX_DIM]
int surface[QUDA_MAX_DIM]
void checkField(const LatticeField &a) const
size_t ghost_face_bytes_aligned[QUDA_MAX_DIM]
void exchangeExtendedGhost(const int *R, bool no_comms_fill=false)
This does routine will populate the border / halo region of a gauge field that has been created using...
void exchangeGhost(QudaLinkDirection link_direction=QUDA_LINK_BACKWARDS)
Exchange the ghost and store store in the padded region.
void exchangeGhost(QudaLinkDirection link_direction=QUDA_LINK_BACKWARDS)
Exchange the ghost and store store in the padded region.
void comm_start(MsgHandle *mh)
int comm_dim_partitioned(int dim)
#define comm_declare_receive_relative(buffer, dim, dir, nbytes)
void comm_wait(MsgHandle *mh)
void comm_free(MsgHandle *&mh)
#define comm_declare_send_relative(buffer, dim, dir, nbytes)
QudaGaugeParam gauge_param
enum QudaStaggeredPhase_s QudaStaggeredPhase
@ QUDA_STAGGERED_PHASE_INVALID
@ QUDA_CUDA_FIELD_LOCATION
@ QUDA_CPU_FIELD_LOCATION
enum QudaDirection_s QudaDirection
enum QudaFieldGeometry_s QudaFieldGeometry
@ QUDA_GHOST_EXCHANGE_EXTENDED
@ QUDA_GHOST_EXCHANGE_PAD
@ QUDA_EVEN_ODD_SITE_ORDER
enum QudaReconstructType_s QudaReconstructType
@ QUDA_NATIVE_GAUGE_ORDER
@ QUDA_QDPJIT_GAUGE_ORDER
@ QUDA_REFERENCE_FIELD_CREATE
#define pool_pinned_malloc(size)
#define pool_pinned_free(ptr)
double norm1(const ColorSpinorField &b)
void ax(double a, ColorSpinorField &x)
double norm2(const ColorSpinorField &a)
ColorSpinorParam colorSpinorParam(const CloverField &a, bool inverse)
double norm2(const CloverField &a, bool inverse=false)
void ax(const double &a, GaugeField &u)
Scale the gauge field by the scalar a.
uint64_t Checksum(const GaugeField &u, bool mini=false)
double norm1(const CloverField &u, bool inverse=false)
cudaGaugeField * createExtendedGauge(cudaGaugeField &in, const int *R, TimeProfile &profile, bool redundant_comms=false, QudaReconstructType recon=QUDA_RECONSTRUCT_INVALID)
void copyExtendedGauge(GaugeField &out, const GaugeField &in, QudaFieldLocation location, void *Out=0, void *In=0)
void applyGaugePhase(GaugeField &u)
std::ostream & operator<<(std::ostream &output, const CloverFieldParam ¶m)
#define qudaMemcpy(dst, src, count, kind)
#define ALIGNMENT_ADJUST(n)
QudaReconstructType reconstruct
QudaFieldLocation location
GaugeFieldParam(void *const h_gauge=NULL)
QudaGhostExchange ghostExchange
QudaSiteSubset siteSubset