From f999408e925eeb4cbb5a5c8b2f7002101f1913ba Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Thu, 21 May 2020 16:14:20 -0400 Subject: [PATCH] View locatoin and access mode --- tests/Test_general_stencil.cc | 8 ++++---- tests/Test_stencil.cc | 16 ++++++++-------- tests/core/Test_staggered5D.cc | 13 +++++++------ tests/debug/Test_cayley_mres.cc | 8 ++++---- tests/forces/Test_contfrac_force.cc | 6 +++--- tests/forces/Test_dwf_force.cc | 6 +++--- tests/forces/Test_dwf_force_eofa.cc | 6 +++--- tests/forces/Test_dwf_gpforce.cc | 6 +++--- tests/forces/Test_dwf_gpforce_eofa.cc | 6 +++--- tests/forces/Test_gp_plaq_force.cc | 6 +++--- tests/forces/Test_gp_rect_force.cc | 6 +++--- tests/forces/Test_gpdwf_force.cc | 6 +++--- tests/forces/Test_gpwilson_force.cc | 6 +++--- tests/forces/Test_mobius_force.cc | 6 +++--- tests/forces/Test_mobius_force_eofa.cc | 6 +++--- tests/forces/Test_mobius_gpforce_eofa.cc | 6 +++--- tests/forces/Test_partfrac_force.cc | 6 +++--- tests/forces/Test_rect_force.cc | 6 +++--- tests/forces/Test_wilson_force.cc | 6 +++--- tests/forces/Test_wilsonclover_force.cc | 6 +++--- tests/forces/Test_zmobius_force.cc | 6 +++--- tests/solver/Test_dwf_hdcr.cc | 6 ++---- 22 files changed, 76 insertions(+), 77 deletions(-) diff --git a/tests/Test_general_stencil.cc b/tests/Test_general_stencil.cc index f03677d0..27d3f032 100644 --- a/tests/Test_general_stencil.cc +++ b/tests/Test_general_stencil.cc @@ -107,8 +107,8 @@ int main(int argc, char ** argv) // Implement a stencil code that should agree with cshift! for(int i=0;ioSites();i++){ auto SE = gStencil.GetEntry(0,i); - auto check = Check.View(); - auto foo = Foo.View(); + auto check = Check.View(CpuWrite); + auto foo = Foo.View(CpuRead); // Encapsulate in a general wrapper check[i] = foo[SE->_offset]; auto tmp=check[i]; @@ -147,8 +147,8 @@ int main(int argc, char ** argv) }}}} if (nrm > 1.0e-4) { - auto check = Check.View(); - auto bar = Bar.View(); + auto check = Check.View(CpuRead); + auto bar = Bar.View(CpuRead); for(int i=0;i_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(); - auto bar = Bar.View(); + auto check = Check.View(CpuRead); + auto bar = Bar.View(CpuRead); for(int i=0;i " <_offset << " "<< SE->_is_local<_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<<" -> " <_offset << " "<< SE->_is_local<_is_local && SE->_permute ) permute(echeck[i],ofoo[SE->_offset],permute_type); else if (SE->_is_local) diff --git a/tests/core/Test_staggered5D.cc b/tests/core/Test_staggered5D.cc index 7055d183..402e69d5 100644 --- a/tests/core/Test_staggered5D.cc +++ b/tests/core/Test_staggered5D.cc @@ -88,14 +88,15 @@ int main (int argc, char ** argv) // replicate across fifth dimension //////////////////////////////////// LatticeGaugeField Umu5d(FGrid); - auto umu5d = Umu5d.View(); - auto umu = Umu.View(); - for(int ss=0;ssoSites();ss++){ - for(int s=0;soSites();ss++){ + for(int s=0;s U(4,FGrid); for(int mu=0;mu U(4,FGrid); { - auto Umu5d_v = Umu5d.View(); - auto Umu_v = Umu.View(); + auto Umu5d_v = Umu5d.View(CpuWrite); + auto Umu_v = Umu.View(CpuRead); for(int ss=0;ssoSites();ss++){ for(int s=0;soSites(),{ uint64_t ss= sss*Ls; typedef vSpinColourVector spinor; diff --git a/tests/forces/Test_contfrac_force.cc b/tests/forces/Test_contfrac_force.cc index 4eeb8c27..4c3a3f53 100644 --- a/tests/forces/Test_contfrac_force.cc +++ b/tests/forces/Test_contfrac_force.cc @@ -98,9 +98,9 @@ int main (int argc, char ** argv) PokeIndex(mom,mommu,mu); // fourth order exponential approx - auto mom_v = mom.View(); - auto Uprime_v = Uprime.View(); - auto U_v = U.View(); + auto mom_v = mom.View(CpuRead); + auto U_v = U.View(CpuRead); + auto Uprime_v = Uprime.View(CpuWrite); thread_foreach( i,mom_v,{ Uprime_v[i](mu) = U_v[i](mu) diff --git a/tests/forces/Test_dwf_force.cc b/tests/forces/Test_dwf_force.cc index 009f50b3..fea867e6 100644 --- a/tests/forces/Test_dwf_force.cc +++ b/tests/forces/Test_dwf_force.cc @@ -100,9 +100,9 @@ int main (int argc, char ** argv) // fourth order exponential approx - auto mom_v = mom.View(); - auto U_v = U.View(); - auto Uprime_v = Uprime.View(); + auto mom_v = mom.View(CpuRead); + auto U_v = U.View(CpuRead); + auto Uprime_v = Uprime.View(CpuWrite); thread_foreach( i,mom_v,{ Uprime_v[i](mu) = U_v[i](mu) diff --git a/tests/forces/Test_dwf_force_eofa.cc b/tests/forces/Test_dwf_force_eofa.cc index 670e7589..5b864279 100644 --- a/tests/forces/Test_dwf_force_eofa.cc +++ b/tests/forces/Test_dwf_force_eofa.cc @@ -110,9 +110,9 @@ int main (int argc, char** argv) PokeIndex(mom, mommu, mu); // fourth order exponential approx - auto mom_v = mom.View(); - auto U_v = U.View(); - auto Uprime_v = Uprime.View(); + auto mom_v = mom.View(CpuRead); + auto U_v = U.View(CpuRead); + auto Uprime_v = Uprime.View(CpuWrite); thread_foreach(i,mom_v,{ Uprime_v[i](mu) = U_v[i](mu) diff --git a/tests/forces/Test_dwf_gpforce.cc b/tests/forces/Test_dwf_gpforce.cc index d762e22a..a0743edc 100644 --- a/tests/forces/Test_dwf_gpforce.cc +++ b/tests/forces/Test_dwf_gpforce.cc @@ -119,9 +119,9 @@ int main (int argc, char ** argv) PokeIndex(mom,mommu,mu); // fourth order exponential approx - auto mom_v = mom.View(); - auto U_v = U.View(); - auto Uprime_v = Uprime.View(); + auto mom_v = mom.View(CpuRead); + auto U_v = U.View(CpuRead); + auto Uprime_v = Uprime.View(CpuWrite); thread_foreach(i,mom_v,{ Uprime_v[i](mu) = U_v[i](mu) diff --git a/tests/forces/Test_dwf_gpforce_eofa.cc b/tests/forces/Test_dwf_gpforce_eofa.cc index 66ae9dcf..69b9adec 100644 --- a/tests/forces/Test_dwf_gpforce_eofa.cc +++ b/tests/forces/Test_dwf_gpforce_eofa.cc @@ -114,9 +114,9 @@ int main (int argc, char** argv) PokeIndex(mom, mommu, mu); // fourth order exponential approx - auto mom_v = mom.View(); - auto U_v = U.View(); - auto Uprime_v = Uprime.View(); + auto mom_v = mom.View(CpuRead); + auto U_v = U.View(CpuRead); + auto Uprime_v = Uprime.View(CpuWrite); thread_foreach(i,mom_v,{ Uprime_v[i](mu) = U_v[i](mu) diff --git a/tests/forces/Test_gp_plaq_force.cc b/tests/forces/Test_gp_plaq_force.cc index c4e214bb..5de7ddb7 100644 --- a/tests/forces/Test_gp_plaq_force.cc +++ b/tests/forces/Test_gp_plaq_force.cc @@ -85,9 +85,9 @@ int main (int argc, char ** argv) PokeIndex(mom,mommu,mu); // fourth order exponential approx - auto Uprime_v = Uprime.View(); - auto U_v = U.View(); - auto mom_v = mom.View(); + auto Uprime_v = Uprime.View(CpuWrite); + auto U_v = U.View(CpuRead); + auto mom_v = mom.View(CpuRead); thread_foreach(i,mom_v,{ // exp(pmu dt) * Umu Uprime_v[i](mu) = U_v[i](mu) + mom_v[i](mu)*U_v[i](mu)*dt ; }); diff --git a/tests/forces/Test_gp_rect_force.cc b/tests/forces/Test_gp_rect_force.cc index 2573af6a..026ce60f 100644 --- a/tests/forces/Test_gp_rect_force.cc +++ b/tests/forces/Test_gp_rect_force.cc @@ -87,9 +87,9 @@ int main (int argc, char ** argv) PokeIndex(mom,mommu,mu); // fourth order exponential approx - auto mom_v = mom.View(); - auto Uprime_v= Uprime.View(); - auto U_v = U.View(); + auto mom_v = mom.View(CpuRead); + auto Uprime_v= Uprime.View(CpuWrite); + auto U_v = U.View(CpuRead); thread_foreach(i,mom_v,{ // exp(pmu dt) * Umu Uprime_v[i](mu) = U_v[i](mu) + mom_v[i](mu)*U_v[i](mu)*dt ; }); diff --git a/tests/forces/Test_gpdwf_force.cc b/tests/forces/Test_gpdwf_force.cc index 09a1dc4b..22927d01 100644 --- a/tests/forces/Test_gpdwf_force.cc +++ b/tests/forces/Test_gpdwf_force.cc @@ -105,9 +105,9 @@ int main (int argc, char ** argv) PokeIndex(mom,mommu,mu); // fourth order exponential approx - auto U_v = U.View(); - auto mom_v = mom.View(); - auto Uprime_v = Uprime.View(); + auto U_v = U.View(CpuRead); + auto mom_v = mom.View(CpuRead); + auto Uprime_v = Uprime.View(CpuWrite); thread_foreach(i,mom_v,{ Uprime_v[i](mu) = U_v[i](mu) + mom_v[i](mu)*U_v[i](mu)*dt diff --git a/tests/forces/Test_gpwilson_force.cc b/tests/forces/Test_gpwilson_force.cc index cd30d898..41c4641d 100644 --- a/tests/forces/Test_gpwilson_force.cc +++ b/tests/forces/Test_gpwilson_force.cc @@ -99,9 +99,9 @@ int main (int argc, char ** argv) PokeIndex(mom,mommu,mu); // fourth order exponential approx - auto mom_v = mom.View(); - auto U_v = U.View(); - auto Uprime_v = Uprime.View(); + auto mom_v = mom.View(CpuRead); + auto U_v = U.View(CpuRead); + auto Uprime_v = Uprime.View(CpuWrite); thread_foreach(i,mom_v,{ Uprime_v[i](mu) = U_v[i](mu) diff --git a/tests/forces/Test_mobius_force.cc b/tests/forces/Test_mobius_force.cc index a1c4e930..daab4149 100644 --- a/tests/forces/Test_mobius_force.cc +++ b/tests/forces/Test_mobius_force.cc @@ -101,9 +101,9 @@ int main (int argc, char ** argv) PokeIndex(mom,mommu,mu); // fourth order exponential approx - auto U_v = U.View(); - auto mom_v = mom.View(); - auto Uprime_v = Uprime.View(); + auto U_v = U.View(CpuRead); + auto mom_v = mom.View(CpuRead); + auto Uprime_v = Uprime.View(CpuWrite); thread_foreach(i,mom_v,{ Uprime_v[i](mu) = U_v[i](mu) + mom_v[i](mu)*U_v[i](mu)*dt diff --git a/tests/forces/Test_mobius_force_eofa.cc b/tests/forces/Test_mobius_force_eofa.cc index f71e2d41..7a8d4cf8 100644 --- a/tests/forces/Test_mobius_force_eofa.cc +++ b/tests/forces/Test_mobius_force_eofa.cc @@ -112,9 +112,9 @@ int main (int argc, char** argv) PokeIndex(mom, mommu, mu); // fourth order exponential approx - auto mom_v = mom.View(); - auto U_v = U.View(); - auto Uprime_v = Uprime.View(); + auto mom_v = mom.View(CpuRead); + auto U_v = U.View(CpuRead); + auto Uprime_v = Uprime.View(CpuWrite); thread_foreach(i,mom_v,{ Uprime_v[i](mu) = U_v[i](mu) diff --git a/tests/forces/Test_mobius_gpforce_eofa.cc b/tests/forces/Test_mobius_gpforce_eofa.cc index 4975f36d..13de233b 100644 --- a/tests/forces/Test_mobius_gpforce_eofa.cc +++ b/tests/forces/Test_mobius_gpforce_eofa.cc @@ -115,9 +115,9 @@ int main (int argc, char** argv) SU3::GaussianFundamentalLieAlgebraMatrix(RNG4, mommu); // Traceless antihermitian momentum; gaussian in lie alg PokeIndex(mom, mommu, mu); - auto U_v = U.View(); - auto mom_v = mom.View(); - auto Uprime_v = Uprime.View(); + auto U_v = U.View(CpuRead); + auto mom_v = mom.View(CpuRead); + auto Uprime_v = Uprime.View(CpuWrite); // fourth order exponential approx thread_foreach( i, mom_v,{ Uprime_v[i](mu) = U_v[i](mu) + mom_v[i](mu)*U_v[i](mu)*dt + mom_v[i](mu) *mom_v[i](mu) *U_v[i](mu)*(dt*dt/2.0) diff --git a/tests/forces/Test_partfrac_force.cc b/tests/forces/Test_partfrac_force.cc index 3ea2c6aa..9292274e 100644 --- a/tests/forces/Test_partfrac_force.cc +++ b/tests/forces/Test_partfrac_force.cc @@ -101,9 +101,9 @@ int main (int argc, char ** argv) PokeIndex(mom,mommu,mu); // fourth order exponential approx - auto U_v = U.View(); - auto mom_v = mom.View(); - auto Uprime_v = Uprime.View(); + auto U_v = U.View(CpuRead); + auto mom_v = mom.View(CpuRead); + auto Uprime_v = Uprime.View(CpuWrite); thread_foreach(i,mom_v,{ Uprime_v[i](mu) = U_v[i](mu) + mom_v[i](mu)*U_v[i](mu)*dt diff --git a/tests/forces/Test_rect_force.cc b/tests/forces/Test_rect_force.cc index 9a78de24..909068c2 100644 --- a/tests/forces/Test_rect_force.cc +++ b/tests/forces/Test_rect_force.cc @@ -87,9 +87,9 @@ int main (int argc, char ** argv) PokeIndex(mom,mommu,mu); // fourth order exponential approx - auto Uprime_v = Uprime.View(); - auto U_v = U.View(); - auto mom_v = mom.View(); + auto Uprime_v = Uprime.View(CpuWrite); + auto U_v = U.View(CpuRead); + auto mom_v = mom.View(CpuRead); thread_foreach(i,mom_v,{ // exp(pmu dt) * Umu Uprime_v[i](mu) = U_v[i](mu) + mom_v[i](mu)*U_v[i](mu)*dt ; }); diff --git a/tests/forces/Test_wilson_force.cc b/tests/forces/Test_wilson_force.cc index 47f1516a..397dc40c 100644 --- a/tests/forces/Test_wilson_force.cc +++ b/tests/forces/Test_wilson_force.cc @@ -105,9 +105,9 @@ int main (int argc, char ** argv) PokeIndex(mom,mommu,mu); // fourth order exponential approx - auto U_v = U.View(); - auto mom_v = mom.View(); - auto Uprime_v = Uprime.View(); + auto U_v = U.View(CpuRead); + auto mom_v = mom.View(CpuRead); + auto Uprime_v = Uprime.View(CpuWrite); thread_foreach( i,mom_v,{ Uprime_v[i](mu) = U_v[i](mu); Uprime_v[i](mu) += mom_v[i](mu)*U_v[i](mu)*dt ; diff --git a/tests/forces/Test_wilsonclover_force.cc b/tests/forces/Test_wilsonclover_force.cc index d9ace23c..ff664e19 100644 --- a/tests/forces/Test_wilsonclover_force.cc +++ b/tests/forces/Test_wilsonclover_force.cc @@ -105,9 +105,9 @@ int main(int argc, char **argv) Hmom -= real(sum(trace(mommu * mommu))); PokeIndex(mom, mommu, mu); - auto Uprime_v = Uprime.View(); - auto U_v = U.View(); - auto mom_v = mom.View(); + auto Uprime_v = Uprime.View(CpuWrite); + auto U_v = U.View(CpuRead); + auto mom_v = mom.View(CpuRead); thread_foreach(ss,mom_v, { Uprime_v[ss]._internal[mu] = ProjectOnGroup(Exponentiate(mom_v[ss]._internal[mu], dt, 12) * U_v[ss]._internal[mu]); diff --git a/tests/forces/Test_zmobius_force.cc b/tests/forces/Test_zmobius_force.cc index 2730885f..2ed12acd 100644 --- a/tests/forces/Test_zmobius_force.cc +++ b/tests/forces/Test_zmobius_force.cc @@ -114,9 +114,9 @@ int main (int argc, char ** argv) PokeIndex(mom,mommu,mu); // fourth order exponential approx - auto mom_v = mom.View(); - auto U_v = U.View(); - auto Uprime_v = Uprime.View(); + auto mom_v = mom.View(CpuRead); + auto U_v = U.View(CpuRead); + auto Uprime_v = Uprime.View(CpuWrite); thread_foreach(i,mom_v,{ Uprime_v[i](mu) = U_v[i](mu) diff --git a/tests/solver/Test_dwf_hdcr.cc b/tests/solver/Test_dwf_hdcr.cc index 873530ff..f93af852 100644 --- a/tests/solver/Test_dwf_hdcr.cc +++ b/tests/solver/Test_dwf_hdcr.cc @@ -1,5 +1,3 @@ - - /************************************************************************************* Grid physics library, www.github.com/paboyle/Grid @@ -302,8 +300,8 @@ int main (int argc, char ** argv) int nb=nbasisc/2; CoarseAggregates.CreateSubspaceChebyshev(CRNG,PosdefLdop,nb,12.0,0.02,500,100,100,0.0); for(int n=0;noSites();site++){ subspace_g5[site](nn) = subspace[site](nn);