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/Complex.h>
45 #include <blaze/util/FalseType.h>
46 #include <blaze/util/SelectType.h>
47 #include <blaze/util/TrueType.h>
53 
54 
55 namespace blaze {
56 
57 //=================================================================================================
58 //
59 // CLASS DEFINITION
60 //
61 //=================================================================================================
62 
63 //*************************************************************************************************
68 template< typename T >
69 struct IsVectorizableHelper
70 {
71  //**********************************************************************************************
72  enum { value = ( BLAZE_SSE_MODE && ( IsFloat<T>::value || IsSame<complex<float>,T>::value ) ) ||
73  ( BLAZE_SSE2_MODE && ( IsDouble<T>::value || IsSame<complex<double>,T>::value ) ) ||
74  ( BLAZE_SSE2_MODE && ( IsNumeric<T>::value ) ) ||
75  ( BLAZE_MIC_MODE && ( IsIntegral<T>::value && sizeof(T) >= 4UL ) ) ||
76  ( BLAZE_MIC_MODE && ( IsFloat<T>::value || IsSame<complex<float>,T>::value ) ) ||
77  ( BLAZE_MIC_MODE && ( IsDouble<T>::value || IsSame<complex<double>,T>::value ) ) };
78  typedef typename SelectType<value,TrueType,FalseType>::Type Type;
79  //**********************************************************************************************
80 };
82 //*************************************************************************************************
83 
84 
85 //*************************************************************************************************
107 template< typename T >
108 struct IsVectorizable : public IsVectorizableHelper<T>::Type
109 {
110  public:
111  //**********************************************************************************************
113  enum { value = IsVectorizableHelper<T>::value };
114  typedef typename IsVectorizableHelper<T>::Type Type;
116  //**********************************************************************************************
117 };
118 //*************************************************************************************************
119 
120 } // namespace blaze
121 
122 #endif
Compile time check for vectorizable types.Depending on the available instruction set (SSE...
Definition: IsVectorizable.h:108
Header file for the FalseType type/value trait base class.
#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 IsSame and IsStrictlySame type traits.
Header file for the IsIntegral type trait.
Header file for the IsFloat type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the IsDouble type trait.
#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 SelectType class template.
Header file for the IsNumeric type trait.
System settings for the SSE mode.
Header file for the complex data type.
#define BLAZE_SSE2_MODE
Compilation switch for the SSE2 mode.This compilation switch enables/disables the SSE2 mode...
Definition: Vectorization.h:146
Header file for the TrueType type/value trait base class.