From 7bf82f5b374d902040a52d80ad81d4a3dde8c5c8 Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Mon, 10 Sep 2018 11:28:42 +0100 Subject: [PATCH] Offload the face handling to GPU --- lib/stencil/Stencil.cc | 2 +- lib/stencil/Stencil.h | 25 +++++++++++++------------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/lib/stencil/Stencil.cc b/lib/stencil/Stencil.cc index c1b33baa..5b1bb2ea 100644 --- a/lib/stencil/Stencil.cc +++ b/lib/stencil/Stencil.cc @@ -30,7 +30,7 @@ NAMESPACE_BEGIN(Grid); void Gather_plane_table_compute (GridBase *grid,int dimension,int plane,int cbmask, - int off,std::vector > & table) + int off,Vector > & table) { table.resize(0); diff --git a/lib/stencil/Stencil.h b/lib/stencil/Stencil.h index 8eee302a..bedbb127 100644 --- a/lib/stencil/Stencil.h +++ b/lib/stencil/Stencil.h @@ -56,18 +56,19 @@ NAMESPACE_BEGIN(Grid); // Gather for when there *is* need to SIMD split with compression /////////////////////////////////////////////////////////////////// void Gather_plane_table_compute (GridBase *grid,int dimension,int plane,int cbmask, - int off,std::vector > & table); + int off,Vector > & table); template -void Gather_plane_simple_table (std::vector >& table,const Lattice &rhs,cobj *buffer,compressor &compress, int off,int so) __attribute__((noinline)); +void Gather_plane_simple_table (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) +void Gather_plane_simple_table (Vector >& table,const Lattice &rhs,cobj *buffer,compressor &compress, int off,int so) { int num=table.size(); + std::pair *table_v = & table[0]; auto rhs_v = rhs.View(); - thread_loop( (int i=0;i >& table,const La /////////////////////////////////////////////////////////////////// template void Gather_plane_exchange_table(const Lattice &rhs, - std::vector pointers,int dimension,int plane,int cbmask,compressor &compress,int type) __attribute__((noinline)); + Vector pointers,int dimension,int plane,int cbmask,compressor &compress,int type) __attribute__((noinline)); template -void Gather_plane_exchange_table(std::vector >& table,const Lattice &rhs, +void Gather_plane_exchange_table(Vector >& table,const Lattice &rhs, std::vector pointers,int dimension,int plane,int cbmask, compressor &compress,int type) { @@ -87,7 +88,7 @@ void Gather_plane_exchange_table(std::vector >& table,const L int num=table.size()/2; int so = plane*rhs.Grid()->_ostride[dimension]; // base offset for start of plane auto rhs_v = rhs.View(); - thread_loop( (int j=0;j > > face_table ; + Vector > > face_table ; Vector _entries; // Resident in managed memory @@ -537,7 +538,7 @@ public: for(int i=0;i=0); assert(shift_slice_nblock[dimension]*_grid->_slice_block[dimension]; int cb= (cbmask==0x2)? Odd : Even;