Blaze 3.9
Qdrt.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_FUNCTORS_QDRT_H_
36#define _BLAZE_MATH_FUNCTORS_QDRT_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
43#include <utility>
68#include <blaze/system/Inline.h>
69
70
71namespace blaze {
72
73//=================================================================================================
74//
75// CLASS DEFINITION
76//
77//=================================================================================================
78
79//*************************************************************************************************
83struct Qdrt
84{
85 //**********************************************************************************************
91 template< typename T >
92 BLAZE_ALWAYS_INLINE BLAZE_DEVICE_CALLABLE decltype(auto) operator()( T&& a ) const
93 {
94 return qdrt( std::forward<T>( a ) );
95 }
96 //**********************************************************************************************
97
98 //**********************************************************************************************
103 template< typename T >
104 static constexpr bool simdEnabled() { return HasSIMDSqrt_v<T>; }
105 //**********************************************************************************************
106
107 //**********************************************************************************************
112 static constexpr bool paddingEnabled() { return true; }
113 //**********************************************************************************************
114
115 //**********************************************************************************************
121 template< typename T >
122 BLAZE_ALWAYS_INLINE decltype(auto) load( const T& a ) const
123 {
125 return qdrt( a );
126 }
127 //**********************************************************************************************
128};
129//*************************************************************************************************
130
131
132
133
134//=================================================================================================
135//
136// YIELDSUNIFORM SPECIALIZATIONS
137//
138//=================================================================================================
139
140//*************************************************************************************************
142template< typename T >
143struct YieldsUniform<Qdrt,T>
144 : public IsUniform<T>
145{};
147//*************************************************************************************************
148
149
150
151
152//=================================================================================================
153//
154// YIELDSSYMMETRIC SPECIALIZATIONS
155//
156//=================================================================================================
157
158//*************************************************************************************************
160template< typename MT >
161struct YieldsSymmetric<Qdrt,MT>
162 : public IsSymmetric<MT>
163{};
165//*************************************************************************************************
166
167
168
169
170//=================================================================================================
171//
172// YIELDSHERMITIAN SPECIALIZATIONS
173//
174//=================================================================================================
175
176//*************************************************************************************************
178template< typename MT >
179struct YieldsHermitian<Qdrt,MT>
180 : public IsHermitian<MT>
181{};
183//*************************************************************************************************
184
185
186
187
188//=================================================================================================
189//
190// YIELDSLOWER SPECIALIZATIONS
191//
192//=================================================================================================
193
194//*************************************************************************************************
196template< typename MT >
197struct YieldsLower<Qdrt,MT>
198 : public IsLower<MT>
199{};
201//*************************************************************************************************
202
203
204
205
206//=================================================================================================
207//
208// YIELDSUNILOWER SPECIALIZATIONS
209//
210//=================================================================================================
211
212//*************************************************************************************************
214template< typename MT >
215struct YieldsUniLower<Qdrt,MT>
216 : public IsUniLower<MT>
217{};
219//*************************************************************************************************
220
221
222
223
224//=================================================================================================
225//
226// YIELDSSTRICTLYLOWER SPECIALIZATIONS
227//
228//=================================================================================================
229
230//*************************************************************************************************
232template< typename MT >
233struct YieldsStrictlyLower<Qdrt,MT>
234 : public IsStrictlyLower<MT>
235{};
237//*************************************************************************************************
238
239
240
241
242//=================================================================================================
243//
244// YIELDSUPPER SPECIALIZATIONS
245//
246//=================================================================================================
247
248//*************************************************************************************************
250template< typename MT >
251struct YieldsUpper<Qdrt,MT>
252 : public IsUpper<MT>
253{};
255//*************************************************************************************************
256
257
258
259
260//=================================================================================================
261//
262// YIELDSUNIUPPER SPECIALIZATIONS
263//
264//=================================================================================================
265
266//*************************************************************************************************
268template< typename MT >
269struct YieldsUniUpper<Qdrt,MT>
270 : public IsUniUpper<MT>
271{};
273//*************************************************************************************************
274
275
276
277
278//=================================================================================================
279//
280// YIELDSSTRICTLYUPPER SPECIALIZATIONS
281//
282//=================================================================================================
283
284//*************************************************************************************************
286template< typename MT >
287struct YieldsStrictlyUpper<Qdrt,MT>
288 : public IsStrictlyUpper<MT>
289{};
291//*************************************************************************************************
292
293
294
295
296//=================================================================================================
297//
298// YIELDSZERO SPECIALIZATIONS
299//
300//=================================================================================================
301
302//*************************************************************************************************
304template< typename T >
305struct YieldsZero<Qdrt,T>
306 : public IsZero<T>
307{};
309//*************************************************************************************************
310
311} // namespace blaze
312
313#endif
Header file for the HasSIMDSqrt type trait.
Macro for CUDA compatibility.
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.
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_BE_SIMD_PACK(T)
Constraint on the data type.
Definition: SIMDPack.h:60
BLAZE_ALWAYS_INLINE decltype(auto) qdrt(const T &a)
Computing the quad root (4th root) of the given value/object.
Definition: Qdrt.h:65
#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
Header file for the qdrt shim.
Generic wrapper for the qdrt() function.
Definition: Qdrt.h:84
BLAZE_ALWAYS_INLINE decltype(auto) load(const T &a) const
Returns the result of the qdrt() function for the given SIMD vector.
Definition: Qdrt.h:122
static constexpr bool paddingEnabled()
Returns whether the operation supports padding, i.e. whether it can deal with zeros.
Definition: Qdrt.h:112
static constexpr bool simdEnabled()
Returns whether SIMD is enabled for the specified data type T.
Definition: Qdrt.h:104
System settings for the inline keywords.
Header file for the IsZero type trait.