mirror of
https://github.com/paboyle/Grid.git
synced 2025-06-13 12:47:05 +01:00
Pushed the overlap comms tweaks
This commit is contained in:
@ -217,5 +217,50 @@ void merge(vobj &vec,std::vector<typename vobj::scalar_object *> &extracted,int
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template<class vobj> inline
|
||||
void merge1(vobj &vec,std::vector<typename vobj::scalar_object *> &extracted,int offset)
|
||||
{
|
||||
typedef typename vobj::scalar_type scalar_type ;
|
||||
typedef typename vobj::vector_type vector_type ;
|
||||
|
||||
const int Nsimd=vobj::vector_type::Nsimd();
|
||||
const int words=sizeof(vobj)/sizeof(vector_type);
|
||||
|
||||
scalar_type *pointer;
|
||||
scalar_type *vp = (scalar_type *)&vec;
|
||||
|
||||
// assert( (((uint64_t)vp)&(sizeof(scalar_type)-1)) == 0);
|
||||
|
||||
for(int i=0;i<Nsimd;i++){
|
||||
pointer=(scalar_type *)&extracted[i][offset];
|
||||
for(int w=0;w<words;w++){
|
||||
vp[w*Nsimd+i] = pointer[w];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template<class vobj> inline
|
||||
void merge2(vobj &vec,std::vector<typename vobj::scalar_object *> &extracted,int offset)
|
||||
{
|
||||
typedef typename vobj::scalar_type scalar_type ;
|
||||
typedef typename vobj::vector_type vector_type ;
|
||||
|
||||
const int Nsimd=vobj::vector_type::Nsimd();
|
||||
const int words=sizeof(vobj)/sizeof(vector_type);
|
||||
|
||||
scalar_type *pointer;
|
||||
scalar_type *vp = (scalar_type *)&vec;
|
||||
// assert( (((uint64_t)vp)&(sizeof(scalar_type)-1)) == 0);
|
||||
|
||||
for(int w=0;w<words;w++){
|
||||
for(int i=0;i<Nsimd;i++){
|
||||
pointer=(scalar_type *)&extracted[i][offset];
|
||||
vp[w*Nsimd+i] =pointer[w];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user