10 template <
typename Float,
int nColor, QudaReconstructType reconstruct_,
bool dynamic_clover_>
11 struct WilsonCloverArg : WilsonArg<Float, nColor, reconstruct_> {
24 WilsonArg<Float,
nColor, reconstruct_>(out, in, U, a, x, parity, dagger, comm_override),
25 A(A, dynamic_clover ? false : true),
36 template <
typename Float,
int nDim,
int nColor,
int nParity,
bool dagger,
bool xpay, KernelType kernel_type,
typename Arg>
39 using namespace linalg;
48 int x_cb = getCoords<nDim, QUDA_4D_PC, kernel_type>(coord,
arg, idx,
parity, thread_dim);
55 applyWilson<Float, nDim, nColor, nParity, dagger, kernel_type>(
56 out,
arg, coord, x_cb, 0,
parity, idx, thread_dim, active);
60 Vector
x = arg.out(x_cb, my_spinor_parity);
64 if (isComplete<kernel_type>(arg, coord) && active) {
70 for (
int chirality = 0; chirality < 2; chirality++) {
73 HalfVector chi = out.chiral_project(chirality);
75 if (arg.dynamic_clover) {
77 chi =
static_cast<real
>(0.25) * cholesky.backward(cholesky.forward(chi));
82 tmp += chi.chiral_reconstruct(chirality);
88 Vector
x = arg.x(x_cb, my_spinor_parity);
89 out = x + arg.a *
tmp;
99 template <
typename Float,
int nDim,
int nColor,
int nParity,
bool dagger,
bool xpay, KernelType kernel_type,
typename Arg>
107 for (
int x_cb = 0; x_cb < arg.threads; x_cb++) {
108 wilsonClover<Float, nDim, nColor, nParity, dagger, xpay, kernel_type>(
arg, x_cb,
parity);
114 template <
typename Float,
int nDim,
int nColor,
int nParity,
bool dagger,
bool xpay, KernelType kernel_type,
typename Arg>
117 int x_cb = blockIdx.x * blockDim.x + threadIdx.x;
118 if (x_cb >= arg.threads)
return;
121 int parity =
nParity == 2 ? blockDim.z * blockIdx.z + threadIdx.z : arg.parity;
124 case 0: wilsonClover<Float, nDim, nColor, nParity, dagger, xpay, kernel_type>(
arg, x_cb, 0);
break;
125 case 1: wilsonClover<Float, nDim, nColor, nParity, dagger, xpay, kernel_type>(
arg, x_cb, 1);
break;
static constexpr bool dynamic_clover
cudaColorSpinorField * tmp
clover_mapper< Float, length >::type C
Main header file for host and device accessors to CloverFields.
Parameter structure for driving the Wilson operator.
__device__ __host__ void wilsonClover(Arg &arg, int idx, int parity)
Apply the Wilson-clover dslash out(x) = M*in = A(x)*x(x) + D * in(x-mu) Note this routine only exists...
Specialized container for Hermitian matrices (e.g., used for wrapping clover matrices) ...
void wilsonCloverPreconditionedCPU(Arg arg)
WilsonCloverArg(ColorSpinorField &out, const ColorSpinorField &in, const GaugeField &U, const CloverField &A, double a, const ColorSpinorField &x, int parity, bool dagger, const int *comm_override)
static constexpr int length
__global__ void wilsonCloverPreconditionedGPU(Arg arg)
mapper< Float >::type real
__host__ __device__ ValueType arg(const complex< ValueType > &z)
Returns the phase angle of z.
static constexpr int nSpin