20 template <
typename Float,
int nDim,
int nColor,
int nParity,
bool dagger,
bool xpay, KernelType kernel_type,
typename Arg>
22 static constexpr
const char *
kernel =
"quda::twistedMassGPU";
23 template <
typename Dslash>
26 static_assert(
xpay ==
true,
"Twisted-mass operator only defined for xpay");
27 dslash.
launch(twistedMassGPU<Float, nDim, nColor, nParity, dagger, xpay, kernel_type, Arg>, tp, arg, stream);
31 template <
typename Float,
int nDim,
int nColor,
typename Arg>
class TwistedMass :
public Dslash<Float>
40 Dslash<Float>(arg, out, in,
"kernels/dslash_twisted_mass.cuh"),
55 errorQuda(
"Twisted-mass operator only defined for xpay=true");
61 switch (arg.kernel_type) {
81 template <
typename Float,
int nColor, QudaReconstructType recon>
struct TwistedMassApply {
87 constexpr
int nDim = 4;
88 TwistedMassArg<Float, nColor, recon> arg(out, in, U, a, b, x, parity, dagger, comm_override);
92 twisted, const_cast<cudaColorSpinorField *>(static_cast<const cudaColorSpinorField *>(&in)), in.
VolumeCB(),
107 #ifdef GPU_TWISTED_MASS_DIRAC 108 if (in.
V() == out.
V())
errorQuda(
"Aliasing pointers");
118 instantiate<TwistedMassApply>(
out,
in, U, a, b, x,
parity,
dagger, comm_override, profile);
120 errorQuda(
"Twisted-mass dslash has not been built");
121 #endif // GPU_TWISTED_MASS_DIRAC void launch(T *f, const TuneParam &tp, Arg &arg, const cudaStream_t &stream)
static constexpr const char * kernel
void apply(const cudaStream_t &stream)
QudaVerbosity getVerbosity()
#define checkPrecision(...)
const ColorSpinorField & in
const char * VolString() const
TwistedMassApply(ColorSpinorField &out, const ColorSpinorField &in, const GaugeField &U, double a, double b, const ColorSpinorField &x, int parity, bool dagger, const int *comm_override, TimeProfile &profile)
void xpay(ColorSpinorField &x, double a, ColorSpinorField &y)
This is a helper class that is used to instantiate the correct templated kernel for the dslash...
TwistedMass(Arg &arg, const ColorSpinorField &out, const ColorSpinorField &in)
void apply(const cudaStream_t &stream)
const int * GhostFaceCB() const
TuneParam & tuneLaunch(Tunable &tunable, QudaTune enabled, QudaVerbosity verbosity)
#define checkLocation(...)
cpuColorSpinorField * out
void ApplyTwistedMass(ColorSpinorField &out, const ColorSpinorField &in, const GaugeField &U, double a, double b, const ColorSpinorField &x, int parity, bool dagger, const int *comm_override, TimeProfile &profile)
Driver for applying the twisted-mass stencil.
static void launch(Dslash &dslash, TuneParam &tp, Arg &arg, const cudaStream_t &stream)
__host__ __device__ ValueType arg(const complex< ValueType > &z)
Returns the phase angle of z.
virtual long long flops() const
QudaTune getTuning()
Query whether autotuning is enabled or not. Default is enabled but can be overridden by setting QUDA_...
QudaFieldOrder FieldOrder() const