Blaze  3.6
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 
48 namespace blaze {
49 
50 //=================================================================================================
51 //
52 // CLASS DEFINITION
53 //
54 //=================================================================================================
55 
56 //*************************************************************************************************
61 template< typename T1
62  , typename T2
63  , typename... Ts >
64 struct IsSIMDCombinableHelper
65  : public BoolConstant< IsSIMDCombinableHelper<T1,T2>::value &&
66  IsSIMDCombinableHelper<T2,Ts...>::value >
67 {};
69 //*************************************************************************************************
70 
71 
72 //*************************************************************************************************
74 template< typename T >
76 struct IsSIMDCombinableHelper<T,T>
77  : public BoolConstant< IsNumeric_v<T> >
78 {};
80 //*************************************************************************************************
81 
82 
83 //*************************************************************************************************
85 template< typename T1, typename T2 >
87 struct 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 //*************************************************************************************************
116 template< typename T1, typename T2, typename... Ts >
118  : public BoolConstant< IsSIMDCombinableHelper< T1, T2, Ts... >::value >
119 {};
120 //*************************************************************************************************
121 
122 
123 //*************************************************************************************************
136 template< typename T1, typename T2, typename... Ts >
137 constexpr bool IsSIMDCombinable_v = IsSIMDCombinable<T1,T2,Ts...>::value;
138 //*************************************************************************************************
139 
140 } // namespace blaze
141 
142 #endif
constexpr bool IsSIMDCombinable_v
Auxiliary variable template for the IsSIMDCombinable type trait.The IsSIMDCombinable_v variable templ...
Definition: IsSIMDCombinable.h:137
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:72
Header file for the IsIntegral type trait.
Compile time check for data types.This type trait tests whether or not the given types can be combine...
Definition: IsSIMDCombinable.h:117
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for the IsNumeric type trait.
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant alias template represents ...
Definition: IntegralConstant.h:110
Header file for the IntegralConstant class template.