19 template <
typename sFloat,
typename cFloat>
23 int N =
nColor * nSpin / 2;
24 int chiralBlock = N + 2*(N-1)*N/2;
26 for (
int i=0;
i<
Vh;
i++) {
27 std::complex<sFloat> *In =
reinterpret_cast<std::complex<sFloat>*
>(&
in[
i*nSpin*
nColor*2]);
28 std::complex<sFloat> *Out =
reinterpret_cast<std::complex<sFloat>*
>(&
out[
i*nSpin*
nColor*2]);
30 for (
int chi=0; chi<nSpin/2; chi++) {
32 std::complex<cFloat> *L =
reinterpret_cast<std::complex<cFloat>*
>(&D[N]);
34 for (
int s_col=0; s_col<nSpin/2; s_col++) {
35 for (
int c_col=0; c_col<
nColor; c_col++) {
36 const int col = s_col *
nColor + c_col;
37 const int Col = chi*N + col;
40 for (
int s_row=0; s_row<nSpin/2; s_row++) {
41 for (
int c_row=0; c_row<
nColor; c_row++) {
42 const int row = s_row *
nColor + c_row;
43 const int Row = chi*N + row;
46 Out[Col] += D[row] * In[Row];
47 }
else if (col < row) {
48 int k = N*(N-1)/2 - (N-col)*(N-col-1)/2 + row - col - 1;
49 Out[Col] +=
conj(L[k]) * In[Row];
50 }
else if (row < col) {
51 int k = N*(N-1)/2 - (N-row)*(N-row-1)/2 + col - row - 1;
52 Out[Col] += L[k] * In[Row];
76 errorQuda(
"Unsupported precision %d", precision);
178 for(
int i = 0;
i <
Vh;
i++)
179 for(
int s = 0;
s < 4;
s++) {
180 double a5 = ((
s / 2) ? -1.0 : +1.0) *
a;
181 for(
int c = 0;
c < 3;
c++) {
182 ((
double *)
out)[
i * 24 +
s * 6 +
c * 2 + 0] = ((
double *) tmpH)[
i * 24 +
s * 6 +
c * 2 + 0] - a5*((
double *)
in)[
i * 24 +
s * 6 +
c * 2 + 1];
183 ((
double *)
out)[
i * 24 +
s * 6 +
c * 2 + 1] = ((
double *) tmpH)[
i * 24 +
s * 6 +
c * 2 + 1] + a5*((
double *)
in)[
i * 24 +
s * 6 +
c * 2 + 0];
188 for(
int i = 0;
i <
Vh;
i++)
189 for(
int s = 0;
s < 4;
s++) {
190 float a5 = ((
s / 2) ? -1.0 : +1.0) *
a;
191 for(
int c = 0;
c < 3;
c++) {
192 ((
float *)
out)[
i * 24 +
s * 6 +
c * 2 + 0] = ((
float *) tmpH)[
i * 24 +
s * 6 +
c * 2 + 0] - a5*((
float *)
in)[
i * 24 +
s * 6 +
c * 2 + 1];
193 ((
float *)
out)[
i * 24 +
s * 6 +
c * 2 + 1] = ((
float *) tmpH)[
i * 24 +
s * 6 +
c * 2 + 1] + a5*((
float *)
in)[
i * 24 +
s * 6 +
c * 2 + 0];
198 errorQuda(
"Unsupported precision %d", precision);
240 twistCloverGamma5(
tmp1,
in,
clover, cInv,
dagger,
kappa,
mu, flavor, 1-
parity,
QUDA_TWIST_GAMMA5_INVERSE, precision);
243 twistCloverGamma5(
out,
tmp2,
clover, cInv,
dagger,
kappa,
mu, flavor,
parity,
QUDA_TWIST_GAMMA5_INVERSE, precision);
249 twistCloverGamma5(
out,
tmp1,
clover, cInv,
dagger,
kappa,
mu, flavor,
parity,
QUDA_TWIST_GAMMA5_INVERSE, precision);
271 twistCloverGamma5(tmpOdd, inOdd,
clover, NULL,
dagger,
kappa,
mu, flavor, 1,
QUDA_TWIST_GAMMA5_DIRECT, precision);
275 twistCloverGamma5(tmpEven, inEven,
clover, NULL,
dagger,
kappa,
mu, flavor, 0,
QUDA_TWIST_GAMMA5_DIRECT, precision);
296 twistCloverGamma5(
tmp1,
out,
clover, cInv,
dagger,
kappa,
mu, flavor, 1,
QUDA_TWIST_GAMMA5_INVERSE, precision);
298 twistCloverGamma5(
out,
tmp2,
clover, cInv,
dagger,
kappa,
mu, flavor, 0,
QUDA_TWIST_GAMMA5_INVERSE, precision);
300 twistCloverGamma5(
out,
in,
clover, cInv,
dagger,
kappa,
mu, flavor, 0,
QUDA_TWIST_GAMMA5_INVERSE, precision);
302 twistCloverGamma5(
tmp2,
tmp1,
clover, cInv,
dagger,
kappa,
mu, flavor, 1,
QUDA_TWIST_GAMMA5_INVERSE, precision);
309 twistCloverGamma5(
tmp2,
tmp1,
clover, cInv,
dagger,
kappa,
mu, flavor, 1,
QUDA_TWIST_GAMMA5_INVERSE, precision);
311 twistCloverGamma5(
tmp2,
in,
clover, cInv,
dagger,
kappa,
mu, flavor, 0,
QUDA_TWIST_GAMMA5_DIRECT, precision);
317 twistCloverGamma5(
tmp1,
out,
clover, cInv,
dagger,
kappa,
mu, flavor, 0,
QUDA_TWIST_GAMMA5_INVERSE, precision);
319 twistCloverGamma5(
out,
tmp2,
clover, cInv,
dagger,
kappa,
mu, flavor, 1,
QUDA_TWIST_GAMMA5_INVERSE, precision);
321 twistCloverGamma5(
out,
in,
clover, cInv,
dagger,
kappa,
mu, flavor, 1,
QUDA_TWIST_GAMMA5_INVERSE, precision);
323 twistCloverGamma5(
tmp2,
tmp1,
clover, cInv,
dagger,
kappa,
mu, flavor, 0,
QUDA_TWIST_GAMMA5_INVERSE, precision);
330 twistCloverGamma5(
tmp2,
tmp1,
clover, cInv,
dagger,
kappa,
mu, flavor, 0,
QUDA_TWIST_GAMMA5_INVERSE, precision);
332 twistCloverGamma5(
tmp1,
in,
clover, cInv,
dagger,
kappa,
mu, flavor, 1,
QUDA_TWIST_GAMMA5_DIRECT, precision);
void xpay(ColorSpinorField &x, const double &a, ColorSpinorField &y)
enum QudaPrecision_s QudaPrecision
Matrix< N, std::complex< T > > conj(const Matrix< N, std::complex< T > > &mat)
void tmc_dslash(void *out, void **gauge, void *in, void *clover, void *cInv, double kappa, double mu, QudaTwistFlavorType flavor, int parity, QudaMatPCType matpc_type, int dagger, QudaPrecision precision, QudaGaugeParam ¶m)
cudaColorSpinorField * tmp
void clover_matpc(void *out, void **gauge, void *clover, void *clover_inv, void *in, double kappa, QudaMatPCType matpc_type, int dagger, QudaPrecision precision, QudaGaugeParam &gauge_param)
QudaGaugeParam gauge_param
void tmc_mat(void *out, void **gauge, void *clover, void *in, double kappa, double mu, QudaTwistFlavorType flavor, int dagger, QudaPrecision precision, QudaGaugeParam &gauge_param)
void apply_clover(void *out, void *clover, void *in, int parity, QudaPrecision precision)
void exit(int) __attribute__((noreturn))
void * malloc(size_t __size) __attribute__((__warn_unused_result__)) __attribute__((alloc_size(1)))
int printf(const char *,...) __attribute__((__format__(__printf__
VOLATILE spinorFloat kappa
enum QudaMatPCType_s QudaMatPCType
void clover_mat(void *out, void **gauge, void *clover, void *in, double kappa, int dagger, QudaPrecision precision, QudaGaugeParam &gauge_param)
void applyTwist(void *out, void *in, void *tmpH, double a, QudaPrecision precision)
void cloverReference(sFloat *out, cFloat *clover, sFloat *in, int parity)
Apply the clover matrix field.
void clover_dslash(void *out, void **gauge, void *clover, void *in, int parity, int dagger, QudaPrecision precision, QudaGaugeParam ¶m)
cpuColorSpinorField * out
void tmc_matpc(void *out, void **gauge, void *in, void *clover, void *cInv, double kappa, double mu, QudaTwistFlavorType flavor, QudaMatPCType matpc_type, int dagger, QudaPrecision precision, QudaGaugeParam &gauge_param)
void twistCloverGamma5(void *out, void *in, void *clover, void *cInv, const int dagger, const double kappa, const double mu, const QudaTwistFlavorType flavor, const int parity, QudaTwistGamma5Type twist, QudaPrecision precision)
enum QudaTwistGamma5Type_s QudaTwistGamma5Type
void wil_dslash(void *out, void **gauge, void *in, int oddBit, int daggerBit, QudaPrecision precision, QudaGaugeParam &gauge_param)
enum QudaTwistFlavorType_s QudaTwistFlavorType