mirror of
https://github.com/paboyle/Grid.git
synced 2026-10-09 01:08:06 +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:
1 parent
f39c2a240b
commit
1a4c8c3387
78 files changed
+773
-778
No files matched your search
@@ -130,11 +130,13 @@ void benchDw(std::vector<int> & latt4, int Ls, int threads,int report )
|
||||
LatticeGaugeField Umu5d(FGrid);
|
||||
|
||||
// replicate across fifth dimension
|
||||
auto Umu5d_v = Umu5d.View(CpuWrite);
|
||||
auto Umu_v = Umu.View(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];
|
||||
{
|
||||
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];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user