Blaze  3.6
HasSIMDDiv.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TYPETRAITS_HASSIMDDIV_H_
36 #define _BLAZE_MATH_TYPETRAITS_HASSIMDDIV_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
44 #include <blaze/util/Complex.h>
45 #include <blaze/util/EnableIf.h>
51 
52 
53 namespace blaze {
54 
55 //=================================================================================================
56 //
57 // CLASS DEFINITION
58 //
59 //=================================================================================================
60 
61 //*************************************************************************************************
66 template< typename T1 // Type of the left-hand side operand
67  , typename T2 // Type of the right-hand side operand
68  , typename = void > // Restricting condition
69 struct HasSIMDDivHelper
70  : public FalseType
71 {};
73 //*************************************************************************************************
74 
75 
76 //*************************************************************************************************
78 template< typename T1, typename T2 >
79 struct HasSIMDDivHelper< T1, T2, EnableIf_t< IsNumeric_v<T1> && IsIntegral_v<T1> &&
80  IsSigned_v<T1> && IsNumeric_v<T2> &&
81  IsIntegral_v<T2> && IsSigned_v<T2> &&
82  sizeof(T1) == sizeof(T2) > >
83  : public BoolConstant< bool( BLAZE_SVML_MODE ) &&
84  ( ( bool( BLAZE_MIC_MODE ) && sizeof(T1) >= 4UL ) ||
85  ( bool( BLAZE_AVX512BW_MODE ) && sizeof(T1) <= 2UL ) ||
86  ( bool( BLAZE_AVX512F_MODE ) && sizeof(T1) >= 4UL ) ) >
87 {};
88 
89 template< typename T >
90 struct HasSIMDDivHelper< complex<T>, T, EnableIf_t< IsNumeric_v<T> && IsIntegral_v<T> && IsSigned_v<T> > >
91  : public BoolConstant< bool( BLAZE_SVML_MODE ) &&
92  ( ( bool( BLAZE_MIC_MODE ) && sizeof(T) >= 4UL ) ||
93  ( bool( BLAZE_AVX512BW_MODE ) && sizeof(T) <= 2UL ) ||
94  ( bool( BLAZE_AVX512F_MODE ) && sizeof(T) >= 4UL ) ) >
95 {};
97 //*************************************************************************************************
98 
99 
100 //*************************************************************************************************
102 template<>
103 struct HasSIMDDivHelper< float, float >
104  : public BoolConstant< bool( BLAZE_SSE_MODE ) ||
105  bool( BLAZE_AVX_MODE ) ||
106  bool( BLAZE_MIC_MODE ) ||
107  bool( BLAZE_AVX512F_MODE ) >
108 {};
110 //*************************************************************************************************
111 
112 
113 //*************************************************************************************************
115 template<>
116 struct HasSIMDDivHelper< double, double >
117  : public BoolConstant< bool( BLAZE_SSE2_MODE ) ||
118  bool( BLAZE_AVX_MODE ) ||
119  bool( BLAZE_MIC_MODE ) ||
120  bool( BLAZE_AVX512F_MODE ) >
121 {};
123 //*************************************************************************************************
124 
125 
126 //*************************************************************************************************
147 template< typename T1 // Type of the left-hand side operand
148  , typename T2 // Type of the right-hand side operand
149  , typename = void > // Restricting condition
151  : public BoolConstant< HasSIMDDivHelper< RemoveCVRef_t<T1>, RemoveCVRef_t<T2> >::value >
152 {};
153 //*************************************************************************************************
154 
155 
156 //*************************************************************************************************
169 template< typename T1 // Type of the left-hand side operand
170  , typename T2 > // Type of the right-hand side operand
172 //*************************************************************************************************
173 
174 } // namespace blaze
175 
176 #endif
BoolConstant< false > FalseType
Type/value traits base class.The FalseType class is used as base class for type traits and value trai...
Definition: IntegralConstant.h:121
#define BLAZE_AVX512F_MODE
Compilation switch for the AVX512F mode.This compilation switch enables/disables the AVX512F mode....
Definition: Vectorization.h:246
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:72
#define BLAZE_MIC_MODE
Compilation switch for the MIC mode.This compilation switch enables/disables the MIC mode....
Definition: Vectorization.h:299
#define BLAZE_AVX512BW_MODE
Compilation switch for the AVX512BW mode.This compilation switch enables/disables the AVX512BW mode....
Definition: Vectorization.h:264
Header file for the RemoveCVRef type trait.
Header file for the IsIntegral type trait.
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
constexpr bool IsNumeric_v
Auxiliary variable template for the IsNumeric type trait.The IsNumeric_v variable template provides a...
Definition: IsNumeric.h:143
Availability of a SIMD division for the given data types.Depending on the available instruction set (...
Definition: HasSIMDDiv.h:150
constexpr bool HasSIMDDiv_v
Auxiliary variable template for the HasSIMDDiv type trait.The HasSIMDDiv_v variable template provides...
Definition: HasSIMDDiv.h:171
Header file for the EnableIf class template.
Header file for the IsNumeric type trait.
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant alias template represents ...
Definition: IntegralConstant.h:110
Header file for the IsSigned type trait.
#define BLAZE_SVML_MODE
Compilation switch for the SVML mode.This compilation switch enables/disables the SVML mode....
Definition: Vectorization.h:349
Header file for the IntegralConstant class template.
System settings for the SSE mode.
Header file for the complex data type.