IsVectorizable.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_UTIL_TYPETRAITS_ISVECTORIZABLE_H_
36 #define _BLAZE_UTIL_TYPETRAITS_ISVECTORIZABLE_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
44 #include <blaze/util/mpl/If.h>
49 
50 
51 namespace blaze {
52 
53 //=================================================================================================
54 //
55 // CLASS DEFINITION
56 //
57 //=================================================================================================
58 
59 //*************************************************************************************************
64 template< typename T >
65 struct IsVectorizableHelper
66 {
67  private:
68  //**struct Builtin******************************************************************************
69  template< typename BT >
70  struct Builtin { typedef BT Type; };
71  //**********************************************************************************************
72 
73  //**struct Complex******************************************************************************
74  template< typename CT >
75  struct Complex { typedef typename CT::value_type Type; };
76  //**********************************************************************************************
77 
78  //**********************************************************************************************
79  typedef typename If_< IsComplex<T>, Complex<T>, Builtin<T> >::Type T2;
80  //**********************************************************************************************
81 
82  public:
83  //**********************************************************************************************
84  enum : bool { value = ( bool( BLAZE_SSE_MODE ) && IsFloat<T2>::value ) ||
85  ( bool( BLAZE_SSE2_MODE ) && IsNumeric<T2>::value ) ||
86  ( bool( BLAZE_MIC_MODE ) && IsNumeric<T2>::value && sizeof(T2) >= 4UL ) };
87  //**********************************************************************************************
88 };
90 //*************************************************************************************************
91 
92 
93 //*************************************************************************************************
98 template<>
99 struct IsVectorizableHelper<void>
100 {
101  public:
102  //**********************************************************************************************
103  enum : bool { value = false };
104  //**********************************************************************************************
105 };
107 //*************************************************************************************************
108 
109 
110 //*************************************************************************************************
132 template< typename T >
133 struct IsVectorizable : public BoolConstant< IsVectorizableHelper< RemoveCV_<T> >::value >
134 {};
135 //*************************************************************************************************
136 
137 } // namespace blaze
138 
139 #endif
Compile time check for vectorizable types.Depending on the available instruction set (SSE...
Definition: IsVectorizable.h:133
Header file for the RemoveCV type trait.
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
#define BLAZE_MIC_MODE
Compilation switch for the MIC mode.This compilation switch enables/disables the MIC mode...
Definition: Vectorization.h:248
Header file for the IsFloat type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the If class template.
#define BLAZE_SSE_MODE
Compilation switch for the SSE mode.This compilation switch enables/disables the SSE mode...
Definition: Vectorization.h:129
Header file for the IsNumeric type trait.
Header file for the IsComplex type trait.
System settings for the SSE mode.
#define BLAZE_SSE2_MODE
Compilation switch for the SSE2 mode.This compilation switch enables/disables the SSE2 mode...
Definition: Vectorization.h:146