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 
30 #include <blaze/system/SSE.h>
31 #include <blaze/util/FalseType.h>
32 #include <blaze/util/SelectType.h>
33 #include <blaze/util/TrueType.h>
37 
38 
39 namespace blaze {
40 
41 //=================================================================================================
42 //
43 // CLASS DEFINITION
44 //
45 //=================================================================================================
46 
47 //*************************************************************************************************
52 template< typename T >
53 struct IsVectorizableHelper
54 {
55  //**********************************************************************************************
56  enum { value = ( BLAZE_SSE_MODE && ( IsFloat<T>::value || IsDouble<T>::value ) ) ||
57  ( BLAZE_SSE2_MODE && ( IsIntegral<T>::value && sizeof(T) >= 2UL ) ) ||
58  ( BLAZE_MIC_MODE && ( ( IsIntegral<T>::value && sizeof(T) >= 4UL ) || IsFloat<T>::value || IsDouble<T>::value ) ) };
59  typedef typename SelectType<value,TrueType,FalseType>::Type Type;
60  //**********************************************************************************************
61 };
63 //*************************************************************************************************
64 
65 
66 //*************************************************************************************************
88 template< typename T >
89 struct IsVectorizable : public IsVectorizableHelper<T>::Type
90 {
91  public:
92  //**********************************************************************************************
94  enum { value = IsVectorizableHelper<T>::value };
95  typedef typename IsVectorizableHelper<T>::Type Type;
97  //**********************************************************************************************
98 };
99 //*************************************************************************************************
100 
101 } // namespace blaze
102 
103 #endif