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 { using Type = BT ; };
71  //**********************************************************************************************
72 
73  //**struct Complex******************************************************************************
74  template< typename CT >
75  struct Complex { using Type = typename CT::value_type; };
76  //**********************************************************************************************
77 
78  //**********************************************************************************************
79  using T2 = typename If_< IsComplex<T>, Complex<T>, Builtin<T> >::Type;
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_AVX512BW_MODE ) && IsNumeric<T2>::value ) ||
88  && IsNumeric<T2>::value && sizeof(T2) >= 4UL ) };
89  //**********************************************************************************************
90 };
92 //*************************************************************************************************
93 
94 
95 //*************************************************************************************************
100 template<>
101 struct IsVectorizableHelper<void>
102 {
103  public:
104  //**********************************************************************************************
105  enum : bool { value = false };
106  //**********************************************************************************************
107 };
109 //*************************************************************************************************
110 
111 
112 //*************************************************************************************************
134 template< typename T >
136  : public BoolConstant< IsVectorizableHelper< RemoveCV_<T> >::value >
137 {};
138 //*************************************************************************************************
139 
140 } // namespace blaze
141 
142 #endif
Compile time check for vectorizable types.Depending on the available instruction set (SSE...
Definition: IsVectorizable.h:135
#define BLAZE_AVX512F_MODE
Compilation switch for the AVX512F mode.This compilation switch enables/disables the AVX512F mode...
Definition: Vectorization.h:246
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:299
#define BLAZE_AVX512BW_MODE
Compilation switch for the AVX512BW mode.This compilation switch enables/disables the AVX512BW mode...
Definition: Vectorization.h:264
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:126
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:143