From 8aed4181e1620dcf8cb91b32cfae3f52331dd491 Mon Sep 17 00:00:00 2001 From: paboyle Date: Sun, 14 Jan 2018 23:54:25 +0000 Subject: [PATCH] Namespace, indent --- lib/lattice/Lattice_transfer.h | 90 +++++++++++++++++----------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/lib/lattice/Lattice_transfer.h b/lib/lattice/Lattice_transfer.h index 32c15d22..88498f58 100644 --- a/lib/lattice/Lattice_transfer.h +++ b/lib/lattice/Lattice_transfer.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_LATTICE_TRANSFER_H #define GRID_LATTICE_TRANSFER_H -namespace Grid { +NAMESPACE_BEGIN(Grid); inline void subdivides(GridBase *coarse,GridBase *fine) { @@ -45,39 +45,39 @@ inline void subdivides(GridBase *coarse,GridBase *fine) } - //////////////////////////////////////////////////////////////////////////////////////////// - // remove and insert a half checkerboard - //////////////////////////////////////////////////////////////////////////////////////////// - template inline void pickCheckerboard(int cb,Lattice &half,const Lattice &full){ - half.checkerboard = cb; +//////////////////////////////////////////////////////////////////////////////////////////// +// remove and insert a half checkerboard +//////////////////////////////////////////////////////////////////////////////////////////// +template inline void pickCheckerboard(int cb,Lattice &half,const Lattice &full){ + half.checkerboard = cb; - parallel_for(int ss=0;ssoSites();ss++){ - int cbos; - std::vector coor; - full._grid->oCoorFromOindex(coor,ss); - cbos=half._grid->CheckerBoard(coor); + parallel_for(int ss=0;ssoSites();ss++){ + int cbos; + std::vector coor; + full._grid->oCoorFromOindex(coor,ss); + cbos=half._grid->CheckerBoard(coor); - if (cbos==cb) { - int ssh=half._grid->oIndex(coor); - half._odata[ssh] = full._odata[ss]; - } + if (cbos==cb) { + int ssh=half._grid->oIndex(coor); + half._odata[ssh] = full._odata[ss]; } } - template inline void setCheckerboard(Lattice &full,const Lattice &half){ - int cb = half.checkerboard; - parallel_for(int ss=0;ssoSites();ss++){ - std::vector coor; - int cbos; +} +template inline void setCheckerboard(Lattice &full,const Lattice &half){ + int cb = half.checkerboard; + parallel_for(int ss=0;ssoSites();ss++){ + std::vector coor; + int cbos; - full._grid->oCoorFromOindex(coor,ss); - cbos=half._grid->CheckerBoard(coor); + full._grid->oCoorFromOindex(coor,ss); + cbos=half._grid->CheckerBoard(coor); - if (cbos==cb) { - int ssh=half._grid->oIndex(coor); - full._odata[ss]=half._odata[ssh]; - } + if (cbos==cb) { + int ssh=half._grid->oIndex(coor); + full._odata[ss]=half._odata[ssh]; } } +} template @@ -115,13 +115,13 @@ inline void blockProject(Lattice > &coarseData, for(int d=0;d<_ndimension;d++) coor_c[d]=coor_f[d]/block_r[d]; Lexicographic::IndexFromCoor(coor_c,sc,coarse->_rdimensions); -PARALLEL_CRITICAL - for(int i=0;i &fineZ, return; } template - inline void blockInnerProduct(Lattice &CoarseInner, - const Lattice &fineX, - const Lattice &fineY) +inline void blockInnerProduct(Lattice &CoarseInner, + const Lattice &fineX, + const Lattice &fineY) { typedef decltype(innerProduct(fineX._odata[0],fineY._odata[0])) dotp; @@ -230,8 +230,8 @@ inline void blockSum(Lattice &coarseData,const Lattice &fineData) for(int d=0;d<_ndimension;d++) coor_c[d]=coor_f[d]/block_r[d]; Lexicographic::IndexFromCoor(coor_c,sc,coarse->_rdimensions); -PARALLEL_CRITICAL - coarseData._odata[sc]=coarseData._odata[sc]+fineData._odata[sf]; + PARALLEL_CRITICAL + coarseData._odata[sc]=coarseData._odata[sc]+fineData._odata[sf]; } } @@ -422,11 +422,11 @@ void ExtractSlice(Lattice &lowDim,const Lattice & higherDim,int slic assert(hg->_processors[orthog]==1); int dl; dl = 0; - for(int d=0;d_processors[dl] == hg->_processors[d]); - assert(lg->_ldimensions[dl] == hg->_ldimensions[d]); - dl++; + for(int d=0;d_processors[dl] == hg->_processors[d]); + assert(lg->_ldimensions[dl] == hg->_ldimensions[d]); + dl++; } } // the above should guarantee that the operations are local @@ -602,7 +602,7 @@ unvectorizeToLexOrdArray(std::vector &out, const Lattice &in) //Copy SIMD-vectorized lattice to array of scalar objects in lexicographic order template typename std::enable_if::value - && !isSIMDvectorized::value, void>::type + && !isSIMDvectorized::value, void>::type vectorizeFromLexOrdArray( std::vector &in, Lattice &out) { @@ -987,5 +987,5 @@ void Grid_unsplit(std::vector > & full,Lattice & split) } } -} +NAMESPACE_END(Grid); #endif