Blaze
3.9
Toggle main menu visibility
Loading...
Searching...
No Matches
blaze
util
typetraits
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
43
#include <
blaze/system/Vectorization.h
>
44
#include <
blaze/util/Complex.h
>
45
#include <
blaze/util/typetraits/IsFloat.h
>
46
#include <
blaze/util/typetraits/IsNumeric.h
>
47
#include <
blaze/util/typetraits/RemoveCV.h
>
48
49
50
namespace
blaze {
51
52
//=================================================================================================
53
//
54
// CLASS DEFINITION
55
//
56
//=================================================================================================
57
58
//*************************************************************************************************
63
template
<
typename
T >
64
struct
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> ) ||
72
(
bool
(
BLAZE_AVX512F_MODE
||
BLAZE_MIC_MODE
)
73
&& IsNumeric_v<T> &&
sizeof
(T) >= 4UL ) );
74
//**********************************************************************************************
75
};
77
//*************************************************************************************************
78
79
80
//*************************************************************************************************
85
template
<
typename
T >
86
struct
IsVectorizableHelper< complex<T> >
87
{
88
public
:
89
//**********************************************************************************************
90
static
constexpr
bool
value = IsVectorizableHelper< RemoveCV_t<T> >::value;
91
//**********************************************************************************************
92
};
94
//*************************************************************************************************
95
96
97
//*************************************************************************************************
102
template
<>
103
struct
IsVectorizableHelper<void>
104
{
105
public
:
106
//**********************************************************************************************
107
static
constexpr
bool
value =
false
;
108
//**********************************************************************************************
109
};
111
//*************************************************************************************************
112
113
114
//*************************************************************************************************
136
template
<
typename
T >
137
struct
IsVectorizable
138
:
public
BoolConstant
< IsVectorizableHelper< RemoveCV_t<T> >::value >
139
{};
140
//*************************************************************************************************
141
142
143
//*************************************************************************************************
156
template
<
typename
T >
157
constexpr
bool
IsVectorizable_v
=
IsVectorizable<T>::value
;
158
//*************************************************************************************************
159
160
}
// namespace blaze
161
162
#endif
Complex.h
Header file for the complex data type.
IsFloat.h
Header file for the IsFloat type trait.
IsNumeric.h
Header file for the IsNumeric type trait.
RemoveCV.h
Header file for the RemoveCV type trait.
BLAZE_AVX512F_MODE
#define BLAZE_AVX512F_MODE
Compilation switch for the AVX512F mode.
Definition
Vectorization.h:246
BLAZE_AVX512BW_MODE
#define BLAZE_AVX512BW_MODE
Compilation switch for the AVX512BW mode.
Definition
Vectorization.h:264
BLAZE_MIC_MODE
#define BLAZE_MIC_MODE
Compilation switch for the MIC mode.
Definition
Vectorization.h:299
BLAZE_SSE_MODE
#define BLAZE_SSE_MODE
Compilation switch for the SSE mode.
Definition
Vectorization.h:126
BLAZE_SSE2_MODE
#define BLAZE_SSE2_MODE
Compilation switch for the SSE2 mode.
Definition
Vectorization.h:143
blaze::IsVectorizable_v
constexpr bool IsVectorizable_v
Auxiliary variable template for the IsVectorizable type trait.
Definition
IsVectorizable.h:157
blaze::BoolConstant
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.
Definition
IntegralConstant.h:110
blaze::IsVectorizable
Compile time check for vectorizable types.
Definition
IsVectorizable.h:139
Vectorization.h
System settings for the SSE mode.
Generated by
1.18.0