11 enable_gpu(enable_gpu),
init(true)
96 int pad = std::max( { (
x[0]*
x[1]*
x[2])/2, (
x[1]*
x[2]*
x[3])/2, (
x[0]*
x[2]*
x[3])/2, (
x[0]*
x[1]*
x[3])/2 } );
111 bool gpu_setup =
true;
136 if (!
enable_gpu)
errorQuda(
"Cannot apply %s on GPU since enable_gpu has not been set", __func__);
141 int n =
in.Nspin()*
in.Ncolor();
142 flops += (8*
n*
n-2*
n)*(
long long)
in.VolumeCB();
149 if (!
enable_gpu)
errorQuda(
"Cannot apply %s on GPU since enable_gpu has not been set", __func__);
154 int n =
in.Nspin()*
in.Ncolor();
155 flops += (8*
n*
n-2*
n)*(
long long)
in.VolumeCB();
162 if (!
enable_gpu)
errorQuda(
"Cannot apply %s on GPU since enable_gpu has not been set", __func__);
167 int n =
in.Nspin()*
in.Ncolor();
168 flops += (8*(8*
n*
n)-2*
n)*(
long long)
in.VolumeCB()*
in.SiteSubset();
173 const double &k)
const 175 if (k!=1.0)
errorQuda(
"%s not supported for k!=1.0", __func__);
178 if (!
enable_gpu)
errorQuda(
"Cannot apply %s on GPU since enable_gpu has not been set", __func__);
183 int n =
in.Nspin()*
in.Ncolor();
184 flops += (9*(8*
n*
n)-2*
n)*(
long long)
in.VolumeCB()*
in.SiteSubset();
190 if (!
enable_gpu)
errorQuda(
"Cannot apply %s on GPU since enable_gpu has not been set", __func__);
195 int n =
in.Nspin()*
in.Ncolor();
196 flops += (9*(8*
n*
n)-2*
n)*(
long long)
in.VolumeCB()*
in.SiteSubset();
215 errorQuda(
"Preconditioned solution requires a preconditioned solve_type");
233 CoarseCoarseOp(Y,
X, Xinv, Yhat, T, *(this->
Y_h), *(this->
X_h), *(this->
Xinv_h), kappa,
a,
mu_factor,
QUDA_COARSE_DIRAC,
QUDA_MATPC_INVALID);
235 CoarseCoarseOp(Y,
X, Xinv, Yhat, T, *(this->
Y_d), *(this->
X_d), *(this->
Xinv_d), kappa,
a,
mu_factor,
QUDA_COARSE_DIRAC,
QUDA_MATPC_INVALID);
254 if (!
enable_gpu)
errorQuda(
"Cannot apply %s on GPU since enable_gpu has not been set", __func__);
260 int n =
in.Nspin()*
in.Ncolor();
271 int n =
in.Nspin()*
in.Ncolor();
281 errorQuda(
"Cannot apply preconditioned operator to full field (subsets = %d %d %d)",
410 CoarseCoarseOp(Y,
X, Xinv, Yhat, T, *(this->
Yhat_h), *(this->
X_h), *(this->
Xinv_h), kappa,
a, -
mu_factor,
QUDA_COARSEPC_DIRAC,
matpcType);
412 CoarseCoarseOp(Y,
X, Xinv, Yhat, T, *(this->
Yhat_d), *(this->
X_d), *(this->
Xinv_d), kappa,
a, -
mu_factor,
QUDA_COARSEPC_DIRAC,
matpcType);
void xpay(ColorSpinorField &x, const double &a, ColorSpinorField &y)
enum QudaPrecision_s QudaPrecision
void prepare(ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType) const
void CloverInv(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
Apply the inverse coarse clover operator.
double mu_factor[QUDA_MAX_MG_LEVEL]
virtual void checkFullSpinor(const ColorSpinorField &, const ColorSpinorField &) const
void M(ColorSpinorField &out, const ColorSpinorField &in) const
Apply the full operator.
void Dslash(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
Apply DslashXpay out = (D * in)
void deleteTmp(ColorSpinorField **, const bool &reset) const
virtual void DslashXpay(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity, const ColorSpinorField &x, const double &k) const
Apply DslashXpay out = (D * in + A * x)
void Clover(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
Apply the coarse clover operator.
virtual void prepare(ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType) const
void createCoarseOp(GaugeField &Y, GaugeField &X, GaugeField &Xinv, GaugeField &Yhat, const Transfer &T, double kappa, double mu, double mu_factor=0.) const
Create the coarse operator from this coarse operator.
virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const
void DslashXpay(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity, const ColorSpinorField &x, const double &k) const
Apply DslashXpay out = (D * in + A * x)
bool newTmp(ColorSpinorField **, const ColorSpinorField &) const
void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const
virtual void Dslash(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
Apply DslashXpay out = (D * in)
void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const
void createCoarseOp(GaugeField &Y, GaugeField &X, GaugeField &Xinv, GaugeField &Yhat, const Transfer &T, double kappa, double mu, double mu_factor=0.) const
Create the coarse even-odd preconditioned coarse operator. Unlike the Wilson operator, the coarsening of the preconditioned coarse operator differs from that of the unpreconditioned coarse operator, so we need to specialize it.
const ColorSpinorField & Vectors(QudaFieldLocation location=QUDA_CPU_FIELD_LOCATION) const
VOLATILE spinorFloat kappa
const Transfer * transfer
void copy(const GaugeField &src)
virtual void createCoarseOp(GaugeField &Y, GaugeField &X, GaugeField &Xinv, GaugeField &Yhat, const Transfer &T, double kappa, double mu=0., double mu_factor=0.) const
Create the coarse operator (virtual parent)
QudaSiteSubset SiteSubset() const
#define checkLocation(...)
enum QudaSolutionType_s QudaSolutionType
enum QudaParity_s QudaParity
void ApplyCoarse(ColorSpinorField &out, const ColorSpinorField &inA, const ColorSpinorField &inB, const GaugeField &Y, const GaugeField &X, double kappa, int parity=QUDA_INVALID_PARITY, bool dslash=true, bool clover=true, bool dagger=false)
void CoarseCoarseOp(GaugeField &Y, GaugeField &X, GaugeField &Xinv, GaugeField &Yhat, const Transfer &T, const GaugeField &gauge, const GaugeField &clover, const GaugeField &cloverInv, double kappa, double mu, double mu_factor, QudaDiracType dirac, QudaMatPCType matpc)
Coarse operator construction from an intermediate-grid operator (Coarse)
void * memcpy(void *__dst, const void *__src, size_t __n)
const int * Geo_bs() const
void Mdag(ColorSpinorField &out, const ColorSpinorField &in) const
cpuColorSpinorField * out
virtual void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const
QudaTwistFlavorType TwistFlavor() const
#define QUDA_MAX_DIM
Maximum number of dimensions supported by QUDA. In practice, no routines make use of more than 5...
virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const
Apply the full operator.
void copy(const GaugeField &src)
QudaPrecision Precision() const
DiracCoarse(const DiracParam ¶m, bool enable_gpu=true)
DiracCoarsePC(const DiracParam ¶m, bool enable_gpu=true)