From ff1fa988085ae868ae603fe9562968b3dcd57da2 Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Thu, 21 Jan 2021 21:38:23 -0500 Subject: [PATCH] Fix for GPU conserveed current --- Grid/qcd/action/fermion/WilsonImpl.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Grid/qcd/action/fermion/WilsonImpl.h b/Grid/qcd/action/fermion/WilsonImpl.h index 52e1ee00..d7941d1f 100644 --- a/Grid/qcd/action/fermion/WilsonImpl.h +++ b/Grid/qcd/action/fermion/WilsonImpl.h @@ -106,11 +106,15 @@ public: const _SpinorField & phi, int mu) { + const int Nsimd = SiteHalfSpinor::Nsimd(); autoView( out_v, out, AcceleratorWrite); autoView( phi_v, phi, AcceleratorRead); autoView( Umu_v, Umu, AcceleratorRead); - accelerator_for(sss,out.Grid()->oSites(),1,{ - multLink(out_v[sss],Umu_v[sss],phi_v[sss],mu); + typedef decltype(coalescedRead(out_v[0])) calcSpinor; + accelerator_for(sss,out.Grid()->oSites(),Nsimd,{ + calcSpinor tmp; + multLink(tmp,Umu_v[sss],phi_v(sss),mu); + coalescedWrite(out_v[sss],tmp); }); }