10 template <
typename Float,
int nColor, QudaReconstructType reconstruct_,
bool dynamic_clover_>
25 WilsonArg<Float,
nColor, reconstruct_>(out, in, U, xpay ? 1.0 : 0.0, x, parity, dagger, comm_override),
27 A2inv(A, dynamic_clover ? false : true),
29 b(dagger ? -0.5 * b : 0.5 * b)
39 template <
typename Float,
int nDim,
int nColor,
int nParity,
bool dagger,
bool xpay, KernelType kernel_type,
typename Arg>
42 using namespace linalg;
52 int x_cb = getCoords<nDim, QUDA_4D_PC, kernel_type>(coord,
arg, idx,
parity, thread_dim);
59 applyWilson<Float, nDim, nColor, nParity, dagger, kernel_type>(
60 out,
arg, coord, x_cb, 0,
parity, idx, thread_dim, active);
64 Vector
x = arg.out(x_cb, my_spinor_parity);
68 if (isComplete<kernel_type>(arg, coord) && active) {
74 for (
int chirality = 0; chirality < 2; chirality++) {
76 const complex<real>
b(0.0, chirality == 0 ? static_cast<real>(arg.b) : -static_cast<real>(arg.b));
77 Mat A = arg.A(x_cb, parity, chirality);
78 HalfVector chi = out.chiral_project(chirality);
79 chi = A * chi + b * chi;
81 if (arg.dynamic_clover) {
83 A2 += b.imag() * b.imag();
85 chi = cholesky.backward(cholesky.forward(chi));
86 tmp +=
static_cast<real
>(0.25) * chi.chiral_reconstruct(chirality);
88 Mat A2inv = arg.A2inv(x_cb, parity, chirality);
90 tmp +=
static_cast<real
>(2.0) * chi.chiral_reconstruct(chirality);
97 Vector
x = arg.x(x_cb, my_spinor_parity);
98 out = x + arg.a *
tmp;
108 template <
typename Float,
int nDim,
int nColor,
int nParity,
bool dagger,
bool xpay, KernelType kernel_type,
typename Arg>
116 for (
int x_cb = 0; x_cb < arg.threads; x_cb++) {
117 twistedClover<Float, nDim, nColor, nParity, dagger, xpay, kernel_type>(
arg, x_cb,
parity);
123 template <
typename Float,
int nDim,
int nColor,
int nParity,
bool dagger,
bool xpay, KernelType kernel_type,
typename Arg>
126 int x_cb = blockIdx.x * blockDim.x + threadIdx.x;
127 if (x_cb >= arg.threads)
return;
130 int parity =
nParity == 2 ? blockDim.z * blockIdx.z + threadIdx.z : arg.parity;
133 case 0: twistedClover<Float, nDim, nColor, nParity, dagger, xpay, kernel_type>(
arg, x_cb, 0);
break;
134 case 1: twistedClover<Float, nDim, nColor, nParity, dagger, xpay, kernel_type>(
arg, x_cb, 1);
break;
clover_mapper< Float, length >::type C
mapper< Float >::type real
cudaColorSpinorField * tmp
__global__ void twistedCloverPreconditionedGPU(Arg arg)
void Mat(sFloat *out, gFloat **link, sFloat *in, int daggerBit, int mu)
Main header file for host and device accessors to CloverFields.
__device__ __host__ void twistedClover(Arg &arg, int idx, int parity)
Apply the preconditioned twisted-clover dslash.
Parameter structure for driving the Wilson operator.
Specialized container for Hermitian matrices (e.g., used for wrapping clover matrices) ...
void twistedCloverPreconditionedCPU(Arg arg)
static constexpr bool dynamic_clover
__host__ __device__ ValueType arg(const complex< ValueType > &z)
Returns the phase angle of z.
static constexpr int nSpin
TwistedCloverArg(ColorSpinorField &out, const ColorSpinorField &in, const GaugeField &U, const CloverField &A, double a, double b, bool xpay, const ColorSpinorField &x, int parity, bool dagger, const int *comm_override)
static constexpr int length