Blaze 3.9
Pow4.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_FUNCTORS_POW4_H_
36#define _BLAZE_MATH_FUNCTORS_POW4_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
43#include <utility>
64#include <blaze/system/Inline.h>
65
66
67namespace blaze {
68
69//=================================================================================================
70//
71// CLASS DEFINITION
72//
73//=================================================================================================
74
75//*************************************************************************************************
79struct Pow4
80{
81 //**********************************************************************************************
87 template< typename T >
88 BLAZE_ALWAYS_INLINE BLAZE_DEVICE_CALLABLE constexpr decltype(auto) operator()( T&& a ) const
89 {
90 return pow4( std::forward<T>( a ) );
91 }
92 //**********************************************************************************************
93
94 //**********************************************************************************************
99 template< typename T >
100 static constexpr bool simdEnabled() { return HasSIMDMult_v<T,T>; }
101 //**********************************************************************************************
102
103 //**********************************************************************************************
108 static constexpr bool paddingEnabled() { return true; }
109 //**********************************************************************************************
110
111 //**********************************************************************************************
117 template< typename T >
118 BLAZE_ALWAYS_INLINE decltype(auto) load( const T& a ) const
119 {
121 return pow4( a );
122 }
123 //**********************************************************************************************
124};
125//*************************************************************************************************
126
127
128
129
130//=================================================================================================
131//
132// YIELDSUNIFORM SPECIALIZATIONS
133//
134//=================================================================================================
135
136//*************************************************************************************************
138template< typename T >
139struct YieldsUniform<Pow4,T>
140 : public IsUniform<T>
141{};
143//*************************************************************************************************
144
145
146
147
148//=================================================================================================
149//
150// YIELDSLOWER SPECIALIZATIONS
151//
152//=================================================================================================
153
154//*************************************************************************************************
156template< typename MT >
157struct YieldsLower<Pow4,MT>
158 : public IsLower<MT>
159{};
161//*************************************************************************************************
162
163
164
165
166//=================================================================================================
167//
168// YIELDSUNILOWER SPECIALIZATIONS
169//
170//=================================================================================================
171
172//*************************************************************************************************
174template< typename MT >
175struct YieldsUniLower<Pow4,MT>
176 : public IsUniLower<MT>
177{};
179//*************************************************************************************************
180
181
182
183
184//=================================================================================================
185//
186// YIELDSSTRICTLYLOWER SPECIALIZATIONS
187//
188//=================================================================================================
189
190//*************************************************************************************************
192template< typename MT >
193struct YieldsStrictlyLower<Pow4,MT>
194 : public IsStrictlyLower<MT>
195{};
197//*************************************************************************************************
198
199
200
201
202//=================================================================================================
203//
204// YIELDSUPPER SPECIALIZATIONS
205//
206//=================================================================================================
207
208//*************************************************************************************************
210template< typename MT >
211struct YieldsUpper<Pow4,MT>
212 : public IsUpper<MT>
213{};
215//*************************************************************************************************
216
217
218
219
220//=================================================================================================
221//
222// YIELDSUNIUPPER SPECIALIZATIONS
223//
224//=================================================================================================
225
226//*************************************************************************************************
228template< typename MT >
229struct YieldsUniUpper<Pow4,MT>
230 : public IsUniUpper<MT>
231{};
233//*************************************************************************************************
234
235
236
237
238//=================================================================================================
239//
240// YIELDSSTRICTLYUPPER SPECIALIZATIONS
241//
242//=================================================================================================
243
244//*************************************************************************************************
246template< typename MT >
247struct YieldsStrictlyUpper<Pow4,MT>
248 : public IsStrictlyUpper<MT>
249{};
251//*************************************************************************************************
252
253
254
255
256//=================================================================================================
257//
258// YIELDSZERO SPECIALIZATIONS
259//
260//=================================================================================================
261
262//*************************************************************************************************
264template< typename T >
265struct YieldsZero<Pow4,T>
266 : public IsZero<T>
267{};
269//*************************************************************************************************
270
271} // namespace blaze
272
273#endif
Header file for the HasSIMDMult type trait.
Macro for CUDA compatibility.
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 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 YieldsLower type trait.
Header file for the YieldsStrictlyLower type trait.
Header file for the YieldsStrictlyUpper 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 constexpr decltype(auto) pow4(const T &a) noexcept(noexcept(pow2(pow2(a))))
Quadruple the given value/object.
Definition: Pow4.h:71
#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 pow4 shim.
Generic wrapper for the pow4() function.
Definition: Pow4.h:80
static constexpr bool simdEnabled()
Returns whether SIMD is enabled for the specified data type T.
Definition: Pow4.h:100
BLAZE_ALWAYS_INLINE decltype(auto) load(const T &a) const
Returns the result of the pow4() function for the given SIMD vector.
Definition: Pow4.h:118
static constexpr bool paddingEnabled()
Returns whether the operation supports padding, i.e. whether it can deal with zeros.
Definition: Pow4.h:108
System settings for the inline keywords.
Header file for the IsZero type trait.