diff --git a/lib/cshift/Cshift_common.h b/lib/cshift/Cshift_common.h index 995b04ac..4fc92f1b 100644 --- a/lib/cshift/Cshift_common.h +++ b/lib/cshift/Cshift_common.h @@ -52,7 +52,7 @@ Gather_plane_simple (const Lattice &rhs,commVector &buffer,int dimen for(int b=0;b &rhs,commVector &buffer,int dimen } } thread_loop( (int i=0;i &rhs,std::vector(temp,pointers,offset); } @@ -116,7 +116,7 @@ Gather_plane_extract(const Lattice &rhs,std::vector(temp,pointers,offset); } } @@ -146,7 +146,7 @@ template void Scatter_plane_simple (Lattice &rhs,commVector_slice_stride[dimension]; int bo =n*rhs._grid->_slice_block[dimension]; - rhs._odata[so+o+b]=buffer[bo+b]; + rhs[so+o+b]=buffer[bo+b]; } }); } else { @@ -162,7 +162,7 @@ template void Scatter_plane_simple (Lattice &rhs,commVector void Scatter_plane_merge(Lattice &rhs,std::vector_slice_stride[dimension]; int offset = b+n*rhs._grid->_slice_block[dimension]; - merge(rhs._odata[so+o+b],pointers,offset); + merge(rhs[so+o+b],pointers,offset); } }); } else { @@ -203,7 +203,7 @@ template void Scatter_plane_merge(Lattice &rhs,std::vector_slice_block[dimension]; int ocb=1<CheckerBoardFromOindex(o+b); if ( ocb&cbmask ) { - merge(rhs._odata[so+o+b],pointers,offset); + merge(rhs[so+o+b],pointers,offset); } } } @@ -231,8 +231,8 @@ template void Copy_plane(Lattice& lhs,const Lattice &rhs thread_loop_collapse( (int n=0;n 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]; - vstream(lhs._odata[lo+o],rhs._odata[ro+o]); + //lhs[lo+o]=rhs[ro+o]; + vstream(lhs[lo+o],rhs[ro+o]); } } }); @@ -272,7 +272,7 @@ template void Copy_plane_permute(Lattice& lhs,const LatticeCheckerBoardFromOindex(o+b); if ( ocb&cbmask ) { - permute(lhs._odata[lo+o+b],rhs._odata[ro+o+b],permute_type); + permute(lhs[lo+o+b],rhs[ro+o+b],permute_type); } } }); @@ -285,8 +285,8 @@ template void Cshift_local(Lattice& ret,const Lattice &r { int sshift[2]; - sshift[0] = rhs._grid->CheckerBoardShiftForCB(rhs.checkerboard,dimension,shift,Even); - sshift[1] = rhs._grid->CheckerBoardShiftForCB(rhs.checkerboard,dimension,shift,Odd); + sshift[0] = rhs._grid->CheckerBoardShiftForCB(rhs.Checkerboard(),dimension,shift,Even); + sshift[1] = rhs._grid->CheckerBoardShiftForCB(rhs.Checkerboard(),dimension,shift,Odd); if ( sshift[0] == sshift[1] ) { Cshift_local(ret,rhs,dimension,shift,0x3); @@ -309,7 +309,7 @@ template Lattice Cshift_local(Lattice &ret,const Lattice shift = (shift+fd)%fd; // the permute type - ret.checkerboard = grid->CheckerBoardDestination(rhs.checkerboard,shift,dimension); + ret.Checkerboard() = grid->CheckerBoardDestination(rhs.Checkerboard(),shift,dimension); int permute_dim =grid->PermuteDim(dimension); int permute_type=grid->PermuteType(dimension); int permute_type_dist; @@ -320,7 +320,7 @@ template Lattice Cshift_local(Lattice &ret,const Lattice int bo = x * grid->_ostride[dimension]; int cb= (cbmask==0x2)? Odd : Even; - int sshift = grid->CheckerBoardShiftForCB(rhs.checkerboard,dimension,shift,cb); + int sshift = grid->CheckerBoardShiftForCB(rhs.Checkerboard(),dimension,shift,cb); int sx = (x+sshift)%rd; // FIXME : This must change where we have a diff --git a/lib/cshift/Cshift_mpi.h b/lib/cshift/Cshift_mpi.h index faf932d6..1698bbf5 100644 --- a/lib/cshift/Cshift_mpi.h +++ b/lib/cshift/Cshift_mpi.h @@ -45,7 +45,7 @@ template Lattice Cshift(const Lattice &rhs,int dimension // Map to always positive shift modulo global full dimension. shift = (shift+fd)%fd; - ret.checkerboard = rhs._grid->CheckerBoardDestination(rhs.checkerboard,shift,dimension); + ret.Checkerboard() = rhs._grid->CheckerBoardDestination(rhs.Checkerboard(),shift,dimension); // the permute type int simd_layout = rhs._grid->_simd_layout[dimension]; @@ -70,10 +70,10 @@ template void Cshift_comms(Lattice& ret,const Lattice &r { int sshift[2]; - sshift[0] = rhs._grid->CheckerBoardShiftForCB(rhs.checkerboard,dimension,shift,Even); - sshift[1] = rhs._grid->CheckerBoardShiftForCB(rhs.checkerboard,dimension,shift,Odd); + sshift[0] = rhs._grid->CheckerBoardShiftForCB(rhs.Checkerboard(),dimension,shift,Even); + sshift[1] = rhs._grid->CheckerBoardShiftForCB(rhs.Checkerboard(),dimension,shift,Odd); - // std::cout << "Cshift_comms dim "< void Cshift_comms_simd(Lattice& ret,const LatticeCheckerBoardShiftForCB(rhs.checkerboard,dimension,shift,Even); - sshift[1] = rhs._grid->CheckerBoardShiftForCB(rhs.checkerboard,dimension,shift,Odd); + sshift[0] = rhs._grid->CheckerBoardShiftForCB(rhs.Checkerboard(),dimension,shift,Even); + sshift[1] = rhs._grid->CheckerBoardShiftForCB(rhs.Checkerboard(),dimension,shift,Odd); if ( sshift[0] == sshift[1] ) { Cshift_comms_simd(ret,rhs,dimension,shift,0x3); @@ -122,7 +122,7 @@ template void Cshift_comms(Lattice &ret,const Lattice &r commVector recv_buf(buffer_size); int cb= (cbmask==0x2)? Odd : Even; - int sshift= rhs._grid->CheckerBoardShiftForCB(rhs.checkerboard,dimension,shift,cb); + int sshift= rhs._grid->CheckerBoardShiftForCB(rhs.Checkerboard(),dimension,shift,cb); for(int x=0;x void Cshift_comms_simd(Lattice &ret,const LatticeCheckerBoardShiftForCB(rhs.checkerboard,dimension,shift,cb); + int sshift= grid->CheckerBoardShiftForCB(rhs.Checkerboard(),dimension,shift,cb); // loop over outer coord planes orthog to dim for(int x=0;x Lattice Cshift(const Lattice &rhs,int dimension,int shift) { Lattice ret(rhs._grid); - ret.checkerboard = rhs._grid->CheckerBoardDestination(rhs.checkerboard,shift,dimension); + ret.Checkerboard() = rhs._grid->CheckerBoardDestination(rhs.Checkerboard(),shift,dimension); Cshift_local(ret,rhs,dimension,shift); return ret; }