Blaze  3.6
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 
44 #include <blaze/math/shims/Qdrt.h>
67 #include <blaze/system/Inline.h>
68 
69 
70 namespace blaze {
71 
72 //=================================================================================================
73 //
74 // CLASS DEFINITION
75 //
76 //=================================================================================================
77 
78 //*************************************************************************************************
82 struct Qdrt
83 {
84  //**********************************************************************************************
90  template< typename T >
91  BLAZE_ALWAYS_INLINE BLAZE_DEVICE_CALLABLE decltype(auto) operator()( const T& a ) const
92  {
93  return qdrt( a );
94  }
95  //**********************************************************************************************
96 
97  //**********************************************************************************************
102  template< typename T >
103  static constexpr bool simdEnabled() { return HasSIMDSqrt_v<T>; }
104  //**********************************************************************************************
105 
106  //**********************************************************************************************
111  static constexpr bool paddingEnabled() { return true; }
112  //**********************************************************************************************
113 
114  //**********************************************************************************************
120  template< typename T >
121  BLAZE_ALWAYS_INLINE decltype(auto) load( const T& a ) const
122  {
124  return qdrt( a );
125  }
126  //**********************************************************************************************
127 };
128 //*************************************************************************************************
129 
130 
131 
132 
133 //=================================================================================================
134 //
135 // YIELDSUNIFORM SPECIALIZATIONS
136 //
137 //=================================================================================================
138 
139 //*************************************************************************************************
141 template< typename T >
142 struct YieldsUniform<Qdrt,T>
143  : public IsUniform<T>
144 {};
146 //*************************************************************************************************
147 
148 
149 
150 
151 //=================================================================================================
152 //
153 // YIELDSSYMMETRIC SPECIALIZATIONS
154 //
155 //=================================================================================================
156 
157 //*************************************************************************************************
159 template< typename MT >
160 struct YieldsSymmetric<Qdrt,MT>
161  : public IsSymmetric<MT>
162 {};
164 //*************************************************************************************************
165 
166 
167 
168 
169 //=================================================================================================
170 //
171 // YIELDSHERMITIAN SPECIALIZATIONS
172 //
173 //=================================================================================================
174 
175 //*************************************************************************************************
177 template< typename MT >
178 struct YieldsHermitian<Qdrt,MT>
179  : public IsHermitian<MT>
180 {};
182 //*************************************************************************************************
183 
184 
185 
186 
187 //=================================================================================================
188 //
189 // YIELDSLOWER SPECIALIZATIONS
190 //
191 //=================================================================================================
192 
193 //*************************************************************************************************
195 template< typename MT >
196 struct YieldsLower<Qdrt,MT>
197  : public IsLower<MT>
198 {};
200 //*************************************************************************************************
201 
202 
203 
204 
205 //=================================================================================================
206 //
207 // YIELDSUNILOWER SPECIALIZATIONS
208 //
209 //=================================================================================================
210 
211 //*************************************************************************************************
213 template< typename MT >
214 struct YieldsUniLower<Qdrt,MT>
215  : public IsUniLower<MT>
216 {};
218 //*************************************************************************************************
219 
220 
221 
222 
223 //=================================================================================================
224 //
225 // YIELDSSTRICTLYLOWER SPECIALIZATIONS
226 //
227 //=================================================================================================
228 
229 //*************************************************************************************************
231 template< typename MT >
232 struct YieldsStrictlyLower<Qdrt,MT>
233  : public IsStrictlyLower<MT>
234 {};
236 //*************************************************************************************************
237 
238 
239 
240 
241 //=================================================================================================
242 //
243 // YIELDSUPPER SPECIALIZATIONS
244 //
245 //=================================================================================================
246 
247 //*************************************************************************************************
249 template< typename MT >
250 struct YieldsUpper<Qdrt,MT>
251  : public IsUpper<MT>
252 {};
254 //*************************************************************************************************
255 
256 
257 
258 
259 //=================================================================================================
260 //
261 // YIELDSUNIUPPER SPECIALIZATIONS
262 //
263 //=================================================================================================
264 
265 //*************************************************************************************************
267 template< typename MT >
268 struct YieldsUniUpper<Qdrt,MT>
269  : public IsUniUpper<MT>
270 {};
272 //*************************************************************************************************
273 
274 
275 
276 
277 //=================================================================================================
278 //
279 // YIELDSSTRICTLYUPPER SPECIALIZATIONS
280 //
281 //=================================================================================================
282 
283 //*************************************************************************************************
285 template< typename MT >
286 struct YieldsStrictlyUpper<Qdrt,MT>
287  : public IsStrictlyUpper<MT>
288 {};
290 //*************************************************************************************************
291 
292 
293 
294 
295 //=================================================================================================
296 //
297 // YIELDSZERO SPECIALIZATIONS
298 //
299 //=================================================================================================
300 
301 //*************************************************************************************************
303 template< typename T >
304 struct YieldsZero<Qdrt,T>
305  : public IsZero<T>
306 {};
308 //*************************************************************************************************
309 
310 } // namespace blaze
311 
312 #endif
Header file for the IsUniUpper type trait.
Header file for the YieldsStrictlyLower type trait.
Header file for the YieldsZero type trait.
static constexpr bool simdEnabled()
Returns whether SIMD is enabled for the specified data type T.
Definition: Qdrt.h:103
Generic wrapper for the qdrt() function.
Definition: Qdrt.h:82
Header file for the IsUniLower type trait.
#define BLAZE_CONSTRAINT_MUST_BE_SIMD_PACK(T)
Constraint on the data type.In case the given data type T is not a SIMD pack, a compilation error is ...
Definition: SIMDPack.h:60
decltype(auto) BLAZE_ALWAYS_INLINE qdrt(const T &a)
Computing the quad root (4th root) of the given value/object.
Definition: Qdrt.h:65
Header file for the IsUniform type trait.
Header file for the IsStrictlyUpper type trait.
Header file for the IsSymmetric type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Header file for the YieldsStrictlyUpper type trait.
Header file for the YieldsUniLower type trait.
static constexpr bool paddingEnabled()
Returns whether the operation supports padding, i.e. whether it can deal with zeros.
Definition: Qdrt.h:111
Header file for the IsLower type trait.
Header file for the qdrt shim.
Constraint on the data type.
Header file for the IsStrictlyLower type trait.
decltype(auto) BLAZE_ALWAYS_INLINE load(const T &a) const
Returns the result of the qdrt() function for the given SIMD vector.
Definition: Qdrt.h:121
Header file for the YieldsUniform type trait.
Header file for the YieldsSymmetric type trait.
Header file for the YieldsUpper type trait.
Header file for the IsZero type trait.
Header file for the HasSIMDSqrt type trait.
Header file for the YieldsLower type trait.
Macro for CUDA compatibility.
#define BLAZE_DEVICE_CALLABLE
Conditional macro that sets host and device attributes when compiled with CUDA.
Definition: HostDevice.h:94
Header file for the IsUpper type trait.
Header file for the YieldsUniUpper type trait.
Header file for the YieldsHermitian type trait.
Header file for the IsHermitian type trait.
System settings for the inline keywords.