13 need_bidirectional(param.need_bidirectional),
112 gParam.
nColor = Nc_c*Ns_c;
127 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 } );
128 gParam.
pad = gpu ? gParam.
nFace * pad * 2 : 0;
153 gParam.
nColor = Nc_c*Ns_c;
167 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 } );
168 gParam.
pad = gpu ? gParam.
nFace * pad * 2 : 0;
242 if (&in == &out)
errorQuda(
"Fields cannot alias");
246 ApplyCoarse(out, in, in, *
Y_d, *
X_d,
kappa, parity,
false,
true,
dagger,
commDim);
248 ApplyCoarse(out, in, in, *
Y_h, *
X_h,
kappa, parity,
false,
true,
dagger,
commDim);
256 if (&in == &out)
errorQuda(
"Fields cannot alias");
260 ApplyCoarse(out, in, in, *
Y_d, *
Xinv_d,
kappa, parity,
false,
true,
dagger,
commDim);
262 ApplyCoarse(out, in, in, *
Y_h, *
Xinv_h,
kappa, parity,
false,
true,
dagger,
commDim);
274 ApplyCoarse(out, in, in, *
Y_d, *
X_d,
kappa, parity,
true,
false,
dagger,
commDim,
halo_precision);
276 ApplyCoarse(out, in, in, *
Y_h, *
X_h,
kappa, parity,
true,
false,
dagger,
commDim,
halo_precision);
284 const double &k)
const 286 if (k!=1.0)
errorQuda(
"%s not supported for k!=1.0", __func__);
291 ApplyCoarse(out, in, x, *
Y_d, *
X_d,
kappa, parity,
true,
true,
dagger,
commDim,
halo_precision);
293 ApplyCoarse(out, in, x, *
Y_h, *
X_h,
kappa, parity,
true,
true,
dagger,
commDim,
halo_precision);
304 ApplyCoarse(out, in, in, *
Y_d, *
X_d,
kappa,
QUDA_INVALID_PARITY,
true,
true,
dagger,
commDim,
halo_precision);
306 ApplyCoarse(out, in, in, *
Y_h, *
X_h,
kappa,
QUDA_INVALID_PARITY,
true,
true,
dagger,
commDim,
halo_precision);
328 errorQuda(
"Preconditioned solution requires a preconditioned solve_type");
347 CoarseCoarseOp(Y, X, T, *(this->
Y_h), *(this->
X_h), *(this->
Xinv_h), kappa, a, mu_factor,
QUDA_COARSE_DIRAC,
351 CoarseCoarseOp(Y, X, T, *(this->
Y_d), *(this->
X_d), *(this->
Xinv_d), kappa, a, mu_factor,
QUDA_COARSE_DIRAC,
373 ApplyCoarse(out, in, in, *
Yhat_d, *
X_d,
kappa, parity,
true,
false,
dagger,
commDim,
halo_precision);
375 ApplyCoarse(out, in, in, *
Yhat_h, *
X_h,
kappa, parity,
true,
false,
dagger,
commDim,
halo_precision);
387 blas::xpay(const_cast<ColorSpinorField&>(x), k, out);
399 errorQuda(
"Cannot apply preconditioned operator to full field (subsets = %d %d %d)",
478 blas::xpay(const_cast<ColorSpinorField&>(b.
Odd()), -1.0, *src);
529 CoarseCoarseOp(Y, X, T, *(this->
Yhat_h), *(this->
X_h), *(this->
Xinv_h), kappa, a, -mu_factor,
QUDA_COARSEPC_DIRAC,
533 CoarseCoarseOp(Y, X, T, *(this->
Yhat_d), *(this->
X_d), *(this->
Xinv_d), kappa, a, -mu_factor,
QUDA_COARSEPC_DIRAC,
QudaGhostExchange ghostExchange
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, const int *commDim=0, QudaPrecision halo_precision=QUDA_INVALID_PRECISION)
Apply the coarse dslash stencil. This single driver accounts for all variations with and without the ...
void prepare(ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType) const
void CoarseCoarseOp(GaugeField &Y, GaugeField &X, const Transfer &T, const GaugeField &gauge, const GaugeField &clover, const GaugeField &cloverInv, double kappa, double mu, double mu_factor, QudaDiracType dirac, QudaMatPCType matpc, bool need_bidirectional)
Coarse operator construction from an intermediate-grid operator (Coarse)
virtual void createCoarseOp(GaugeField &Y, GaugeField &X, const Transfer &T, double kappa, double mass=0., double mu=0., double mu_factor=0.) const
Create the coarse operator (virtual parent)
void CloverInv(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
Apply the inverse coarse clover operator.
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)
const ColorSpinorField & Even() const
void deleteTmp(ColorSpinorField **, const bool &reset) const
const ColorSpinorField & Odd() 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)
const bool need_bidirectional
void createPreconditionedCoarseOp(GaugeField &Yhat, GaugeField &Xinv, const GaugeField &Y, const GaugeField &X)
Create the precondtioned coarse operator.
void createY(bool gpu=true, bool mapped=false) const
Allocate the Y and X fields.
void createCoarseOp(GaugeField &Y, GaugeField &X, const Transfer &T, double kappa, double mass, double mu, double mu_factor=0.) const
Create the coarse operator from this coarse operator.
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
virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const
QudaSiteSubset siteSubset
void createCoarseOp(GaugeField &Y, GaugeField &X, const Transfer &T, double kappa, double mass, 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.
void xpay(ColorSpinorField &x, double a, ColorSpinorField &y)
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
int commDim[QUDA_MAX_DIM]
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
const Transfer * transfer
void copy(const GaugeField &src)
void initializeCoarse()
Initialize the coarse gauge fields. Location is determined by gpu_setup variable. ...
QudaSiteSubset SiteSubset() const
QudaGaugeFieldOrder order
#define checkLocation(...)
enum QudaSolutionType_s QudaSolutionType
enum QudaParity_s QudaParity
void calculateYhat(GaugeField &Yhat, GaugeField &Xinv, const GaugeField &Y, const GaugeField &X)
Calculate preconditioned coarse links and coarse clover inverse field.
QudaPrecision halo_precision
DiracCoarsePC(const DiracParam ¶m, bool gpu_setup=true)
const int * Geo_bs() const
void Mdag(ColorSpinorField &out, const ColorSpinorField &in) const
QudaPrecision NullPrecision(QudaFieldLocation location) const
The precision of the packed null-space vectors.
enum QudaFieldLocation_s QudaFieldLocation
void setPrecision(QudaPrecision precision, bool force_native=false)
Helper function for setting the precision and corresponding field order for QUDA internal fields...
cpuColorSpinorField * out
virtual void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const
QudaTwistFlavorType TwistFlavor() const
double mu_factor[QUDA_MAX_MG_LEVEL]
QudaReconstructType reconstruct
void initializeLazy(QudaFieldLocation location) const
Create the CPU or GPU coarse gauge fields on demand (requires that the fields have been created in th...
#define QUDA_MAX_DIM
Maximum number of dimensions supported by QUDA. In practice, no routines make use of more than 5...
QudaFieldGeometry geometry
virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const
Apply the full operator.
void createYhat(bool gpu=true) const
Allocate the Yhat and Xinv fields.
void copy(const GaugeField &src)
QudaPrecision Precision() const
const ColorSpinorField & Vectors(QudaFieldLocation location=QUDA_INVALID_FIELD_LOCATION) const
DiracCoarse(const DiracParam ¶m, bool gpu_setup=true, bool mapped=false)