21 template <
typename Float,
int nDim,
int nColor,
int nParity,
bool dagger,
bool xpay, KernelType kernel_type,
typename Arg>
23 static constexpr
const char *
kernel =
"quda::wilsonCloverPreconditionedGPU";
24 template <
typename Dslash>
27 static_assert(nParity == 1,
"preconditioned wilson-clover operator only defined for nParity=1");
30 kernel_type,
Arg >, tp, arg, stream);
43 Dslash<Float>(arg, out, in,
"kernels/dslash_wilson_clover_preconditioned.cuh"),
61 errorQuda(
"Preconditioned Wilson-clover operator not defined nParity=%d", arg.
nParity);
67 int clover_flops = 504;
69 switch (arg.kernel_type) {
79 flops += clover_flops * in.
Volume();
83 long long ghost_sites = 0;
84 for (
int d = 0; d < 4; d++)
85 if (arg.commDim[d]) ghost_sites += 2 * in.
GhostFace()[d];
86 flops -= clover_flops * ghost_sites;
96 int clover_bytes = 72 * in.
Precision() + (isFixed ? 2 *
sizeof(float) : 0);
99 switch (arg.kernel_type) {
109 bytes += clover_bytes * in.
Volume();
113 long long ghost_sites = 0;
114 for (
int d = 0; d < 4; d++)
115 if (arg.commDim[d]) ghost_sites += 2 * in.
GhostFace()[d];
116 bytes -= clover_bytes * ghost_sites;
136 constexpr
int nDim = 4;
137 #ifdef DYNAMIC_CLOVER 138 constexpr
bool dynamic_clover =
true;
140 constexpr
bool dynamic_clover =
false;
142 WilsonCloverArg<Float, nColor, recon, dynamic_clover> arg(out, in, U, A, a, x, parity, dagger, comm_override);
147 const_cast<cudaColorSpinorField *>(static_cast<const cudaColorSpinorField *>(&in)), in.
VolumeCB(),
162 #ifdef GPU_CLOVER_DIRAC 163 if (in.
V() == out.
V())
errorQuda(
"Aliasing pointers");
173 instantiate<WilsonCloverPreconditionedApply>(
out,
in, U, A, a, x,
parity,
dagger, comm_override, profile);
175 errorQuda(
"Clover dslash has not been built");
void launch(T *f, const TuneParam &tp, Arg &arg, const cudaStream_t &stream)
static void launch(Dslash &dslash, TuneParam &tp, Arg &arg, const cudaStream_t &stream)
static constexpr const char * kernel
void apply(const cudaStream_t &stream)
WilsonCloverPreconditionedApply(ColorSpinorField &out, const ColorSpinorField &in, const GaugeField &U, const CloverField &A, double a, const ColorSpinorField &x, int parity, bool dagger, const int *comm_override, TimeProfile &profile)
QudaVerbosity getVerbosity()
#define checkPrecision(...)
void ApplyWilsonCloverPreconditioned(ColorSpinorField &out, const ColorSpinorField &in, const GaugeField &U, const CloverField &A, double kappa, const ColorSpinorField &x, int parity, bool dagger, const int *comm_override, TimeProfile &profile)
Driver for applying the preconditioned Wilson-clover stencil.
const char * VolString() const
void xpay(ColorSpinorField &x, double a, ColorSpinorField &y)
virtual long long bytes() const
__device__ __host__ void wilson(Arg &arg, int idx, int s, int parity)
void apply(const cudaStream_t &stream)
This is a helper class that is used to instantiate the correct templated kernel for the dslash...
const int * GhostFaceCB() const
TuneParam & tuneLaunch(Tunable &tunable, QudaTune enabled, QudaVerbosity verbosity)
#define checkLocation(...)
virtual ~WilsonCloverPreconditioned()
cpuColorSpinorField * out
__global__ void wilsonCloverPreconditionedGPU(Arg arg)
__host__ __device__ ValueType arg(const complex< ValueType > &z)
Returns the phase angle of z.
const int * GhostFace() const
virtual long long flops() const
QudaTune getTuning()
Query whether autotuning is enabled or not. Default is enabled but can be overridden by setting QUDA_...
QudaPrecision Precision() const
const ColorSpinorField & in
QudaFieldOrder FieldOrder() const
WilsonCloverPreconditioned(Arg &arg, const ColorSpinorField &out, const ColorSpinorField &in)