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 
44 #include <blaze/util/Template.h>
47 
48 
49 namespace blaze {
50 
51 //=================================================================================================
52 //
53 // CLASS DEFINITION
54 //
55 //=================================================================================================
56 
57 //*************************************************************************************************
62 BLAZE_CREATE_HAS_DATA_OR_FUNCTION_MEMBER_TYPE_TRAIT( HasSIMDEnabled, simdEnabled );
64 //*************************************************************************************************
65 
66 
67 //*************************************************************************************************
72 template< typename T, typename... Args >
73 struct GetSIMDEnabled {
74  static constexpr bool test( bool (*fnc)() ) { return fnc(); }
75  static constexpr bool test( bool b ) { return b; }
76  static constexpr bool value = test( T::BLAZE_TEMPLATE simdEnabled<Args...> );
77 };
79 //*************************************************************************************************
80 
81 
82 //*************************************************************************************************
87 template< typename T >
88 struct GetSIMDEnabled<T> {
89  static constexpr bool test( bool (*fnc)() ) { return fnc(); }
90  static constexpr bool test( bool b ) { return b; }
91  static constexpr bool value = test( T::simdEnabled );
92 };
94 //*************************************************************************************************
95 
96 
97 //*************************************************************************************************
107 template< typename T, typename... Args >
109  : public BoolConstant< If_t< HasSIMDEnabled_v<T>
110  , GetSIMDEnabled<T,Args...>
111  , AlwaysFalse<T> >::value >
112 {};
113 //*************************************************************************************************
114 
115 
116 //*************************************************************************************************
129 template< typename T, typename... Args >
130 constexpr bool IsSIMDEnabled_v = IsSIMDEnabled<T,Args...>::value;
131 //*************************************************************************************************
132 
133 } // namespace blaze
134 
135 #endif
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for nested template disabiguation.
constexpr bool IsSIMDEnabled_v
Auxiliary variable template for the IsSIMDEnabled type trait.The IsSIMDEnabled_v variable template pr...
Definition: IsSIMDEnabled.h:130
Header file for the HasMember type traits.
Header file for the AlwaysFalse type trait.
Header file for the IntegralConstant class template.
BLAZE_CREATE_HAS_DATA_OR_FUNCTION_MEMBER_TYPE_TRAIT(HasLoad, load)
Compile time check for data types.This type trait provides the information whether the given data typ...
Compile time check for data types.This type trait tests whether or not the given data type T is a SIM...
Definition: IsSIMDEnabled.h:108