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>
47 #include <blaze/util/mpl/And.h>
52 
53 
54 namespace blaze {
55 
56 //=================================================================================================
57 //
58 // CLASS DEFINITION
59 //
60 //=================================================================================================
61 
62 //*************************************************************************************************
64 template< typename T1 // Type of the left-hand side operand
65  , typename T2 // Type of the right-hand side operand
66  , typename = void > // Restricting condition
67 struct HasSIMDDivHelper
68 {
69  enum : bool { value = false };
70 };
72 //*************************************************************************************************
73 
74 
75 //*************************************************************************************************
77 template< typename T1, typename T2 >
78 struct HasSIMDDivHelper< T1, T2, EnableIf_< And< IsNumeric<T1>, IsIntegral<T1>, IsSigned<T1>
79  , IsNumeric<T2>, IsIntegral<T2>, IsSigned<T2>
80  , Bool< sizeof(T1) == sizeof(T2) > > > >
81 {
82  enum : bool { value = bool( BLAZE_MIC_MODE ) && sizeof(T1) >= 4UL };
83 };
84 
85 template< typename T >
86 struct HasSIMDDivHelper< complex<T>, T, EnableIf_< And< IsNumeric<T>, IsIntegral<T>, IsSigned<T> > > >
87 {
88  enum : bool { value = bool( BLAZE_MIC_MODE ) && sizeof(T) >= 4UL };
89 };
91 //*************************************************************************************************
92 
93 
94 //*************************************************************************************************
96 template<>
97 struct HasSIMDDivHelper< float, float >
98 {
99  enum : bool { value = bool( BLAZE_SSE_MODE ) ||
100  bool( BLAZE_AVX_MODE ) ||
101  bool( BLAZE_MIC_MODE ) };
102 };
104 //*************************************************************************************************
105 
106 
107 //*************************************************************************************************
109 template<>
110 struct HasSIMDDivHelper< double, double >
111 {
112  enum : bool { value = bool( BLAZE_SSE2_MODE ) ||
113  bool( BLAZE_AVX_MODE ) ||
114  bool( BLAZE_MIC_MODE ) };
115 };
117 //*************************************************************************************************
118 
119 
120 //*************************************************************************************************
141 template< typename T1 // Type of the left-hand side operand
142  , typename T2 // Type of the right-hand side operand
143  , typename = void > // Restricting condition
144 struct HasSIMDDiv : public BoolConstant< HasSIMDDivHelper< Decay_<T1>, Decay_<T2> >::value >
145 {};
146 //*************************************************************************************************
147 
148 } // namespace blaze
149 
150 #endif
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
#define BLAZE_MIC_MODE
Compilation switch for the MIC mode.This compilation switch enables/disables the MIC mode...
Definition: Vectorization.h:248
Header file for the IsIntegral type trait.
Header file for the And class template.
Header file for the Decay type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Availability of a SIMD division for the given data types.Depending on the available instruction set (...
Definition: HasSIMDDiv.h:144
#define BLAZE_SSE_MODE
Compilation switch for the SSE mode.This compilation switch enables/disables the SSE mode...
Definition: Vectorization.h:129
Header file for the EnableIf class template.
Header file for the IsNumeric type trait.
#define BLAZE_AVX_MODE
Compilation switch for the AVX mode.This compilation switch enables/disables the AVX mode...
Definition: Vectorization.h:214
Header file for the IsSigned type trait.
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:223
Header file for the IntegralConstant class template.
System settings for the SSE mode.
Header file for the complex data type.
#define BLAZE_SSE2_MODE
Compilation switch for the SSE2 mode.This compilation switch enables/disables the SSE2 mode...
Definition: Vectorization.h:146