From 78ab955fece288371b5ee0267545bd4435c80a95 Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Fri, 22 Dec 2023 18:05:41 -0500 Subject: [PATCH] Better padded cell exchange --- Grid/lattice/PaddedCell.h | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/Grid/lattice/PaddedCell.h b/Grid/lattice/PaddedCell.h index 3fb87a25..ad1496f5 100644 --- a/Grid/lattice/PaddedCell.h +++ b/Grid/lattice/PaddedCell.h @@ -126,10 +126,8 @@ template inline void ScatterSlice(const cshiftVector &buf, /////////////////////////////////////////// // Transfer into lattice - will coalesce /////////////////////////////////////////// -#if 0 - sobj obj = extractLane(blane,buf_p[ss+offset]); - insertLane(lane,lat_v[osite],obj); -#else + // sobj obj = extractLane(blane,buf_p[ss+offset]); + // insertLane(lane,lat_v[osite],obj); const int words=sizeof(vobj)/sizeof(vector_type); vector_type * from = (vector_type *)&buf_p[ss+offset]; vector_type * to = (vector_type *)&lat_v[osite]; @@ -138,7 +136,6 @@ template inline void ScatterSlice(const cshiftVector &buf, stmp = getlane(from[w], blane); putlane(to[w], stmp, lane); } -#endif } }); } @@ -215,10 +212,8 @@ template inline void GatherSlice(cshiftVector &buf, /////////////////////////////////////////// // Take out of lattice /////////////////////////////////////////// -#if 0 - sobj obj = extractLane(lane,lat_v[osite]); - insertLane(blane,buf_p[ss+offset],obj); -#else + // sobj obj = extractLane(lane,lat_v[osite]); + // insertLane(blane,buf_p[ss+offset],obj); const int words=sizeof(vobj)/sizeof(vector_type); vector_type * to = (vector_type *)&buf_p[ss+offset]; vector_type * from = (vector_type *)&lat_v[osite]; @@ -227,22 +222,8 @@ template inline void GatherSlice(cshiftVector &buf, stmp = getlane(from[w], lane); putlane(to[w], stmp, blane); } -#endif - } }); - /* - int words =block*nblock/simd[dim]; - std::vector tbuf(words); - acceleratorCopyFromDevice((void *)&buf[offset],(void *)&tbuf[0],words*sizeof(vobj)); - typedef typename vobj::scalar_type scalar; - scalar *sbuf = (scalar *)&tbuf[0]; - scalar tmp=0.0; - for(int w=0;w