1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-06-18 07:47: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:
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

@ -109,8 +109,8 @@ int main(int argc, char ** argv) {
StencilEntry *SE;
SE = myStencil.GetEntry(permute_type,0,i);
auto check = Check.View(CpuWrite);
auto foo = Foo.View(CpuRead);
autoView( check , Check, CpuWrite);
autoView( foo , Foo, CpuRead);
if ( SE->_is_local && SE->_permute )
permute(check[i],foo[SE->_offset],permute_type);
else if (SE->_is_local)
@ -151,8 +151,8 @@ int main(int argc, char ** argv) {
}}}}
if (nrm > 1.0e-4) {
auto check = Check.View(CpuRead);
auto bar = Bar.View(CpuRead);
autoView( check , Check, CpuRead);
autoView( bar , Bar, CpuRead);
for(int i=0;i<check.size();i++){
std::cout << i<<" Check "<<check[i]<< "\n"<<i<<" Bar "<<bar[i]<<std::endl;
}
@ -210,8 +210,8 @@ int main(int argc, char ** argv) {
SE = EStencil.GetEntry(permute_type,0,i);
// std::cout << "Even source "<< i<<" -> " <<SE->_offset << " "<< SE->_is_local<<std::endl;
auto ocheck = OCheck.View(CpuWrite);
auto efoo = EFoo.View(CpuRead);
autoView( ocheck , OCheck, CpuWrite);
autoView( efoo , EFoo, CpuRead);
if ( SE->_is_local && SE->_permute )
permute(ocheck[i],efoo[SE->_offset],permute_type);
else if (SE->_is_local)
@ -226,8 +226,8 @@ int main(int argc, char ** argv) {
SE = OStencil.GetEntry(permute_type,0,i);
// std::cout << "ODD source "<< i<<" -> " <<SE->_offset << " "<< SE->_is_local<<std::endl;
auto echeck = ECheck.View(CpuWrite);
auto ofoo = OFoo.View(CpuRead);
autoView( echeck , ECheck, CpuWrite);
autoView( ofoo , OFoo, CpuRead);
if ( SE->_is_local && SE->_permute )
permute(echeck[i],ofoo[SE->_offset],permute_type);
else if (SE->_is_local)