Blaze 3.9
IsSIMDCombinable.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_TYPETRAITS_ISSIMDCOMBINABLE_H_
36#define _BLAZE_MATH_TYPETRAITS_ISSIMDCOMBINABLE_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
46
47
48namespace blaze {
49
50//=================================================================================================
51//
52// CLASS DEFINITION
53//
54//=================================================================================================
55
56//*************************************************************************************************
61template< typename T1
62 , typename T2
63 , typename... Ts >
64struct IsSIMDCombinableHelper
65 : public BoolConstant< IsSIMDCombinableHelper<T1,T2>::value &&
66 IsSIMDCombinableHelper<T2,Ts...>::value >
67{};
69//*************************************************************************************************
70
71
72//*************************************************************************************************
74
75template< typename T >
76struct IsSIMDCombinableHelper<T,T>
77 : public BoolConstant< IsNumeric_v<T> >
78{};
80//*************************************************************************************************
81
82
83//*************************************************************************************************
85
86template< typename T1, typename T2 >
87struct IsSIMDCombinableHelper<T1,T2>
88 : public BoolConstant< IsNumeric_v<T1> && IsIntegral_v<T1> &&
89 IsNumeric_v<T2> && IsIntegral_v<T2> &&
90 sizeof(T1) == sizeof(T2) >
91{};
93//*************************************************************************************************
94
95
96//*************************************************************************************************
116template< typename T1, typename T2, typename... Ts >
118 : public BoolConstant< IsSIMDCombinableHelper< T1, T2, Ts... >::value >
119{};
120//*************************************************************************************************
121
122
123//*************************************************************************************************
136template< typename T1, typename T2, typename... Ts >
137constexpr bool IsSIMDCombinable_v = IsSIMDCombinable<T1,T2,Ts...>::value;
138//*************************************************************************************************
139
140} // namespace blaze
141
142#endif
Header file for the IntegralConstant class template.
Header file for the IsIntegral type trait.
Header file for the IsNumeric type trait.
constexpr bool IsSIMDCombinable_v
Auxiliary variable template for the IsSIMDCombinable type trait.
Definition: IsSIMDCombinable.h:137
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.
Definition: IntegralConstant.h:110
Generic wrapper for a compile time constant integral value.
Definition: IntegralConstant.h:74
Compile time check for data types.
Definition: IsSIMDCombinable.h:119