QUDA  v1.1.0
A library for QCD on GPUs
gauge_field.h
Go to the documentation of this file.
1 #ifndef _GAUGE_QUDA_H
2 #define _GAUGE_QUDA_H
3 
4 #include <quda_internal.h>
5 #include <quda.h>
6 #include <lattice_field.h>
7 
8 #include <comm_key.h>
9 
10 namespace quda {
11 
12  namespace gauge
13  {
14 
15  inline bool isNative(QudaGaugeFieldOrder order, QudaPrecision precision, QudaReconstructType reconstruct)
16  {
17  if (precision == QUDA_DOUBLE_PRECISION) {
18  if (order == QUDA_FLOAT2_GAUGE_ORDER) return true;
19  } else if (precision == QUDA_SINGLE_PRECISION) {
20  if (reconstruct == QUDA_RECONSTRUCT_NO || reconstruct == QUDA_RECONSTRUCT_10) {
21  if (order == QUDA_FLOAT2_GAUGE_ORDER) return true;
22  } else if (reconstruct == QUDA_RECONSTRUCT_12 || reconstruct == QUDA_RECONSTRUCT_13
23  || reconstruct == QUDA_RECONSTRUCT_8 || reconstruct == QUDA_RECONSTRUCT_9) {
24  if (order == QUDA_FLOAT4_GAUGE_ORDER) return true;
25  }
26  } else if (precision == QUDA_HALF_PRECISION || precision == QUDA_QUARTER_PRECISION) {
27  if (reconstruct == QUDA_RECONSTRUCT_NO || reconstruct == QUDA_RECONSTRUCT_10) {
28  if (order == QUDA_FLOAT2_GAUGE_ORDER) return true;
29  } else if (reconstruct == QUDA_RECONSTRUCT_12 || reconstruct == QUDA_RECONSTRUCT_13) {
30  if (order == QUDA_FLOAT4_GAUGE_ORDER) return true;
31  } else if (reconstruct == QUDA_RECONSTRUCT_8 || reconstruct == QUDA_RECONSTRUCT_9) {
32 #ifdef FLOAT8
33  if (order == QUDA_FLOAT8_GAUGE_ORDER) return true;
34 #else
35  if (order == QUDA_FLOAT4_GAUGE_ORDER) return true;
36 #endif
37  }
38  }
39  return false;
40  }
41 
42  } // namespace gauge
43 
45 
46  QudaFieldLocation location; // where are we storing the field (CUDA or GPU)?
47  int nColor;
48  int nFace;
49 
55 
56  double anisotropy;
57  double tadpole;
58  void *gauge; // used when we use a reference to an external field
59 
60  QudaFieldCreate create; // used to determine the type of field created
61 
62  QudaFieldGeometry geometry; // whether the field is a scale, vector or tensor
63 
64  // whether we need to compute the fat link maxima
65  // FIXME temporary flag until we have a kernel that can do this, then we just do this in copy()
66  // always set to false, requires external override
68 
71 
74 
76  double i_mu;
77 
79  size_t site_offset;
80 
82  size_t site_size;
83 
84  // Default constructor
85  GaugeFieldParam(void *const h_gauge = NULL) :
88  nColor(3),
89  nFace(0),
95  anisotropy(1.0),
96  tadpole(1.0),
97  gauge(h_gauge),
100  compute_fat_link_max(false),
102  staggeredPhaseApplied(false),
103  i_mu(0.0),
104  site_offset(0),
105  site_size(0)
106  {
107  }
108 
109  GaugeFieldParam(const GaugeField &u);
110 
115  nColor(3),
116  nFace(0),
122  anisotropy(1.0),
123  tadpole(1.0),
124  gauge(0),
127  compute_fat_link_max(false),
129  staggeredPhaseApplied(false),
130  i_mu(0.0),
131  site_offset(0),
132  site_size(0)
133  {
134  }
135 
136  GaugeFieldParam(void *h_gauge, const QudaGaugeParam &param, QudaLinkType link_type_ = QUDA_INVALID_LINKS) :
139  nColor(3),
140  nFace(0),
143  fixed(param.gauge_fix),
144  link_type(link_type_ != QUDA_INVALID_LINKS ? link_type_ : param.type),
147  tadpole(param.tadpole_coeff),
148  gauge(h_gauge),
151  compute_fat_link_max(false),
152  staggeredPhaseType(param.staggered_phase_type),
153  staggeredPhaseApplied(param.staggered_phase_applied),
154  i_mu(param.i_mu),
155  site_offset(param.gauge_offset),
157  {
158  switch (link_type) {
159  case QUDA_SU3_LINKS:
160  case QUDA_GENERAL_LINKS:
161  case QUDA_SMEARED_LINKS:
162  case QUDA_MOMENTUM_LINKS: nFace = 1; break;
163  case QUDA_THREE_LINKS: nFace = 3; break;
164  default: errorQuda("Error: invalid link type(%d)\n", link_type);
165  }
166  }
167 
173  void setPrecision(QudaPrecision precision, bool force_native = false)
174  {
175  // is the current status in native field order?
176  bool native = force_native ? true : gauge::isNative(order, this->precision, reconstruct);
177  this->precision = precision;
178  this->ghost_precision = precision;
179 
180  if (native) {
186 #ifdef FLOAT8
188 #else
190 #endif
191  } else {
193  }
194  }
195  }
196  };
197 
198  std::ostream& operator<<(std::ostream& output, const GaugeFieldParam& param);
199 
200  class GaugeField : public LatticeField {
201 
202  protected:
203  size_t bytes; // bytes allocated per full field
204  size_t phase_offset; // offset in bytes to gauge phases - useful to keep track of texture alignment
205  size_t phase_bytes; // bytes needed to store the phases
206  size_t length;
207  size_t real_length;
208  int nColor;
209  int nFace;
210  QudaFieldGeometry geometry; // whether the field is a scale, vector or tensor
211 
213  int nInternal; // number of degrees of freedom per link matrix
218 
219  double anisotropy;
220  double tadpole;
221  double fat_link_max;
222 
223  QudaFieldCreate create; // used to determine the type of field created
224 
225  mutable void *ghost[2 * QUDA_MAX_DIM]; // stores the ghost zone of the gauge field (non-native fields only)
226 
227  mutable int ghostFace[QUDA_MAX_DIM]; // the size of each face
228 
233 
238 
245  void exchange(void **recv, void **send, QudaDirection dir) const;
246 
250  double i_mu;
251 
255  size_t site_offset;
256 
260  size_t site_size;
261 
270  void createGhostZone(const int *R, bool no_comms_fill, bool bidir = true) const;
271 
275  void setTuningString();
276 
277  public:
279  virtual ~GaugeField();
280 
283 
284  size_t Length() const { return length; }
285  int Ncolor() const { return nColor; }
287  QudaGaugeFieldOrder Order() const { return order; }
288  double Anisotropy() const { return anisotropy; }
289  double Tadpole() const { return tadpole; }
290  QudaTboundary TBoundary() const { return t_boundary; }
291  QudaLinkType LinkType() const { return link_type; }
292  QudaGaugeFixed GaugeFixed() const { return fixed; }
294  QudaFieldGeometry Geometry() const { return geometry; }
297 
302 
310 
314  void removeStaggeredPhase();
315 
319  double iMu() const { return i_mu; }
320 
321  const double& LinkMax() const { return fat_link_max; }
322  int Nface() const { return nFace; }
323 
331  virtual void exchangeExtendedGhost(const int *R, bool no_comms_fill = false) = 0;
332 
342  virtual void exchangeExtendedGhost(const int *R, TimeProfile &profile, bool no_comms_fill = false) = 0;
343 
344  void checkField(const LatticeField &) const;
345 
350  bool isNative() const { return gauge::isNative(order, precision, reconstruct); }
351 
352  size_t Bytes() const { return bytes; }
353  size_t PhaseBytes() const { return phase_bytes; }
354  size_t PhaseOffset() const { return phase_offset; }
355 
356  size_t TotalBytes() const { return bytes; }
357 
358  virtual void* Gauge_p() { errorQuda("Not implemented"); return (void*)0;}
359  virtual void* Even_p() { errorQuda("Not implemented"); return (void*)0;}
360  virtual void* Odd_p() { errorQuda("Not implemented"); return (void*)0;}
361 
362  virtual const void* Gauge_p() const { errorQuda("Not implemented"); return (void*)0;}
363  virtual const void* Even_p() const { errorQuda("Not implemented"); return (void*)0;}
364  virtual const void* Odd_p() const { errorQuda("Not implemented"); return (void*)0;}
365 
366  virtual int full_dim(int d) const { return x[d]; }
367 
368  const void** Ghost() const {
369  if ( isNative() ) errorQuda("No ghost zone pointer for quda-native gauge fields");
370  return (const void**)ghost;
371  }
372 
373  void** Ghost() {
374  if ( isNative() ) errorQuda("No ghost zone pointer for quda-native gauge fields");
375  return ghost;
376  }
377 
382  size_t SiteOffset() const { return site_offset; }
383 
388  size_t SiteSize() const { return site_size; }
389 
393  virtual void zero() = 0;
394 
399  virtual void copy(const GaugeField &src) = 0;
400 
406  double norm1(int dim = -1, bool fixed = false) const;
407 
413  double norm2(int dim = -1, bool fixed = false) const;
414 
420  double abs_max(int dim = -1, bool fixed = false) const;
421 
427  double abs_min(int dim = -1, bool fixed = false) const;
428 
437  uint64_t checksum(bool mini = false) const;
438 
445  static GaugeField* Create(const GaugeFieldParam &param);
446 
447  };
448 
449  class cudaGaugeField : public GaugeField {
450 
451  private:
452  void *gauge;
453  void *gauge_h; // mapped-memory pointer when allocating on the host
454  void *even;
455  void *odd;
456 
460  void zeroPad();
461 
462  public:
464  virtual ~cudaGaugeField();
465 
471  void exchangeGhost(QudaLinkDirection link_direction = QUDA_LINK_BACKWARDS);
472 
479  void injectGhost(QudaLinkDirection link_direction = QUDA_LINK_BACKWARDS);
480 
490  void createComms(const int *R, bool no_comms_fill, bool bidir=true);
491 
500  void allocateGhostBuffer(const int *R, bool no_comms_fill, bool bidir=true) const;
501 
507  void recvStart(int dim, int dir);
508 
516  void sendStart(int dim, int dir, qudaStream_t *stream_p = nullptr);
517 
523  void commsComplete(int dim, int dir);
524 
532  void exchangeExtendedGhost(const int *R, bool no_comms_fill=false);
533 
543  void exchangeExtendedGhost(const int *R, TimeProfile &profile, bool no_comms_fill=false);
544 
549  void copy(const GaugeField &src);
550 
555  void loadCPUField(const cpuGaugeField &cpu);
556 
563  void loadCPUField(const cpuGaugeField &cpu, TimeProfile &profile);
564 
569  void saveCPUField(cpuGaugeField &cpu) const;
570 
577  void saveCPUField(cpuGaugeField &cpu, TimeProfile &profile) const;
578 
579  // (ab)use with care
580  void* Gauge_p() { return gauge; }
581  void* Even_p() { return even; }
582  void* Odd_p() { return odd; }
583 
584  const void* Gauge_p() const { return gauge; }
585  const void* Even_p() const { return even; }
586  const void *Odd_p() const { return odd; }
587 
592  virtual void copy_to_buffer(void *buffer) const;
593 
598  virtual void copy_from_buffer(void *buffer);
599 
600  void setGauge(void* _gauge); //only allowed when create== QUDA_REFERENCE_FIELD_CREATE
601 
605  void zero();
606 
610  void backup() const;
611 
615  void restore() const;
616 
623  void prefetch(QudaFieldLocation mem_space, qudaStream_t stream = 0) const;
624  };
625 
626  class cpuGaugeField : public GaugeField {
627 
628  friend void cudaGaugeField::copy(const GaugeField &cpu);
631 
632  private:
633  void **gauge; // the actual gauge field
634 
635  public:
644  virtual ~cpuGaugeField();
645 
651  void exchangeGhost(QudaLinkDirection link_direction = QUDA_LINK_BACKWARDS);
652 
659  void injectGhost(QudaLinkDirection link_direction = QUDA_LINK_BACKWARDS);
660 
669  void exchangeExtendedGhost(const int *R, bool no_comms_fill=false);
670 
680  void exchangeExtendedGhost(const int *R, TimeProfile &profile, bool no_comms_fill=false);
681 
686  void copy(const GaugeField &src);
687 
688  void* Gauge_p() { return gauge; }
689  const void* Gauge_p() const { return gauge; }
690 
695  virtual void copy_to_buffer(void *buffer) const;
696 
701  virtual void copy_from_buffer(void *buffer);
702 
703  void setGauge(void** _gauge); //only allowed when create== QUDA_REFERENCE_FIELD_CREATE
704 
708  void zero();
709 
713  void backup() const;
714 
718  void restore() const;
719  };
720 
727  double norm1(const GaugeField &u);
728 
735  double norm2(const GaugeField &u);
736 
742  void ax(const double &a, GaugeField &u);
743 
756  void copyGenericGauge(GaugeField &out, const GaugeField &in, QudaFieldLocation location, void *Out = 0, void *In = 0,
757  void **ghostOut = 0, void **ghostIn = 0, int type = 0);
758 
767  void copyFieldOffset(GaugeField &out, const GaugeField &in, CommKey offset, QudaPCType pc_type);
768 
779  QudaFieldLocation location, void *Out=0, void *In=0);
780 
791  cudaGaugeField *createExtendedGauge(cudaGaugeField &in, const int *R, TimeProfile &profile,
792  bool redundant_comms = false, QudaReconstructType recon = QUDA_RECONSTRUCT_INVALID);
793 
801  cpuGaugeField *createExtendedGauge(void **gauge, QudaGaugeParam &gauge_param, const int *R);
802 
815  void extractGaugeGhost(const GaugeField &u, void **ghost, bool extract=true, int offset=0);
816 
825  void extractExtendedGaugeGhost(const GaugeField &u, int dim, const int *R, void **ghost, bool extract);
826 
832 
842  uint64_t Checksum(const GaugeField &u, bool mini=false);
843 
850  inline QudaReconstructType Reconstruct_(const char *func, const char *file, int line, const GaugeField &a,
851  const GaugeField &b)
852  {
854  if (a.Reconstruct() == b.Reconstruct())
855  reconstruct = a.Reconstruct();
856  else
857  errorQuda("Reconstruct %d %d do not match (%s:%d in %s())\n", a.Reconstruct(), b.Reconstruct(), file, line, func);
858  return reconstruct;
859  }
860 
868  template <typename... Args>
869  inline QudaReconstructType Reconstruct_(const char *func, const char *file, int line, const GaugeField &a,
870  const GaugeField &b, const Args &... args)
871  {
872  return static_cast<QudaReconstructType>(Reconstruct_(func, file, line, a, b)
873  & Reconstruct_(func, file, line, a, args...));
874  }
875 
876 #define checkReconstruct(...) Reconstruct_(__func__, __FILE__, __LINE__, __VA_ARGS__)
877 
878 } // namespace quda
879 
880 #endif // _GAUGE_QUDA_H
QudaFieldGeometry Geometry() const
Definition: gauge_field.h:294
QudaLinkType link_type
Definition: gauge_field.h:216
QudaStaggeredPhase StaggeredPhase() const
Definition: gauge_field.h:295
QudaFieldCreate create
Definition: gauge_field.h:223
void * ghost[2 *QUDA_MAX_DIM]
Definition: gauge_field.h:225
QudaTboundary t_boundary
Definition: gauge_field.h:217
size_t SiteOffset() const
Definition: gauge_field.h:382
size_t PhaseOffset() const
Definition: gauge_field.h:354
virtual void * Even_p()
Definition: gauge_field.h:359
size_t TotalBytes() const
Definition: gauge_field.h:356
QudaGaugeFixed fixed
Definition: gauge_field.h:215
void removeStaggeredPhase()
void setTuningString()
Set the vol_string and aux_string for use in tuning.
QudaGaugeFieldOrder order
Definition: gauge_field.h:214
double norm2(int dim=-1, bool fixed=false) const
Compute the L2 norm squared of the field.
QudaLinkType LinkType() const
Definition: gauge_field.h:291
bool staggeredPhaseApplied
Definition: gauge_field.h:237
virtual ~GaugeField()
virtual void exchangeExtendedGhost(const int *R, bool no_comms_fill=false)=0
This routine will populate the border / halo region of a gauge field that has been created using copy...
QudaStaggeredPhase staggeredPhaseType
Definition: gauge_field.h:232
size_t PhaseBytes() const
Definition: gauge_field.h:353
double norm1(int dim=-1, bool fixed=false) const
Compute the L1 norm of the field.
GaugeField(const GaugeFieldParam &param)
Definition: gauge_field.cpp:30
QudaGaugeFieldOrder Order() const
Definition: gauge_field.h:287
const double & LinkMax() const
Definition: gauge_field.h:321
void ** Ghost()
Definition: gauge_field.h:373
size_t Bytes() const
Definition: gauge_field.h:352
QudaGaugeFieldOrder FieldOrder() const
Definition: gauge_field.h:293
static GaugeField * Create(const GaugeFieldParam &param)
Create the gauge field, with meta data specified in the parameter struct.
double Tadpole() const
Definition: gauge_field.h:289
int Nface() const
Definition: gauge_field.h:322
virtual const void * Odd_p() const
Definition: gauge_field.h:364
virtual void exchangeExtendedGhost(const int *R, TimeProfile &profile, bool no_comms_fill=false)=0
This routine will populate the border / halo region of a gauge field that has been created using copy...
void exchange(void **recv, void **send, QudaDirection dir) const
Exchange the buffers across all dimensions in a given direction.
QudaTboundary TBoundary() const
Definition: gauge_field.h:290
virtual void * Odd_p()
Definition: gauge_field.h:360
virtual int full_dim(int d) const
Definition: gauge_field.h:366
void applyStaggeredPhase(QudaStaggeredPhase phase=QUDA_STAGGERED_PHASE_INVALID)
int Ncolor() const
Definition: gauge_field.h:285
virtual void * Gauge_p()
Definition: gauge_field.h:358
QudaGaugeFixed GaugeFixed() const
Definition: gauge_field.h:292
uint64_t checksum(bool mini=false) const
size_t SiteSize() const
Definition: gauge_field.h:388
virtual void copy(const GaugeField &src)=0
virtual void zero()=0
virtual void injectGhost(QudaLinkDirection=QUDA_LINK_BACKWARDS)=0
int ghostFace[QUDA_MAX_DIM]
Definition: gauge_field.h:227
size_t Length() const
Definition: gauge_field.h:284
bool isNative() const
Definition: gauge_field.h:350
double abs_max(int dim=-1, bool fixed=false) const
Compute the absolute maximum of the field (Linfinity norm)
virtual void exchangeGhost(QudaLinkDirection=QUDA_LINK_BACKWARDS)=0
double abs_min(int dim=-1, bool fixed=false) const
Compute the absolute minimum of the field.
void checkField(const LatticeField &) const
QudaFieldGeometry geometry
Definition: gauge_field.h:210
virtual const void * Even_p() const
Definition: gauge_field.h:363
double iMu() const
Definition: gauge_field.h:319
QudaReconstructType reconstruct
Definition: gauge_field.h:212
double Anisotropy() const
Definition: gauge_field.h:288
const void ** Ghost() const
Definition: gauge_field.h:368
bool StaggeredPhaseApplied() const
Definition: gauge_field.h:296
void createGhostZone(const int *R, bool no_comms_fill, bool bidir=true) const
QudaReconstructType Reconstruct() const
Definition: gauge_field.h:286
virtual const void * Gauge_p() const
Definition: gauge_field.h:362
int x[QUDA_MAX_DIM]
QudaPrecision precision
const int * R() const
const void * Gauge_p() const
Definition: gauge_field.h:689
void copy(const GaugeField &src)
virtual void copy_from_buffer(void *buffer)
Copy all contents of the field from a host buffer to this field.
void setGauge(void **_gauge)
void backup() const
Backs up the cpuGaugeField.
void injectGhost(QudaLinkDirection link_direction=QUDA_LINK_BACKWARDS)
The opposite of exchangeGhost: take the ghost zone on x, send to node x-1, and inject back into the f...
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 restore() const
Restores the cpuGaugeField.
cpuGaugeField(const GaugeFieldParam &param)
Constructor for cpuGaugeField from a GaugeFieldParam.
virtual void copy_to_buffer(void *buffer) const
Copy all contents of the field to a host buffer.
virtual void copy_from_buffer(void *buffer)
Copy all contents of the field from a host buffer to this field.
const void * Even_p() const
Definition: gauge_field.h:585
void setGauge(void *_gauge)
void copy(const GaugeField &src)
void prefetch(QudaFieldLocation mem_space, qudaStream_t stream=0) const
If managed memory and prefetch is enabled, prefetch the gauge field and buffers to the CPU or the GPU...
const void * Gauge_p() const
Definition: gauge_field.h:584
void exchangeGhost(QudaLinkDirection link_direction=QUDA_LINK_BACKWARDS)
Exchange the ghost and store store in the padded region.
void createComms(const int *R, bool no_comms_fill, bool bidir=true)
Create the communication handlers and buffers.
void injectGhost(QudaLinkDirection link_direction=QUDA_LINK_BACKWARDS)
The opposite of exchangeGhost: take the ghost zone on x, send to node x-1, and inject back into the f...
void recvStart(int dim, int dir)
Start the receive communicators.
void sendStart(int dim, int dir, qudaStream_t *stream_p=nullptr)
Start the sending communicators.
void loadCPUField(const cpuGaugeField &cpu)
Download into this field from a CPU field.
const void * Odd_p() const
Definition: gauge_field.h:586
void backup() const
Backs up the cudaGaugeField to CPU memory.
void allocateGhostBuffer(const int *R, bool no_comms_fill, bool bidir=true) const
Allocate the ghost buffers.
void saveCPUField(cpuGaugeField &cpu) const
Upload from this field into a CPU field.
virtual void copy_to_buffer(void *buffer) const
Copy all contents of the field to a host buffer.
void restore() const
Restores the cudaGaugeField to CUDA memory.
cudaGaugeField(const GaugeFieldParam &)
void commsComplete(int dim, int dir)
Wait for communication to complete.
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...
std::array< int, 4 > dim
QudaGaugeParam gauge_param
Definition: covdev_test.cpp:26
enum QudaPrecision_s QudaPrecision
enum QudaGaugeFixed_s QudaGaugeFixed
enum QudaStaggeredPhase_s QudaStaggeredPhase
enum QudaLinkDirection_s QudaLinkDirection
@ QUDA_STAGGERED_PHASE_NO
Definition: enum_quda.h:515
@ QUDA_STAGGERED_PHASE_INVALID
Definition: enum_quda.h:519
@ QUDA_CPU_FIELD_LOCATION
Definition: enum_quda.h:325
@ QUDA_INVALID_FIELD_LOCATION
Definition: enum_quda.h:327
enum QudaDirection_s QudaDirection
@ QUDA_LINK_BACKWARDS
Definition: enum_quda.h:497
enum QudaGaugeFieldOrder_s QudaGaugeFieldOrder
enum QudaTboundary_s QudaTboundary
@ QUDA_RECONSTRUCT_NO
Definition: enum_quda.h:70
@ QUDA_RECONSTRUCT_INVALID
Definition: enum_quda.h:76
@ QUDA_RECONSTRUCT_12
Definition: enum_quda.h:71
@ QUDA_RECONSTRUCT_13
Definition: enum_quda.h:74
@ QUDA_RECONSTRUCT_8
Definition: enum_quda.h:72
@ QUDA_RECONSTRUCT_10
Definition: enum_quda.h:75
@ QUDA_RECONSTRUCT_9
Definition: enum_quda.h:73
@ QUDA_INVALID_T_BOUNDARY
Definition: enum_quda.h:58
enum QudaPCType_s QudaPCType
@ QUDA_VECTOR_GEOMETRY
Definition: enum_quda.h:501
enum QudaFieldGeometry_s QudaFieldGeometry
enum QudaFieldLocation_s QudaFieldLocation
@ QUDA_GHOST_EXCHANGE_PAD
Definition: enum_quda.h:509
enum QudaFieldCreate_s QudaFieldCreate
@ QUDA_GAUGE_FIXED_NO
Definition: enum_quda.h:80
enum QudaGhostExchange_s QudaGhostExchange
enum QudaReconstructType_s QudaReconstructType
@ QUDA_DOUBLE_PRECISION
Definition: enum_quda.h:65
@ QUDA_SINGLE_PRECISION
Definition: enum_quda.h:64
@ QUDA_QUARTER_PRECISION
Definition: enum_quda.h:62
@ QUDA_HALF_PRECISION
Definition: enum_quda.h:63
@ QUDA_FLOAT2_GAUGE_ORDER
Definition: enum_quda.h:40
@ QUDA_FLOAT4_GAUGE_ORDER
Definition: enum_quda.h:41
@ QUDA_FLOAT8_GAUGE_ORDER
Definition: enum_quda.h:42
@ QUDA_INVALID_GAUGE_ORDER
Definition: enum_quda.h:52
@ QUDA_REFERENCE_FIELD_CREATE
Definition: enum_quda.h:363
@ QUDA_NULL_FIELD_CREATE
Definition: enum_quda.h:360
@ QUDA_SU3_LINKS
Definition: enum_quda.h:24
@ QUDA_GENERAL_LINKS
Definition: enum_quda.h:25
@ QUDA_INVALID_LINKS
Definition: enum_quda.h:35
@ QUDA_THREE_LINKS
Definition: enum_quda.h:26
@ QUDA_WILSON_LINKS
Definition: enum_quda.h:30
@ QUDA_MOMENTUM_LINKS
Definition: enum_quda.h:27
@ QUDA_SMEARED_LINKS
Definition: enum_quda.h:29
enum QudaLinkType_s QudaLinkType
QudaGaugeFieldOrder gauge_order
bool isNative(QudaGaugeFieldOrder order, QudaPrecision precision, QudaReconstructType reconstruct)
Definition: gauge_field.h:15
QudaReconstructType Reconstruct_(const char *func, const char *file, int line, const GaugeField &a, const GaugeField &b)
Helper function for determining if the reconstruct of the fields is the same.
Definition: gauge_field.h:850
void copyGenericGauge(GaugeField &out, const GaugeField &in, QudaFieldLocation location, void *Out=0, void *In=0, void **ghostOut=0, void **ghostIn=0, int type=0)
Definition: copy_gauge.cpp:44
void extractGaugeGhost(const GaugeField &u, void **ghost, bool extract=true, int offset=0)
double norm2(const CloverField &a, bool inverse=false)
void ax(const double &a, GaugeField &u)
Scale the gauge field by the scalar a.
void extractExtendedGaugeGhost(const GaugeField &u, int dim, const int *R, void **ghost, bool extract)
uint64_t Checksum(const GaugeField &u, bool mini=false)
qudaStream_t * stream
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 copyFieldOffset(CloverField &out, const CloverField &in, CommKey offset, QudaPCType pc_type)
This function is used for copying from a source clover field to a destination clover field with an of...
void applyGaugePhase(GaugeField &u)
std::ostream & operator<<(std::ostream &output, const CloverFieldParam &param)
QudaGaugeParam param
Definition: pack_test.cpp:18
Main header file for the QUDA library.
cudaStream_t qudaStream_t
Definition: quda_api.h:9
#define QUDA_MAX_DIM
Maximum number of dimensions supported by QUDA. In practice, no routines make use of more than 5.
QudaReconstructType reconstruct
Definition: gauge_field.h:50
GaugeFieldParam(void *const h_gauge=NULL)
Definition: gauge_field.h:85
QudaGaugeFieldOrder order
Definition: gauge_field.h:51
QudaFieldGeometry geometry
Definition: gauge_field.h:62
void setPrecision(QudaPrecision precision, bool force_native=false)
Helper function for setting the precision and corresponding field order for QUDA internal fields.
Definition: gauge_field.h:173
QudaStaggeredPhase staggeredPhaseType
Definition: gauge_field.h:70
QudaGaugeFixed fixed
Definition: gauge_field.h:52
QudaLinkType link_type
Definition: gauge_field.h:53
QudaFieldCreate create
Definition: gauge_field.h:60
QudaTboundary t_boundary
Definition: gauge_field.h:54
GaugeFieldParam(void *h_gauge, const QudaGaugeParam &param, QudaLinkType link_type_=QUDA_INVALID_LINKS)
Definition: gauge_field.h:136
QudaFieldLocation location
Definition: gauge_field.h:46
GaugeFieldParam(const int *x, const QudaPrecision precision, const QudaReconstructType reconstruct, const int pad, const QudaFieldGeometry geometry, const QudaGhostExchange ghostExchange=QUDA_GHOST_EXCHANGE_PAD)
Definition: gauge_field.h:111
QudaPrecision precision
Definition: lattice_field.h:52
QudaGhostExchange ghostExchange
Definition: lattice_field.h:77
QudaPrecision ghost_precision
Definition: lattice_field.h:55
int x[QUDA_MAX_DIM]
Definition: lattice_field.h:68
#define errorQuda(...)
Definition: util_quda.h:120