Blaze 3.9
HasSIMDEqual.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_TYPETRAITS_HASSIMDEQUAL_H_
36#define _BLAZE_MATH_TYPETRAITS_HASSIMDEQUAL_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
45#include <blaze/util/Complex.h>
46#include <blaze/util/EnableIf.h>
51
52
53namespace blaze {
54
55//=================================================================================================
56//
57// CLASS DEFINITION
58//
59//=================================================================================================
60
61//*************************************************************************************************
66template< typename T1 // Type of the left-hand side operand
67 , typename T2 // Type of the right-hand side operand
68 , typename = void > // Restricting condition
69struct HasSIMDEqualHelper
70 : public FalseType
71{};
73//*************************************************************************************************
74
75
76//*************************************************************************************************
78template< typename T >
79struct HasSIMDEqualHelper< T, T, EnableIf_t< IsNumeric_v<T> && IsIntegral_v<T> > >
80 : public BoolConstant< ( bool( BLAZE_SSE2_MODE ) && sizeof(T) <= 4UL ) ||
81 ( bool( BLAZE_SSE4_MODE ) && sizeof(T) == 8UL ) ||
82 ( bool( BLAZE_AVX2_MODE ) ) ||
83 ( bool( BLAZE_MIC_MODE ) && sizeof(T) == 4UL ) ||
84 ( bool( BLAZE_AVX512BW_MODE ) && sizeof(T) <= 2UL ) ||
85 ( bool( BLAZE_AVX512F_MODE ) && sizeof(T) >= 4UL ) >
86{};
87
88template< typename T >
89struct HasSIMDEqualHelper< complex<T>, complex<T>, EnableIf_t< IsNumeric_v<T> && IsIntegral_v<T> > >
90 : public BoolConstant< ( bool( BLAZE_SSE2_MODE ) && sizeof(T) <= 4UL ) ||
91 ( bool( BLAZE_SSE4_MODE ) && sizeof(T) == 8UL ) ||
92 ( bool( BLAZE_AVX2_MODE ) ) ||
93 ( bool( BLAZE_MIC_MODE ) && sizeof(T) == 4UL ) ||
94 ( bool( BLAZE_AVX512BW_MODE ) && sizeof(T) <= 2UL ) ||
95 ( bool( BLAZE_AVX512F_MODE ) && sizeof(T) >= 4UL ) >
96{};
98//*************************************************************************************************
99
100
101//*************************************************************************************************
103#if !( BLAZE_AVX512F_MODE || BLAZE_MIC_MODE ) || !BLAZE_GNU_COMPILER
104template<>
105struct HasSIMDEqualHelper< float, float >
106 : public BoolConstant< bool( BLAZE_SSE_MODE ) ||
107 bool( BLAZE_AVX_MODE ) ||
108 bool( BLAZE_MIC_MODE ) ||
109 bool( BLAZE_AVX512F_MODE ) >
110{};
111
112template<>
113struct HasSIMDEqualHelper< complex<float>, complex<float> >
114 : public BoolConstant< bool( BLAZE_SSE_MODE ) ||
115 bool( BLAZE_AVX_MODE ) ||
116 bool( BLAZE_MIC_MODE ) ||
117 bool( BLAZE_AVX512F_MODE ) >
118{};
119
120template<>
121struct HasSIMDEqualHelper< double, double >
122 : public BoolConstant< bool( BLAZE_SSE2_MODE ) ||
123 bool( BLAZE_AVX_MODE ) ||
124 bool( BLAZE_MIC_MODE ) ||
125 bool( BLAZE_AVX512F_MODE ) >
126{};
127
128template<>
129struct HasSIMDEqualHelper< complex<double>, complex<double> >
130 : public BoolConstant< bool( BLAZE_SSE2_MODE ) ||
131 bool( BLAZE_AVX_MODE ) ||
132 bool( BLAZE_MIC_MODE ) ||
133 bool( BLAZE_AVX512F_MODE ) >
134{};
135#endif
137//*************************************************************************************************
138
139
140//*************************************************************************************************
161template< typename T1 // Type of the left-hand side operand
162 , typename T2 // Type of the right-hand side operand
163 , typename = void > // Restricting condition
165 : public BoolConstant< HasSIMDEqualHelper< RemoveCVRef_t<T1>, RemoveCVRef_t<T2> >::value >
166{};
167//*************************************************************************************************
168
169
170//*************************************************************************************************
183template< typename T1 // Type of the left-hand side operand
184 , typename T2 > // Type of the right-hand side operand
186//*************************************************************************************************
187
188} // namespace blaze
189
190#endif
Compiler-specific system settings.
Header file for the complex data type.
Header file for the EnableIf class template.
Header file for the IntegralConstant class template.
Header file for the IsIntegral type trait.
Header file for the IsNumeric type trait.
Header file for the RemoveCVRef type trait.
Complex data type of the Blaze library.
constexpr bool HasSIMDEqual_v
Auxiliary variable template for the HasSIMDEqual type trait.
Definition: HasSIMDEqual.h:185
#define BLAZE_AVX512F_MODE
Compilation switch for the AVX512F mode.
Definition: Vectorization.h:246
#define BLAZE_SSE4_MODE
Compilation switch for the SSE4 mode.
Definition: Vectorization.h:194
#define BLAZE_AVX512BW_MODE
Compilation switch for the AVX512BW mode.
Definition: Vectorization.h:264
#define BLAZE_AVX2_MODE
Compilation switch for the AVX2 mode.
Definition: Vectorization.h:228
#define BLAZE_MIC_MODE
Compilation switch for the MIC mode.
Definition: Vectorization.h:299
#define BLAZE_SSE2_MODE
Compilation switch for the SSE2 mode.
Definition: Vectorization.h:143
constexpr bool IsNumeric_v
Auxiliary variable template for the IsNumeric type trait.
Definition: IsNumeric.h:132
BoolConstant< false > FalseType
Type/value traits base class.
Definition: IntegralConstant.h:121
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition: EnableIf.h:138
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.
Definition: IntegralConstant.h:110
Availability of a SIMD equality comparison for the given data types.
Definition: HasSIMDEqual.h:166
Generic wrapper for a compile time constant integral value.
Definition: IntegralConstant.h:74
System settings for the SSE mode.