1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-06-15 06:17:05 +01:00

Global edit with change to View usage. autoView() creates a wrapper object that closes the view when scope closes.

This commit is contained in:
Peter Boyle
2020-06-05 18:52:35 -04:00
parent f39c2a240b
commit 1a4c8c3387
78 changed files with 773 additions and 778 deletions

View File

@ -570,8 +570,8 @@ void TestConserved1(Action & Ddwf, Action & Ddwfrev,
LatticeGaugeField Umu5d(FGrid);
std::vector<LatticeColourMatrix> U(4,FGrid);
{
auto Umu5d_v = Umu5d.View(CpuWrite);
auto Umu_v = Umu.View(CpuRead);
autoView( Umu5d_v , Umu5d, CpuWrite);
autoView( Umu_v , Umu , CpuRead);
for(int ss=0;ss<Umu.Grid()->oSites();ss++){
for(int s=0;s<Ls;s++){
Umu5d_v[Ls*ss+s] = Umu_v[ss];
@ -597,8 +597,8 @@ void TestConserved1(Action & Ddwf, Action & Ddwfrev,
{
RealD diag = 5.0 - Ddwf.M5;
mass = Ddwf.mass;
auto psi=result5.View(CpuRead);
auto chi=tmp.View(CpuWrite);
autoView( psi,result5,CpuRead);
autoView( chi,tmp, CpuWrite);
thread_for(sss,UGrid->oSites(),{
uint64_t ss= sss*Ls;
typedef vSpinColourVector spinor;