All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IsVectorizable.h
Go to the documentation of this file.
1 //=================================================================================================
20 //=================================================================================================
21 
22 #ifndef _BLAZE_UTIL_TYPETRAITS_ISVECTORIZABLE_H_
23 #define _BLAZE_UTIL_TYPETRAITS_ISVECTORIZABLE_H_
24 
25 
26 //*************************************************************************************************
27 // Includes
28 //*************************************************************************************************
29 
31 #include <blaze/util/Complex.h>
32 #include <blaze/util/FalseType.h>
33 #include <blaze/util/SelectType.h>
34 #include <blaze/util/TrueType.h>
39 
40 
41 namespace blaze {
42 
43 //=================================================================================================
44 //
45 // CLASS DEFINITION
46 //
47 //=================================================================================================
48 
49 //*************************************************************************************************
54 template< typename T >
55 struct IsVectorizableHelper
56 {
57  //**********************************************************************************************
58  enum { value = ( BLAZE_SSE_MODE && ( IsFloat<T>::value || IsSame<complex<float>,T>::value ) ) ||
59  ( BLAZE_SSE2_MODE && ( IsDouble<T>::value || IsSame<complex<double>,T>::value ) ) ||
60  ( BLAZE_SSE2_MODE && ( IsIntegral<T>::value && sizeof(T) >= 2UL ) ) ||
61  ( BLAZE_MIC_MODE && ( ( IsIntegral<T>::value && sizeof(T) >= 4UL ) || IsFloat<T>::value || IsDouble<T>::value ) ) };
62  typedef typename SelectType<value,TrueType,FalseType>::Type Type;
63  //**********************************************************************************************
64 };
66 //*************************************************************************************************
67 
68 
69 //*************************************************************************************************
91 template< typename T >
92 struct IsVectorizable : public IsVectorizableHelper<T>::Type
93 {
94  public:
95  //**********************************************************************************************
97  enum { value = IsVectorizableHelper<T>::value };
98  typedef typename IsVectorizableHelper<T>::Type Type;
100  //**********************************************************************************************
101 };
102 //*************************************************************************************************
103 
104 } // namespace blaze
105 
106 #endif