From 595f512a6e9e8191ac6933d401e2e030580c6dd3 Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Thu, 3 Sep 2020 22:07:40 -0400 Subject: [PATCH] G5 for coarse space too --- Grid/qcd/utils/LinalgUtils.h | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/Grid/qcd/utils/LinalgUtils.h b/Grid/qcd/utils/LinalgUtils.h index 1e016e4e..964b83d5 100644 --- a/Grid/qcd/utils/LinalgUtils.h +++ b/Grid/qcd/utils/LinalgUtils.h @@ -154,8 +154,8 @@ void axpby_ssp_pminus(Lattice &z,Coeff a,const Lattice &x,Coeff b,co accelerator_for(sss,nloop,vobj::Nsimd(),{ uint64_t ss = sss*Ls; decltype(coalescedRead(y_v[ss+sp])) tmp; - spProj5m(tmp,y_v(ss+sp)); - tmp = a*x_v(ss+s)+b*tmp; + spProj5m(tmp,y_v(ss+sp)); + tmp = a*x_v(ss+s)+b*tmp; coalescedWrite(z_v[ss+s],tmp); }); } @@ -188,7 +188,6 @@ void G5R5(Lattice &z,const Lattice &x) z.Checkerboard() = x.Checkerboard(); conformable(x,z); int Ls = grid->_rdimensions[0]; - Gamma G5(Gamma::Algebra::Gamma5); autoView( x_v, x, AcceleratorRead); autoView( z_v, z, AcceleratorWrite); uint64_t nloop = grid->oSites()/Ls; @@ -196,7 +195,13 @@ void G5R5(Lattice &z,const Lattice &x) uint64_t ss = sss*Ls; for(int s=0;s &z, const Lattice &x) z.Checkerboard() = x.Checkerboard(); conformable(x, z); - Gamma G5(Gamma::Algebra::Gamma5); - z = G5 * x; + autoView( x_v, x, AcceleratorRead); + autoView( z_v, z, AcceleratorWrite); + uint64_t nloop = grid->oSites(); + accelerator_for(ss,nloop,vobj::Nsimd(),{ + auto tmp = x_v(ss); + decltype(tmp) tmp_p; + decltype(tmp) tmp_m; + spProj5p(tmp_p,tmp); + spProj5m(tmp_m,tmp); + coalescedWrite(z_v[ss],tmp_p - tmp_m); + }); } +/* template void G5C(Lattice> &z, const Lattice> &x) { @@ -234,6 +249,7 @@ void G5C(Lattice> &z, const Lattice