1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-12 16:55:37 +00:00

Assign from non-lattice made accelerator resident

This commit is contained in:
Peter Boyle 2024-04-05 01:05:12 -04:00
parent 13713b2a76
commit 57552d8ca3

View File

@ -234,9 +234,12 @@ public:
} }
template<class sobj> inline Lattice<vobj> & operator = (const sobj & r){ template<class sobj> inline Lattice<vobj> & operator = (const sobj & r){
auto me = View(CpuWrite); vobj vtmp;
thread_for(ss,me.size(),{ vtmp = r;
me[ss]= r; auto me = View(AcceleratorWrite);
accelerator_for(ss,me.size(),vobj::Nsimd(),{
auto stmp=coalescedRead(vtmp);
coalescedWrite(me[ss],stmp);
}); });
me.ViewClose(); me.ViewClose();
return *this; return *this;