1 #include <gauge_field.h>
2 #include <color_spinor_field.h>
6 #include <dslash_policy.cuh>
7 #include <kernels/dslash_wilson.cuh>
10 This is the basic gauged Wilson operator
18 template <typename Arg> class Wilson : public Dslash<wilson, Arg>
20 using Dslash = Dslash<wilson, Arg>;
23 Wilson(Arg &arg, const ColorSpinorField &out, const ColorSpinorField &in) : Dslash(arg, out, in) {}
25 void apply(const qudaStream_t &stream)
27 TuneParam tp = tuneLaunch(*this, getTuning(), getVerbosity());
29 Dslash::template instantiate<packShmem>(tp, stream);
33 template <typename Float, int nColor, QudaReconstructType recon> struct WilsonApply {
35 inline WilsonApply(ColorSpinorField &out, const ColorSpinorField &in, const GaugeField &U, double a,
36 const ColorSpinorField &x, int parity, bool dagger, const int *comm_override, TimeProfile &profile)
38 constexpr int nDim = 4;
39 WilsonArg<Float, nColor, nDim, recon> arg(out, in, U, a, x, parity, dagger, comm_override);
40 Wilson<decltype(arg)> wilson(arg, out, in);
42 dslash::DslashPolicyTune<decltype(wilson)> policy(
43 wilson, const_cast<cudaColorSpinorField *>(static_cast<const cudaColorSpinorField *>(&in)), in.VolumeCB(),
44 in.GhostFaceCB(), profile);
49 // Apply the Wilson operator
50 // out(x) = M*in = - a*\sum_mu U_{-\mu}(x)in(x+mu) + U^\dagger_mu(x-mu)in(x-mu)
51 // Uses the a normalization for the Wilson operator.
52 void ApplyWilson(ColorSpinorField &out, const ColorSpinorField &in, const GaugeField &U, double a,
53 const ColorSpinorField &x, int parity, bool dagger, const int *comm_override, TimeProfile &profile)
55 #ifdef GPU_WILSON_DIRAC
56 instantiate<WilsonApply, WilsonReconstruct>(out, in, U, a, x, parity, dagger, comm_override, profile);
58 errorQuda("Wilson dslash has not been built");
59 #endif // GPU_WILSON_DIRAC