Blaze 3.9
Loading...
Searching...
No Matches
IsVectorizable.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_UTIL_TYPETRAITS_ISVECTORIZABLE_H_
36#define _BLAZE_UTIL_TYPETRAITS_ISVECTORIZABLE_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
44#include <blaze/util/Complex.h>
48
49
50namespace blaze {
51
52//=================================================================================================
53//
54// CLASS DEFINITION
55//
56//=================================================================================================
57
58//*************************************************************************************************
63template< typename T >
64struct IsVectorizableHelper
65{
66 public:
67 //**********************************************************************************************
68 static constexpr bool value = ( sizeof(T) <= 8UL ) &&
69 ( ( bool( BLAZE_SSE_MODE ) && IsFloat_v<T> ) ||
70 ( bool( BLAZE_SSE2_MODE ) && IsNumeric_v<T> ) ||
71 ( bool( BLAZE_AVX512BW_MODE ) && IsNumeric_v<T> ) ||
73 && IsNumeric_v<T> && sizeof(T) >= 4UL ) );
74 //**********************************************************************************************
75};
77//*************************************************************************************************
78
79
80//*************************************************************************************************
85template< typename T >
86struct IsVectorizableHelper< complex<T> >
87{
88 public:
89 //**********************************************************************************************
90 static constexpr bool value = IsVectorizableHelper< RemoveCV_t<T> >::value;
91 //**********************************************************************************************
92};
94//*************************************************************************************************
95
96
97//*************************************************************************************************
102template<>
103struct IsVectorizableHelper<void>
104{
105 public:
106 //**********************************************************************************************
107 static constexpr bool value = false;
108 //**********************************************************************************************
109};
111//*************************************************************************************************
112
113
114//*************************************************************************************************
136template< typename T >
138 : public BoolConstant< IsVectorizableHelper< RemoveCV_t<T> >::value >
139{};
140//*************************************************************************************************
141
142
143//*************************************************************************************************
156template< typename T >
158//*************************************************************************************************
159
160} // namespace blaze
161
162#endif
Header file for the complex data type.
Header file for the IsFloat type trait.
Header file for the IsNumeric type trait.
Header file for the RemoveCV type trait.
#define BLAZE_AVX512F_MODE
Compilation switch for the AVX512F mode.
Definition Vectorization.h:246
#define BLAZE_AVX512BW_MODE
Compilation switch for the AVX512BW mode.
Definition Vectorization.h:264
#define BLAZE_MIC_MODE
Compilation switch for the MIC mode.
Definition Vectorization.h:299
#define BLAZE_SSE_MODE
Compilation switch for the SSE mode.
Definition Vectorization.h:126
#define BLAZE_SSE2_MODE
Compilation switch for the SSE2 mode.
Definition Vectorization.h:143
constexpr bool IsVectorizable_v
Auxiliary variable template for the IsVectorizable type trait.
Definition IsVectorizable.h:157
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.
Definition IntegralConstant.h:110
Compile time check for vectorizable types.
Definition IsVectorizable.h:139
System settings for the SSE mode.