From 57552d8ca38ce44c549cd06644149cafac55ec7e Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Fri, 5 Apr 2024 01:05:12 -0400 Subject: [PATCH] Assign from non-lattice made accelerator resident --- Grid/lattice/Lattice_base.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Grid/lattice/Lattice_base.h b/Grid/lattice/Lattice_base.h index c293a3e1..1aefd9c1 100644 --- a/Grid/lattice/Lattice_base.h +++ b/Grid/lattice/Lattice_base.h @@ -234,9 +234,12 @@ public: } template inline Lattice & operator = (const sobj & r){ - auto me = View(CpuWrite); - thread_for(ss,me.size(),{ - me[ss]= r; + vobj vtmp; + vtmp = r; + auto me = View(AcceleratorWrite); + accelerator_for(ss,me.size(),vobj::Nsimd(),{ + auto stmp=coalescedRead(vtmp); + coalescedWrite(me[ss],stmp); }); me.ViewClose(); return *this;