Blaze
3.9
Toggle main menu visibility
Loading...
Searching...
No Matches
blaze
math
typetraits
IsSIMDEnabled.h
Go to the documentation of this file.
1
//=================================================================================================
33
//=================================================================================================
34
35
#ifndef _BLAZE_MATH_TYPETRAITS_ISSIMDENABLED_H_
36
#define _BLAZE_MATH_TYPETRAITS_ISSIMDENABLED_H_
37
38
39
//*************************************************************************************************
40
// Includes
41
//*************************************************************************************************
42
43
#include <
blaze/util/IntegralConstant.h
>
44
#include <
blaze/util/typetraits/AlwaysFalse.h
>
45
#include <
blaze/util/typetraits/HasMember.h
>
46
47
48
namespace
blaze {
49
50
//=================================================================================================
51
//
52
// CLASS DEFINITION
53
//
54
//=================================================================================================
55
56
//*************************************************************************************************
61
BLAZE_CREATE_HAS_DATA_OR_FUNCTION_MEMBER_TYPE_TRAIT
( HasSIMDEnabled, simdEnabled );
63
//*************************************************************************************************
64
65
66
//*************************************************************************************************
71
template
<
typename
T,
typename
... Args >
72
struct
GetSIMDEnabled {
73
static
constexpr
bool
test(
bool
(*fnc)() ) {
return
fnc(); }
74
static
constexpr
bool
test(
bool
b ) {
return
b; }
75
static
constexpr
bool
value = test( T::template simdEnabled<Args...> );
76
};
78
//*************************************************************************************************
79
80
81
//*************************************************************************************************
86
template
<
typename
T >
87
struct
GetSIMDEnabled<T> {
88
static
constexpr
bool
test(
bool
(*fnc)() ) {
return
fnc(); }
89
static
constexpr
bool
test(
bool
b ) {
return
b; }
90
static
constexpr
bool
value = test( T::simdEnabled );
91
};
93
//*************************************************************************************************
94
95
96
//*************************************************************************************************
106
template
<
typename
T,
typename
... Args >
107
struct
IsSIMDEnabled
108
:
public
BoolConstant
< If_t< HasSIMDEnabled_v<T>
109
, GetSIMDEnabled<T,Args...>
110
, AlwaysFalse<T> >::value >
111
{};
112
//*************************************************************************************************
113
114
115
//*************************************************************************************************
128
template
<
typename
T,
typename
... Args >
129
constexpr
bool
IsSIMDEnabled_v
=
IsSIMDEnabled
<T,Args...>::value;
130
//*************************************************************************************************
131
132
}
// namespace blaze
133
134
#endif
AlwaysFalse.h
Header file for the AlwaysFalse type trait.
HasMember.h
Header file for the HasMember type traits.
IntegralConstant.h
Header file for the IntegralConstant class template.
blaze::BLAZE_CREATE_HAS_DATA_OR_FUNCTION_MEMBER_TYPE_TRAIT
BLAZE_CREATE_HAS_DATA_OR_FUNCTION_MEMBER_TYPE_TRAIT(HasLoad, load)
Compile time check for data types.
blaze::IsSIMDEnabled_v
constexpr bool IsSIMDEnabled_v
Auxiliary variable template for the IsSIMDEnabled type trait.
Definition
IsSIMDEnabled.h:129
blaze::BoolConstant
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.
Definition
IntegralConstant.h:110
blaze::IsSIMDEnabled
Compile time check for data types.
Definition
IsSIMDEnabled.h:111
Generated by
1.18.0