diff --git a/lib/Stencil.h b/lib/Stencil.h index 96b40c50..82e818d2 100644 --- a/lib/Stencil.h +++ b/lib/Stencil.h @@ -70,51 +70,20 @@ namespace Grid { -inline void Gather_plane_simple_table_compute (GridBase *grid,int dimension,int plane,int cbmask, - int off,std::vector > & table) +void Gather_plane_simple_table_compute (GridBase *grid,int dimension,int plane,int cbmask, + int off,std::vector > & table); + +template +void Gather_plane_simple_table (std::vector >& table,const Lattice &rhs,cobj *buffer,compressor &compress, int off,int so) __attribute__((noinline)); + +template +void Gather_plane_simple_table (std::vector >& table,const Lattice &rhs,cobj *buffer,compressor &compress, int off,int so) { - table.resize(0); - int rd = grid->_rdimensions[dimension]; - - if ( !grid->CheckerBoarded(dimension) ) { - cbmask = 0x3; + int num=table.size(); + PARALLEL_FOR_LOOP + for(int i=0;i_ostride[dimension]; // base offset for start of plane - int e1=grid->_slice_nblock[dimension]; - int e2=grid->_slice_block[dimension]; - - int stride=grid->_slice_stride[dimension]; - if ( cbmask == 0x3 ) { - table.resize(e1*e2); - for(int n=0;n(bo+b,o+b); - } - } - } else { - int bo=0; - table.resize(e1*e2/2); - for(int n=0;nCheckerBoardFromOindexTable(o+b); - if ( ocb &cbmask ) { - table[bo]=std::pair(bo,o+b); bo++; - } - } - } - } -} - -template void -Gather_plane_simple_table (std::vector >& table,const Lattice &rhs,cobj *buffer,compressor &compress, int off,int so) -{ -PARALLEL_FOR_LOOP - for(int i=0;i