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

NAMESAPCE

This commit is contained in:
paboyle 2018-01-12 23:00:03 +00:00
parent d8ff895e74
commit 6a2eca2ec2
2 changed files with 13 additions and 15 deletions

View File

@ -31,7 +31,7 @@ directory
/* END LEGAL */ /* END LEGAL */
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
/*! @file Grid_vector_types.h /*! @file Grid_vector_types.h
@brief Defines templated class Grid_simd to deal with inner vector types @brief Defines templated class Grid_simd to deal with inner vector types
*/ */
// Time-stamp: <2015-07-10 17:45:33 neo> // Time-stamp: <2015-07-10 17:45:33 neo>
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
@ -62,7 +62,7 @@ directory
#include "l1p.h" #include "l1p.h"
namespace Grid { NAMESPACE_BEGIN(Grid);
////////////////////////////////////// //////////////////////////////////////
// To take the floating point type of real/complex type // To take the floating point type of real/complex type
@ -125,10 +125,10 @@ Out unary(Input src, Operation op) {
/* /*
@brief Grid_simd class for the SIMD vector type operations @brief Grid_simd class for the SIMD vector type operations
*/ */
template <class Scalar_type, class Vector_type> template <class Scalar_type, class Vector_type>
class Grid_simd { class Grid_simd {
public: public:
typedef typename RealPart<Scalar_type>::type Real; typedef typename RealPart<Scalar_type>::type Real;
typedef Vector_type vector_type; typedef Vector_type vector_type;
typedef Scalar_type scalar_type; typedef Scalar_type scalar_type;
@ -427,9 +427,6 @@ class Grid_simd {
inline void putlane(const Scalar_type &S, int lane){ inline void putlane(const Scalar_type &S, int lane){
((Scalar_type*)&v)[lane] = S; ((Scalar_type*)&v)[lane] = S;
} }
}; // 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; }
@ -863,6 +860,7 @@ template <> struct is_simd<vInteger> : public std::true_type {};
template <typename T> using IfSimd = Invoke<std::enable_if<is_simd<T>::value, int> >; template <typename T> 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> >;
}
NAMESPACE_END(Grid);
#endif #endif

View File

@ -28,13 +28,13 @@ with this program; if not, write to the Free Software Foundation, Inc.,
See the full license in the file "LICENSE" in the top level distribution See the full license in the file "LICENSE" in the top level distribution
directory directory
*************************************************************************************/ *************************************************************************************/
/* END LEGAL */ /* END LEGAL */
#ifndef GRID_VECTOR_UNOPS #ifndef GRID_VECTOR_UNOPS
#define GRID_VECTOR_UNOPS #define GRID_VECTOR_UNOPS
#include <cmath> #include <cmath>
namespace Grid { NAMESPACE_BEGIN(Grid);
template <class scalar> template <class scalar>
struct SqrtRealFunctor { struct SqrtRealFunctor {
@ -201,23 +201,23 @@ struct OrOrFunctor {
//////////////////////////////// ////////////////////////////////
template <class S, class V> template <class S, class V>
inline Grid_simd<S, V> operator&(const Grid_simd<S, V> &x, inline Grid_simd<S, V> operator&(const Grid_simd<S, V> &x,
const Grid_simd<S, V> &y) { const Grid_simd<S, V> &y) {
return SimdApplyBinop(AndFunctor<S>(), x, y); return SimdApplyBinop(AndFunctor<S>(), x, y);
} }
template <class S, class V> template <class S, class V>
inline Grid_simd<S, V> operator&&(const Grid_simd<S, V> &x, inline Grid_simd<S, V> operator&&(const Grid_simd<S, V> &x,
const Grid_simd<S, V> &y) { const Grid_simd<S, V> &y) {
return SimdApplyBinop(AndAndFunctor<S>(), x, y); return SimdApplyBinop(AndAndFunctor<S>(), x, y);
} }
template <class S, class V> template <class S, class V>
inline Grid_simd<S, V> operator|(const Grid_simd<S, V> &x, inline Grid_simd<S, V> operator|(const Grid_simd<S, V> &x,
const Grid_simd<S, V> &y) { const Grid_simd<S, V> &y) {
return SimdApplyBinop(OrFunctor<S>(), x, y); return SimdApplyBinop(OrFunctor<S>(), x, y);
} }
template <class S, class V> template <class S, class V>
inline Grid_simd<S, V> operator||(const Grid_simd<S, V> &x, inline Grid_simd<S, V> operator||(const Grid_simd<S, V> &x,
const Grid_simd<S, V> &y) { const Grid_simd<S, V> &y) {
return SimdApplyBinop(OrOrFunctor<S>(), x, y); return SimdApplyBinop(OrOrFunctor<S>(), x, y);
} }
} NAMESPACE_END(Grid);
#endif #endif