From 6bf5fb19247601e5b288d96b595dddf321ba0c0b Mon Sep 17 00:00:00 2001 From: paboyle Date: Sat, 13 Jan 2018 00:08:25 +0000 Subject: [PATCH] Clean up and format NAMESPACE --- lib/cshift/Cshift.h | 6 ++--- lib/cshift/Cshift_common.h | 50 ++++++++++++++++++++------------------ lib/cshift/Cshift_mpi.h | 12 +++++---- lib/cshift/Cshift_none.h | 11 +++++---- 4 files changed, 42 insertions(+), 37 deletions(-) diff --git a/lib/cshift/Cshift.h b/lib/cshift/Cshift.h index 7d0caeee..07ec8412 100644 --- a/lib/cshift/Cshift.h +++ b/lib/cshift/Cshift.h @@ -1,4 +1,4 @@ - /************************************************************************************* +/************************************************************************************* Grid physics library, www.github.com/paboyle/Grid @@ -23,8 +23,8 @@ Author: Peter Boyle 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. See the full license in the file "LICENSE" in the top level distribution directory - *************************************************************************************/ - /* END LEGAL */ +*************************************************************************************/ +/* END LEGAL */ #ifndef _GRID_CSHIFT_H_ #define _GRID_CSHIFT_H_ diff --git a/lib/cshift/Cshift_common.h b/lib/cshift/Cshift_common.h index 1be672e8..d9cc1eb5 100644 --- a/lib/cshift/Cshift_common.h +++ b/lib/cshift/Cshift_common.h @@ -23,12 +23,12 @@ Author: Peter Boyle 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. See the full license in the file "LICENSE" in the top level distribution directory - *************************************************************************************/ - /* END LEGAL */ +*************************************************************************************/ +/* END LEGAL */ #ifndef _GRID_CSHIFT_COMMON_H_ #define _GRID_CSHIFT_COMMON_H_ -namespace Grid { +NAMESPACE_BEGIN(Grid); /////////////////////////////////////////////////////////////////// // Gather for when there is no need to SIMD split @@ -56,20 +56,20 @@ Gather_plane_simple (const Lattice &rhs,commVector &buffer,int dimen } } } else { - int bo=0; - std::vector > table; - for(int n=0;nCheckerBoardFromOindex(o+b); - if ( ocb &cbmask ) { - table.push_back(std::pair (bo++,o+b)); - } - } - } - parallel_for(int i=0;i > table; + for(int n=0;nCheckerBoardFromOindex(o+b); + if ( ocb &cbmask ) { + table.push_back(std::pair (bo++,o+b)); + } + } + } + parallel_for(int i=0;i void Scatter_plane_simple (Lattice &rhs,commVector void Copy_plane(Lattice& lhs,const Lattice &rhs int o =n*stride+b; int ocb=1<CheckerBoardFromOindex(o); if ( ocb&cbmask ) { - //lhs._odata[lo+o]=rhs._odata[ro+o]; + //lhs._odata[lo+o]=rhs._odata[ro+o]; vstream(lhs._odata[lo+o],rhs._odata[ro+o]); } } @@ -270,7 +270,7 @@ template void Copy_plane_permute(Lattice& lhs,const Lattice_slice_stride[dimension]; parallel_for_nest2(int n=0;nCheckerBoardFromOindex(o+b); @@ -278,7 +278,7 @@ template void Copy_plane_permute(Lattice& lhs,const Lattice Lattice Cshift_local(Lattice &ret,const Lattice } return ret; } -} + +NAMESPACE_END(Grid); + #endif diff --git a/lib/cshift/Cshift_mpi.h b/lib/cshift/Cshift_mpi.h index a66b49bf..faf932d6 100644 --- a/lib/cshift/Cshift_mpi.h +++ b/lib/cshift/Cshift_mpi.h @@ -1,4 +1,4 @@ - /************************************************************************************* +/************************************************************************************* Grid physics library, www.github.com/paboyle/Grid @@ -24,13 +24,13 @@ Author: paboyle 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. See the full license in the file "LICENSE" in the top level distribution directory - *************************************************************************************/ - /* END LEGAL */ +*************************************************************************************/ +/* END LEGAL */ #ifndef _GRID_CSHIFT_MPI_H_ #define _GRID_CSHIFT_MPI_H_ -namespace Grid { +NAMESPACE_BEGIN(Grid); template Lattice Cshift(const Lattice &rhs,int dimension,int shift) { @@ -250,6 +250,8 @@ template void Cshift_comms_simd(Lattice &ret,const Lattice 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. See the full license in the file "LICENSE" in the top level distribution directory - *************************************************************************************/ - /* END LEGAL */ +*************************************************************************************/ +/* END LEGAL */ #ifndef _GRID_CSHIFT_NONE_H_ #define _GRID_CSHIFT_NONE_H_ -namespace Grid { +NAMESPACE_BEGIN(Grid); template Lattice Cshift(const Lattice &rhs,int dimension,int shift) { Lattice ret(rhs._grid); @@ -35,5 +35,6 @@ template Lattice Cshift(const Lattice &rhs,int dimension Cshift_local(ret,rhs,dimension,shift); return ret; } -} +NAMESPACE_END(Grid); + #endif