12 transfer(
param.transfer),
14 need_bidirectional(
param.need_bidirectional),
15 use_mma(
param.use_mma),
31 if (
gpu_setup ==
false)
errorQuda(
"CPU setup of the coarse Dirac operator is disabled");
46 need_bidirectional(false),
47 use_mma(
param.use_mma),
56 enable_gpu(
Y_d ? true : false),
57 enable_cpu(
Y_h ? true : false),
59 init_gpu(enable_gpu ? false : true),
60 init_cpu(enable_cpu ? false : true),
71 transfer(
param.transfer),
73 need_bidirectional(
param.need_bidirectional),
74 use_mma(
param.use_mma),
83 enable_gpu(
dirac.enable_gpu),
84 enable_cpu(
dirac.enable_cpu),
85 gpu_setup(
dirac.gpu_setup),
86 init_gpu(enable_gpu ? false : true),
87 init_cpu(enable_cpu ? false : true),
121 gParam.nColor = Nc_c*Ns_c;
136 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 } );
163 gParam.nColor = Nc_c*Ns_c;
177 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 } );
223 Y_param.
order = gOrder;
224 X_param.
order = gOrder;
325 if (&in == &out)
errorQuda(
"Fields cannot alias");
329 ApplyCoarse(out, in, in, *
Y_d, *
X_d,
kappa,
parity,
false,
true,
dagger,
commDim);
331 ApplyCoarse(out, in, in, *
Y_h, *
X_h,
kappa,
parity,
false,
true,
dagger,
commDim);
339 if (&in == &out)
errorQuda(
"Fields cannot alias");
343 ApplyCoarse(out, in, in, *
Y_d, *
Xinv_d,
kappa,
parity,
false,
true,
dagger,
commDim);
345 ApplyCoarse(out, in, in, *
Y_h, *
Xinv_h,
kappa,
parity,
false,
true,
dagger,
commDim);
357 ApplyCoarse(out, in, in, *
Y_d, *
X_d,
kappa,
parity,
true,
false,
dagger,
commDim,
halo_precision);
359 ApplyCoarse(out, in, in, *
Y_h, *
X_h,
kappa,
parity,
true,
false,
dagger,
commDim,
halo_precision);
367 const double &k)
const
369 if (k!=1.0)
errorQuda(
"%s not supported for k!=1.0", __func__);
374 ApplyCoarse(out, in, x, *
Y_d, *
X_d,
kappa,
parity,
true,
true,
dagger,
commDim,
halo_precision);
376 ApplyCoarse(out, in, x, *
Y_h, *
X_h,
kappa,
parity,
true,
true,
dagger,
commDim,
halo_precision);
387 ApplyCoarse(out, in, in, *
Y_d, *
X_d,
kappa,
QUDA_INVALID_PARITY,
true,
true,
dagger,
commDim,
halo_precision);
389 ApplyCoarse(out, in, in, *
Y_h, *
X_h,
kappa,
QUDA_INVALID_PARITY,
true,
true,
dagger,
commDim,
halo_precision);
411 errorQuda(
"Preconditioned solution requires a preconditioned solve_type");
428 errorQuda(
"Coarse operators only support aggregation coarsening");
433 CoarseCoarseOp(Y, X, T, *(this->
Y_h), *(this->
X_h), *(this->
Xinv_h), kappa,
mass, a,
mu_factor,
QUDA_COARSE_DIRAC,
437 CoarseCoarseOp(Y, X, T, *(this->
Y_d), *(this->
X_d), *(this->
Xinv_d), kappa,
mass, a,
mu_factor,
QUDA_COARSE_DIRAC,
466 ApplyCoarse(out, in, in, *
Yhat_d, *
X_d,
kappa,
parity,
true,
false,
dagger,
commDim,
halo_precision);
468 ApplyCoarse(out, in, in, *
Yhat_h, *
X_h,
kappa,
parity,
true,
false,
dagger,
commDim,
halo_precision);
492 errorQuda(
"Cannot apply preconditioned operator to full field (subsets = %d %d %d)",
650 errorQuda(
"Coarse operators only support aggregation coarsening");
655 CoarseCoarseOp(Y, X, T, *(this->
Yhat_h), *(this->
X_h), *(this->
Xinv_h), kappa,
mass, a, -
mu_factor,
659 CoarseCoarseOp(Y, X, T, *(this->
Yhat_d), *(this->
X_d), *(this->
Xinv_d), kappa,
mass, a, -
mu_factor,
const ColorSpinorField & Odd() const
QudaTwistFlavorType TwistFlavor() const
QudaSiteSubset SiteSubset() const
const ColorSpinorField & Even() const
void Clover(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
Apply the coarse clover operator.
double MuFactor() const
accessor for mu factoo for MG/ – override can return a better value
virtual void Dslash(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
Apply DslashXpay out = (D * in)
void createPreconditionedCoarseOp(GaugeField &Yhat, GaugeField &Xinv, const GaugeField &Y, const GaugeField &X)
Create the precondtioned coarse operator.
void createYhat(bool gpu=true) const
Allocate the Yhat and Xinv fields.
virtual void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const
virtual void prepare(ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType) const
const Transfer * transfer
void createY(bool gpu=true, bool mapped=false) const
Allocate the Y and X fields.
double Mu() const
accessor for twist parameter – overrride can return better value
virtual void M(ColorSpinorField &out, const ColorSpinorField &in) const
Apply the full operator.
void initializeLazy(QudaFieldLocation location) const
Create the CPU or GPU coarse gauge fields on demand (requires that the fields have been created in th...
virtual void prefetch(QudaFieldLocation mem_space, qudaStream_t stream=0) const
If managed memory and prefetch is enabled, prefetch all relevant memory fields (X,...
void CloverInv(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
Apply the inverse coarse clover operator.
virtual void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const
Apply MdagM operator which may be optimized.
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.
const bool need_bidirectional
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 initializeCoarse()
Initialize the coarse gauge fields. Location is determined by gpu_setup variable.
DiracCoarse(const DiracParam ¶m, bool gpu_setup=true, bool mapped=false)
void M(ColorSpinorField &out, const ColorSpinorField &in) const
Apply the full operator.
void DslashXpay(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity, const ColorSpinorField &x, const double &k) const
Apply DslashXpay out = (D * in + A * x)
DiracCoarsePC(const DiracParam ¶m, bool gpu_setup=true)
void prepare(ColorSpinorField *&src, ColorSpinorField *&sol, ColorSpinorField &x, ColorSpinorField &b, const QudaSolutionType) const
void Dslash(ColorSpinorField &out, const ColorSpinorField &in, const QudaParity parity) const
Apply DslashXpay out = (D * in)
virtual void prefetch(QudaFieldLocation mem_space, qudaStream_t stream=0) const
If managed memory and prefetch is enabled, prefetch all relevant memory fields (Xhat,...
void MdagM(ColorSpinorField &out, const ColorSpinorField &in) const
Apply MdagM operator which may be optimized.
void reconstruct(ColorSpinorField &x, const ColorSpinorField &b, const QudaSolutionType) const
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,...
bool newTmp(ColorSpinorField **, const ColorSpinorField &) const
virtual bool isCoarse() const
Whether the Dirac object is the DiracCoarse.
virtual void prefetch(QudaFieldLocation mem_space, qudaStream_t stream=0) const
If managed memory and prefetch is enabled, prefetch the gauge field and temporary spinors to the CPU ...
QudaPrecision halo_precision
void deleteTmp(ColorSpinorField **, const bool &reset) const
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)
virtual void checkFullSpinor(const ColorSpinorField &, const ColorSpinorField &) const
check full spinors are compatible (check geometry ?)
int commDim[QUDA_MAX_DIM]
void Mdag(ColorSpinorField &out, const ColorSpinorField &in) const
Apply Mdag (daggered operator of M.
static GaugeField * Create(const GaugeFieldParam ¶m)
Create the gauge field, with meta data specified in the parameter struct.
QudaPrecision Precision() const
const int * Geo_bs() const
QudaPrecision NullPrecision(QudaFieldLocation location) const
The precision of the packed null-space vectors.
QudaTransferType getTransferType() const
const ColorSpinorField & Vectors(QudaFieldLocation location=QUDA_INVALID_FIELD_LOCATION) const
void copy(const GaugeField &src)
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...
void exchangeGhost(QudaLinkDirection link_direction=QUDA_LINK_BACKWARDS)
Exchange the ghost and store store in the padded region.
quda::mgarray< double > mu_factor
@ QUDA_CUDA_FIELD_LOCATION
@ QUDA_CPU_FIELD_LOCATION
@ QUDA_LINK_BIDIRECTIONAL
enum QudaGaugeFieldOrder_s QudaGaugeFieldOrder
@ QUDA_TRANSFER_AGGREGATE
enum QudaSolutionType_s QudaSolutionType
enum QudaFieldLocation_s QudaFieldLocation
@ QUDA_GHOST_EXCHANGE_PAD
@ QUDA_MATPC_ODD_ODD_ASYMMETRIC
@ QUDA_MATPC_EVEN_EVEN_ASYMMETRIC
@ QUDA_MATPCDAG_MATPC_SOLUTION
@ QUDA_FLOAT2_GAUGE_ORDER
enum QudaParity_s QudaParity
#define checkLocation(...)
void xpay(ColorSpinorField &x, double a, ColorSpinorField &y)
void axpy(double a, ColorSpinorField &x, ColorSpinorField &y)
void saveTuneCache(bool error=false)
void calculateYhat(GaugeField &Yhat, GaugeField &Xinv, const GaugeField &Y, const GaugeField &X, bool use_mma=false)
Calculate preconditioned coarse links and coarse clover inverse field.
void CoarseCoarseOp(GaugeField &Y, GaugeField &X, const Transfer &T, const GaugeField &gauge, const GaugeField &clover, const GaugeField &cloverInv, double kappa, double mass, double mu, double mu_factor, QudaDiracType dirac, QudaMatPCType matpc, bool need_bidirectional, bool use_mma=false)
Coarse operator construction from an intermediate-grid operator (Coarse)
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 ...
cudaStream_t qudaStream_t
#define QUDA_MAX_DIM
Maximum number of dimensions supported by QUDA. In practice, no routines make use of more than 5.
QudaGaugeFieldOrder order
QudaVerbosity getVerbosity()