1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-10 07:55:35 +00:00

Compressor speed up (a little); streaming stores

This commit is contained in:
Peter Boyle 2018-05-02 17:52:16 +01:00
parent 6f6c5c549a
commit 8c658de179

View File

@ -69,39 +69,47 @@ class WilsonCompressorTemplate< _HCspinor, _Hspinor, _Spinor, projector,
/*****************************************************/ /*****************************************************/
/* Compress includes precision change if mpi data is not same */ /* Compress includes precision change if mpi data is not same */
/*****************************************************/ /*****************************************************/
inline void Compress(SiteHalfSpinor *buf,Integer o,const SiteSpinor &in) { inline void Compress(SiteHalfSpinor * __restrict__ buf,Integer o,const SiteSpinor &in) {
projector::Proj(buf[o],in,mu,dag); SiteHalfSpinor tmp;
projector::Proj(tmp,in,mu,dag);
vstream(buf[o],tmp);
} }
/*****************************************************/ /*****************************************************/
/* Exchange includes precision change if mpi data is not same */ /* Exchange includes precision change if mpi data is not same */
/*****************************************************/ /*****************************************************/
inline void Exchange(SiteHalfSpinor *mp, inline void Exchange(SiteHalfSpinor * __restrict__ mp,
SiteHalfSpinor *vp0, const SiteHalfSpinor * __restrict__ vp0,
SiteHalfSpinor *vp1, const SiteHalfSpinor * __restrict__ vp1,
Integer type,Integer o){ Integer type,Integer o){
exchange(mp[2*o],mp[2*o+1],vp0[o],vp1[o],type); SiteHalfSpinor tmp1;
SiteHalfSpinor tmp2;
exchange(tmp1,tmp2,vp0[o],vp1[o],type);
vstream(mp[2*o ],tmp1);
vstream(mp[2*o+1],tmp2);
} }
/*****************************************************/ /*****************************************************/
/* Have a decompression step if mpi data is not same */ /* Have a decompression step if mpi data is not same */
/*****************************************************/ /*****************************************************/
inline void Decompress(SiteHalfSpinor *out, inline void Decompress(SiteHalfSpinor * __restrict__ out,
SiteHalfSpinor *in, Integer o) { SiteHalfSpinor * __restrict__ in, Integer o) {
assert(0); assert(0);
} }
/*****************************************************/ /*****************************************************/
/* Compress Exchange */ /* Compress Exchange */
/*****************************************************/ /*****************************************************/
inline void CompressExchange(SiteHalfSpinor *out0, inline void CompressExchange(SiteHalfSpinor * __restrict__ out0,
SiteHalfSpinor *out1, SiteHalfSpinor * __restrict__ out1,
const SiteSpinor *in, const SiteSpinor * __restrict__ in,
Integer j,Integer k, Integer m,Integer type){ Integer j,Integer k, Integer m,Integer type){
SiteHalfSpinor temp1, temp2,temp3,temp4; SiteHalfSpinor temp1, temp2,temp3,temp4;
projector::Proj(temp1,in[k],mu,dag); projector::Proj(temp1,in[k],mu,dag);
projector::Proj(temp2,in[m],mu,dag); projector::Proj(temp2,in[m],mu,dag);
exchange(out0[j],out1[j],temp1,temp2,type); exchange(temp3,temp4,temp1,temp2,type);
vstream(out0[j],temp3);
vstream(out1[j],temp4);
} }
/*****************************************************/ /*****************************************************/