1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-04-09 21:50:45 +01:00

Cleaner code

This commit is contained in:
paboyle 2017-05-30 23:38:02 +01:00
parent 0fb458879d
commit 62cf9cf638
2 changed files with 7 additions and 31 deletions

View File

@ -327,10 +327,6 @@ class Grid_simd {
// provides support // provides support
/////////////////////////////////////// ///////////////////////////////////////
//#if (__GNUC__ == 5 ) || ( ( __GNUC__ == 6 ) && __GNUC_MINOR__ < 3 )
//#pragma GCC push_options
//#pragma GCC optimize ("O0")
//#endif
template <class functor> template <class functor>
friend inline Grid_simd SimdApply(const functor &func, const Grid_simd &v) { friend inline Grid_simd SimdApply(const functor &func, const Grid_simd &v) {
Grid_simd ret; Grid_simd ret;
@ -364,9 +360,6 @@ class Grid_simd {
ret.v = cx.v; ret.v = cx.v;
return ret; return ret;
} }
//#if (__GNUC__ == 5 ) || ( ( __GNUC__ == 6 ) && __GNUC_MINOR__ < 3 )
//#pragma GCC pop_options
//#endif
/////////////////////// ///////////////////////
// Exchange // Exchange
// Al Ah , Bl Bh -> Al Bl Ah,Bh // Al Ah , Bl Bh -> Al Bl Ah,Bh
@ -428,7 +421,6 @@ class Grid_simd {
}; // end of Grid_simd class definition }; // end of Grid_simd class definition
inline void permute(ComplexD &y,ComplexD b, int perm) { y=b; } inline void permute(ComplexD &y,ComplexD b, int perm) { y=b; }
inline void permute(ComplexF &y,ComplexF b, int perm) { y=b; } inline void permute(ComplexF &y,ComplexF b, int perm) { y=b; }
inline void permute(RealD &y,RealD b, int perm) { y=b; } inline void permute(RealD &y,RealD b, int perm) { y=b; }
@ -838,8 +830,6 @@ inline void precisionChange(vComplexD *out,vComplexF *in,int nvec){ precisionCha
inline void precisionChange(vComplexD *out,vComplexH *in,int nvec){ precisionChange((vRealD *)out,(vRealH *)in,nvec);} inline void precisionChange(vComplexD *out,vComplexH *in,int nvec){ precisionChange((vRealD *)out,(vRealH *)in,nvec);}
inline void precisionChange(vComplexF *out,vComplexH *in,int nvec){ precisionChange((vRealF *)out,(vRealH *)in,nvec);} inline void precisionChange(vComplexF *out,vComplexH *in,int nvec){ precisionChange((vRealF *)out,(vRealH *)in,nvec);}
// Check our vector types are of an appropriate size. // Check our vector types are of an appropriate size.
#if defined QPX #if defined QPX
static_assert(2*sizeof(SIMD_Ftype) == sizeof(SIMD_Dtype), "SIMD vector lengths incorrect"); static_assert(2*sizeof(SIMD_Ftype) == sizeof(SIMD_Dtype), "SIMD vector lengths incorrect");
@ -854,21 +844,14 @@ static_assert(sizeof(SIMD_Ftype) == sizeof(SIMD_Itype), "SIMD vector lengths inc
///////////////////////////////////////// /////////////////////////////////////////
template <typename T> template <typename T>
struct is_simd : public std::false_type {}; struct is_simd : public std::false_type {};
template <> template <> struct is_simd<vRealF> : public std::true_type {};
struct is_simd<vRealF> : public std::true_type {}; template <> struct is_simd<vRealD> : public std::true_type {};
template <> template <> struct is_simd<vComplexF> : public std::true_type {};
struct is_simd<vRealD> : public std::true_type {}; template <> struct is_simd<vComplexD> : public std::true_type {};
template <> template <> struct is_simd<vInteger> : public std::true_type {};
struct is_simd<vComplexF> : public std::true_type {};
template <>
struct is_simd<vComplexD> : public std::true_type {};
template <>
struct is_simd<vInteger> : public std::true_type {};
template <typename T> template <typename T> using IfSimd = Invoke<std::enable_if<is_simd<T>::value, int> >;
using IfSimd = Invoke<std::enable_if<is_simd<T>::value, int> >; template <typename T> using IfNotSimd = Invoke<std::enable_if<!is_simd<T>::value, unsigned> >;
template <typename T>
using IfNotSimd = Invoke<std::enable_if<!is_simd<T>::value, unsigned> >;
} }
#endif #endif

View File

@ -179,13 +179,6 @@ inline Grid_simd<S, V> div(const Grid_simd<S, V> &r, Integer y) {
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
// Allows us to assign into **conformable** real vectors from complex // Allows us to assign into **conformable** real vectors from complex
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
// template < class S, class V >
// inline auto ComplexRemove(const Grid_simd<S,V> &c) ->
// Grid_simd<Grid_simd<S,V>::Real,V> {
// Grid_simd<Grid_simd<S,V>::Real,V> ret;
// ret.v = c.v;
// return ret;
// }
template <class scalar> template <class scalar>
struct AndFunctor { struct AndFunctor {
scalar operator()(const scalar &x, const scalar &y) const { return x & y; } scalar operator()(const scalar &x, const scalar &y) const { return x & y; }