mirror of
https://github.com/paboyle/Grid.git
synced 2025-06-12 20:27:06 +01:00
Merge branch 'develop' into feature/scalar_adjointFT
This commit is contained in:
@ -328,6 +328,8 @@ static void sliceMaddVector(Lattice<vobj> &R,std::vector<RealD> &a,const Lattice
|
||||
typedef typename vobj::vector_type vector_type;
|
||||
typedef typename vobj::tensor_reduced tensor_reduced;
|
||||
|
||||
scalar_type zscale(scale);
|
||||
|
||||
GridBase *grid = X._grid;
|
||||
|
||||
int Nsimd =grid->Nsimd();
|
||||
@ -353,7 +355,7 @@ static void sliceMaddVector(Lattice<vobj> &R,std::vector<RealD> &a,const Lattice
|
||||
grid->iCoorFromIindex(icoor,l);
|
||||
int ldx =r+icoor[orthogdim]*rd;
|
||||
scalar_type *as =(scalar_type *)&av;
|
||||
as[l] = scalar_type(a[ldx])*scale;
|
||||
as[l] = scalar_type(a[ldx])*zscale;
|
||||
}
|
||||
|
||||
tensor_reduced at; at=av;
|
||||
|
@ -327,18 +327,20 @@ class Grid_simd {
|
||||
// provides support
|
||||
///////////////////////////////////////
|
||||
|
||||
#if (__GNUC__ == 5 ) || ( ( __GNUC__ == 6 ) && __GNUC_MINOR__ < 3 )
|
||||
#pragma GCC push_options
|
||||
#pragma GCC optimize ("O0")
|
||||
#endif
|
||||
//#if (__GNUC__ == 5 ) || ( ( __GNUC__ == 6 ) && __GNUC_MINOR__ < 3 )
|
||||
//#pragma GCC push_options
|
||||
//#pragma GCC optimize ("O0")
|
||||
//#endif
|
||||
template <class functor>
|
||||
friend inline Grid_simd SimdApply(const functor &func, const Grid_simd &v) {
|
||||
Grid_simd ret;
|
||||
Grid_simd::conv_t conv;
|
||||
|
||||
Grid_simd::scalar_type s;
|
||||
|
||||
conv.v = v.v;
|
||||
for (int i = 0; i < Nsimd(); i++) {
|
||||
conv.s[i] = func(conv.s[i]);
|
||||
s = conv.s[i];
|
||||
conv.s[i] = func(s);
|
||||
}
|
||||
ret.v = conv.v;
|
||||
return ret;
|
||||
@ -350,18 +352,21 @@ class Grid_simd {
|
||||
Grid_simd ret;
|
||||
Grid_simd::conv_t cx;
|
||||
Grid_simd::conv_t cy;
|
||||
Grid_simd::scalar_type sx,sy;
|
||||
|
||||
cx.v = x.v;
|
||||
cy.v = y.v;
|
||||
for (int i = 0; i < Nsimd(); i++) {
|
||||
cx.s[i] = func(cx.s[i], cy.s[i]);
|
||||
sx = cx.s[i];
|
||||
sy = cy.s[i];
|
||||
cx.s[i] = func(sx,sy);
|
||||
}
|
||||
ret.v = cx.v;
|
||||
return ret;
|
||||
}
|
||||
#if (__GNUC__ == 5 ) || ( ( __GNUC__ == 6 ) && __GNUC_MINOR__ < 3 )
|
||||
#pragma GCC pop_options
|
||||
#endif
|
||||
//#if (__GNUC__ == 5 ) || ( ( __GNUC__ == 6 ) && __GNUC_MINOR__ < 3 )
|
||||
//#pragma GCC pop_options
|
||||
//#endif
|
||||
///////////////////////
|
||||
// Exchange
|
||||
// Al Ah , Bl Bh -> Al Bl Ah,Bh
|
||||
|
Reference in New Issue
Block a user