QUDA  v1.1.0
A library for QCD on GPUs
gauge_covdev.cpp
Go to the documentation of this file.
1 #include <dirac_quda.h>
2 #include <blas_quda.h>
3 #include <iostream>
4 #include <multigrid.h>
5 #include <dslash_quda.h>
6 
7 namespace quda {
8 
10 
11  GaugeCovDev::GaugeCovDev(const GaugeCovDev &covDev) : Dirac(covDev) { }
12 
14 
16  {
17  if (&covDev != this) Dirac::operator=(covDev);
18  return *this;
19  }
20 
21  void GaugeCovDev::DslashCD(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity, const int mu) const
22  {
23  checkSpinorAlias(in, out);
24 
25  int comm_dim[4] = {};
26  // only switch on comms needed for mu derivative (FIXME - only communicate in the given direction)
27  comm_dim[mu % 4] = comm_dim_partitioned(mu % 4);
29  flops += 1320ll*in.Volume(); // FIXME
30  }
31 
32  void GaugeCovDev::MCD(ColorSpinorField &out, const ColorSpinorField &in, const int mu) const
33  {
34  checkFullSpinor(out, in);
35  DslashCD(out, in, QUDA_INVALID_PARITY, mu);
36  }
37 
38  void GaugeCovDev::MdagMCD(ColorSpinorField &out, const ColorSpinorField &in, const int mu) const
39  {
40  bool reset = newTmp(&tmp1, in);
41  checkFullSpinor(*tmp1, in);
42 
43  MCD(*tmp1, in, mu);
44  MCD(out, *tmp1, (mu+4)%8);
45 
46  deleteTmp(&tmp1, reset);
47  }
48 
50  {
51  //do nothing
52  }
53 
55  const ColorSpinorField &in,
56  const QudaParity parity,
57  const ColorSpinorField &x,
58  const double &k) const
59  {
60  //do nothing
61  }
62 
63  void GaugeCovDev::M(ColorSpinorField &out, const ColorSpinorField &in) const
64  {
65  //do nothing
66  }
67 
69  {
70  //do nothing
71  }
72 
75  const QudaSolutionType solType) const
76  {
77  //do nothing
78  }
79 
81  const ColorSpinorField &b,
82  const QudaSolutionType solType) const
83  {
84  //do nothing
85  }
86 
87 } // namespace quda
unsigned long long flops
Definition: dirac_quda.h:150
bool newTmp(ColorSpinorField **, const ColorSpinorField &) const
Definition: dirac.cpp:72
cudaGaugeField * gauge
Definition: dirac_quda.h:144
void deleteTmp(ColorSpinorField **, const bool &reset) const
Definition: dirac.cpp:83
ColorSpinorField * tmp1
Definition: dirac_quda.h:151
TimeProfile profile
Definition: dirac_quda.h:161
QudaDagType dagger
Definition: dirac_quda.h:149
void checkSpinorAlias(const ColorSpinorField &, const ColorSpinorField &) const
check spinors do not alias
Definition: dirac.cpp:146
Dirac & operator=(const Dirac &dirac)
Definition: dirac.cpp:51
virtual void checkFullSpinor(const ColorSpinorField &, const ColorSpinorField &) const
check full spinors are compatible (check geometry ?)
Definition: dirac.cpp:138
Full Covariant Derivative operator. Although not a Dirac operator per se, it's a linear operator so i...
Definition: dirac_quda.h:1858
virtual void MCD(ColorSpinorField &out, const ColorSpinorField &in, const int mu) const
virtual void MdagMCD(ColorSpinorField &out, const ColorSpinorField &in, const int mu) const
virtual void prepare(ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType) const
virtual ~GaugeCovDev()
GaugeCovDev(const DiracParam &param)
Definition: gauge_covdev.cpp:9
virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const
Apply M for the dirac op. E.g. the Schur Complement operator.
virtual void DslashXpay(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity, const ColorSpinorField &x, const double &k) const
Xpay version of Dslash.
virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const
Apply MdagM operator which may be optimized.
GaugeCovDev & operator=(const GaugeCovDev &covDev)
virtual void DslashCD(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity, const int mu) const
virtual void Dslash(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
apply 'dslash' operator for the DiracOp. This may be e.g. AD
virtual void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const
int comm_dim_partitioned(int dim)
int comm_dim(int dim)
double mu
QudaParity parity
Definition: covdev_test.cpp:40
@ QUDA_INVALID_PARITY
Definition: enum_quda.h:284
enum QudaSolutionType_s QudaSolutionType
enum QudaParity_s QudaParity
void ApplyCovDev(ColorSpinorField &out, const ColorSpinorField &in, const GaugeField &U, int mu, int parity, bool dagger, const int *comm_override, TimeProfile &profile)
Driver for applying the covariant derivative.
QudaGaugeParam param
Definition: pack_test.cpp:18