IsSIMDEnabled.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TYPETRAITS_ISSIMDENABLED_H_
36 #define _BLAZE_MATH_TYPETRAITS_ISSIMDENABLED_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
46 #include <blaze/util/mpl/If.h>
47 #include <blaze/util/mpl/Or.h>
48 
49 
50 namespace blaze {
51 
52 //=================================================================================================
53 //
54 // CLASS DEFINITION
55 //
56 //=================================================================================================
57 
58 //*************************************************************************************************
63 template< typename T >
64 struct IsSIMDEnabledHelper
65 {
66  private:
67  //**struct HasNestedMember**********************************************************************
68  template< typename T2 >
69  struct UseNestedMember { enum : bool { value = T2::simdEnabled }; };
70  //**********************************************************************************************
71 
72  //**struct NotSIMDEnabled***********************************************************************
73  template< typename T2 >
74  struct NotSIMDEnabled { enum : bool { value = false }; };
75  //**********************************************************************************************
76 
77  public:
78  //**********************************************************************************************
79  enum : bool { value = If_< Or< IsVector<T>, IsMatrix<T> >
80  , UseNestedMember<T>
81  , NotSIMDEnabled<T>
82  >::value };
83  //**********************************************************************************************
84 };
86 //*************************************************************************************************
87 
88 
89 //*************************************************************************************************
99 template< typename T >
101  : public BoolConstant< IsSIMDEnabledHelper<T>::value >
102 {};
103 //*************************************************************************************************
104 
105 } // namespace blaze
106 
107 #endif
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
Header file for the IsMatrix type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for the If class template.
Header file for the Or class template.
Header file for the IsVector type trait.
Header file for the IntegralConstant class template.
Compile time check for data types.This type trait tests whether or not the given data type T is a SIM...
Definition: IsSIMDEnabled.h:100