Blaze 3.9
MakePair.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_FUNCTORS_MAKEPAIR_H_
36#define _BLAZE_MATH_FUNCTORS_MAKEPAIR_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
43#include <utility>
65#include <blaze/system/Inline.h>
67
68
69namespace blaze {
70
71//=================================================================================================
72//
73// CLASS DEFINITION
74//
75//=================================================================================================
76
77//*************************************************************************************************
82{
83 //**********************************************************************************************
90 template< typename T1, typename T2 >
91 BLAZE_ALWAYS_INLINE BLAZE_DEVICE_CALLABLE decltype(auto) operator()( T1&& a, T2&& b ) const
92 {
93 using std::make_pair;
94 return make_pair( std::forward<T1>( a ), std::forward<T2>( b ) );
95 }
96 //**********************************************************************************************
97
98 //**********************************************************************************************
103 template< typename T1, typename T2 >
104 static constexpr bool simdEnabled() { return true; }
105 //**********************************************************************************************
106
107 //**********************************************************************************************
112 static constexpr bool paddingEnabled() { return true; }
113 //**********************************************************************************************
114
115 //**********************************************************************************************
122 template< typename T1, typename T2 >
123 BLAZE_ALWAYS_INLINE decltype(auto) load( T1&& a, T2&& b ) const
124 {
125 using std::make_pair;
126 return make_pair( std::forward<T1>( a ), std::forward<T2>( b ) );
127 }
128 //**********************************************************************************************
129};
130//*************************************************************************************************
131
132
133
134
135//=================================================================================================
136//
137// YIELDSUNIFORM SPECIALIZATIONS
138//
139//=================================================================================================
140
141//*************************************************************************************************
143template< typename T1, typename T2 >
144struct YieldsUniform<MakePair,T1,T2>
145 : public BoolConstant< IsUniform_v<T1> && IsUniform_v<T2> >
146{};
148//*************************************************************************************************
149
150
151
152
153//=================================================================================================
154//
155// YIELDSSYMMETRIC SPECIALIZATIONS
156//
157//=================================================================================================
158
159//*************************************************************************************************
161template< typename MT1, typename MT2 >
162struct YieldsSymmetric<MakePair,MT1,MT2>
163 : public BoolConstant< IsSymmetric_v<MT1> && IsSymmetric_v<MT2> >
164{};
166//*************************************************************************************************
167
168
169
170
171//=================================================================================================
172//
173// YIELDSHERMITIAN SPECIALIZATIONS
174//
175//=================================================================================================
176
177//*************************************************************************************************
179template< typename MT1, typename MT2 >
180struct YieldsHermitian<MakePair,MT1,MT2>
181 : public BoolConstant< IsHermitian_v<MT1> && IsHermitian_v<MT2> >
182{};
184//*************************************************************************************************
185
186
187
188
189//=================================================================================================
190//
191// YIELDSLOWER SPECIALIZATIONS
192//
193//=================================================================================================
194
195//*************************************************************************************************
197template< typename MT1, typename MT2 >
198struct YieldsLower<MakePair,MT1,MT2>
199 : public BoolConstant< IsLower_v<MT1> && IsLower_v<MT2> >
200{};
202//*************************************************************************************************
203
204
205
206
207//=================================================================================================
208//
209// YIELDSUNILOWER SPECIALIZATIONS
210//
211//=================================================================================================
212
213//*************************************************************************************************
215template< typename MT1, typename MT2 >
216struct YieldsUniLower<MakePair,MT1,MT2>
217 : public BoolConstant< IsUniLower_v<MT1> && IsUniLower_v<MT2> >
218{};
220//*************************************************************************************************
221
222
223
224
225//=================================================================================================
226//
227// YIELDSSTRICTLYLOWER SPECIALIZATIONS
228//
229//=================================================================================================
230
231//*************************************************************************************************
233template< typename MT1, typename MT2 >
234struct YieldsStrictlyLower<MakePair,MT1,MT2>
235 : public BoolConstant< IsStrictlyLower_v<MT1> && IsStrictlyLower_v<MT2> >
236{};
238//*************************************************************************************************
239
240
241
242
243//=================================================================================================
244//
245// YIELDSUPPER SPECIALIZATIONS
246//
247//=================================================================================================
248
249//*************************************************************************************************
251template< typename MT1, typename MT2 >
252struct YieldsUpper<MakePair,MT1,MT2>
253 : public BoolConstant< IsUpper_v<MT1> && IsUpper_v<MT2> >
254{};
256//*************************************************************************************************
257
258
259
260
261//=================================================================================================
262//
263// YIELDSUNIUPPER SPECIALIZATIONS
264//
265//=================================================================================================
266
267//*************************************************************************************************
269template< typename MT1, typename MT2 >
270struct YieldsUniUpper<MakePair,MT1,MT2>
271 : public BoolConstant< IsUniUpper_v<MT1> && IsUniUpper_v<MT2> >
272{};
274//*************************************************************************************************
275
276
277
278
279//=================================================================================================
280//
281// YIELDSSTRICTLYUPPER SPECIALIZATIONS
282//
283//=================================================================================================
284
285//*************************************************************************************************
287template< typename MT1, typename MT2 >
288struct YieldsStrictlyUpper<MakePair,MT1,MT2>
289 : public BoolConstant< IsStrictlyUpper_v<MT1> && IsStrictlyUpper_v<MT2> >
290{};
292//*************************************************************************************************
293
294
295
296
297//=================================================================================================
298//
299// YIELDSZERO SPECIALIZATIONS
300//
301//=================================================================================================
302
303//*************************************************************************************************
305template< typename T1, typename T2 >
306struct YieldsZero<MakePair,T1,T2>
307 : public BoolConstant< IsZero_v<T1> && IsZero_v<T2> >
308{};
310//*************************************************************************************************
311
312} // namespace blaze
313
314#endif
Macro for CUDA compatibility.
Header file for the IntegralConstant class template.
Header file for the IsHermitian type trait.
Header file for the IsLower type trait.
Header file for the IsStrictlyLower type trait.
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric type trait.
Header file for the IsUniLower type trait.
Header file for the IsUniUpper type trait.
Header file for the IsUniform type trait.
Header file for the IsUpper type trait.
Header file for the YieldsHermitian type trait.
Header file for the YieldsLower type trait.
Header file for the YieldsStrictlyLower type trait.
Header file for the YieldsStrictlyUpper type trait.
Header file for the YieldsSymmetric type trait.
Header file for the YieldsUniLower type trait.
Header file for the YieldsUniUpper type trait.
Header file for the YieldsUniform type trait.
Header file for the YieldsUpper type trait.
Header file for the YieldsZero type trait.
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
#define BLAZE_DEVICE_CALLABLE
Conditional macro that sets host and device attributes when compiled with CUDA.
Definition: HostDevice.h:94
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.
Definition: IntegralConstant.h:110
Generic wrapper for the make_pair() function.
Definition: MakePair.h:82
BLAZE_ALWAYS_INLINE decltype(auto) load(T1 &&a, T2 &&b) const
Returns the result of the make_pair() function for the given SIMD vectors.
Definition: MakePair.h:123
static constexpr bool simdEnabled()
Returns whether SIMD is enabled for the specified data types T1 and T2.
Definition: MakePair.h:104
static constexpr bool paddingEnabled()
Returns whether the operation supports padding, i.e. whether it can deal with zeros.
Definition: MakePair.h:112
System settings for the inline keywords.
Header file for the IsZero type trait.