From d8061afe2456dc8c46499bd803e1726e6391fc51 Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Thu, 21 May 2015 06:47:05 +0100 Subject: [PATCH] Streaming store option ifdef --- lib/lattice/Grid_lattice_base.h | 41 ++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/lib/lattice/Grid_lattice_base.h b/lib/lattice/Grid_lattice_base.h index 0016bafa..41f349b7 100644 --- a/lib/lattice/Grid_lattice_base.h +++ b/lib/lattice/Grid_lattice_base.h @@ -1,6 +1,8 @@ #ifndef GRID_LATTICE_BASE_H #define GRID_LATTICE_BASE_H +#define STREAMING_STORES + namespace Grid { // TODO: @@ -66,8 +68,12 @@ public: { PARALLEL_FOR_LOOP for(int ss=0;ss<_grid->oSites();ss++){ - vobj tmp= eval(ss,expr); +#ifdef STREAMING_STORES + vobj tmp = eval(ss,expr); vstream(_odata[ss] ,tmp); +#else + _odata[ss]=eval(ss,expr); +#endif } return *this; } @@ -75,8 +81,12 @@ PARALLEL_FOR_LOOP { PARALLEL_FOR_LOOP for(int ss=0;ss<_grid->oSites();ss++){ - vobj tmp= eval(ss,expr); +#ifdef STREAMING_STORES + vobj tmp = eval(ss,expr); vstream(_odata[ss] ,tmp); +#else + _odata[ss]=eval(ss,expr); +#endif } return *this; } @@ -84,8 +94,12 @@ PARALLEL_FOR_LOOP { PARALLEL_FOR_LOOP for(int ss=0;ss<_grid->oSites();ss++){ - vobj tmp= eval(ss,expr); +#ifdef STREAMING_STORES + vobj tmp = eval(ss,expr); vstream(_odata[ss] ,tmp); +#else + _odata[ss] = eval(ss,expr); +#endif } return *this; } @@ -97,7 +111,12 @@ PARALLEL_FOR_LOOP _odata.resize(_grid->oSites()); PARALLEL_FOR_LOOP for(int ss=0;ss<_grid->oSites();ss++){ - _odata[ss] = eval(ss,expr); +#ifdef STREAMING_STORES + vobj tmp = eval(ss,expr); + vstream(_odata[ss] ,tmp); +#else + _odata[ss]=_eval(ss,expr); +#endif } }; template @@ -107,7 +126,12 @@ PARALLEL_FOR_LOOP _odata.resize(_grid->oSites()); PARALLEL_FOR_LOOP for(int ss=0;ss<_grid->oSites();ss++){ - _odata[ss] = eval(ss,expr); +#ifdef STREAMING_STORES + vobj tmp = eval(tmp,ss,expr); + vstream(_odata[ss] ,tmp); +#else + _odata[ss]=eval(ss,expr); +#endif } }; template @@ -117,7 +141,12 @@ PARALLEL_FOR_LOOP _odata.resize(_grid->oSites()); PARALLEL_FOR_LOOP for(int ss=0;ss<_grid->oSites();ss++){ - _odata[ss] = eval(ss,expr); +#ifdef STREAMING_STORES + vobj tmp = eval(ss,expr); + vstream(_odata[ss] ,tmp); +#else + _odata[ss]=eval(ss,expr); +#endif } };