Blaze  3.6
Pow3.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_FUNCTORS_POW3_H_
36 #define _BLAZE_MATH_FUNCTORS_POW3_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
44 #include <blaze/math/shims/Pow3.h>
63 #include <blaze/system/Inline.h>
64 
65 
66 namespace blaze {
67 
68 //=================================================================================================
69 //
70 // CLASS DEFINITION
71 //
72 //=================================================================================================
73 
74 //*************************************************************************************************
78 struct Pow3
79 {
80  //**********************************************************************************************
86  template< typename T >
87  BLAZE_ALWAYS_INLINE BLAZE_DEVICE_CALLABLE constexpr decltype(auto) operator()( const T& a ) const
88  {
89  return pow3( a );
90  }
91  //**********************************************************************************************
92 
93  //**********************************************************************************************
98  template< typename T >
99  static constexpr bool simdEnabled() { return HasSIMDMult_v<T,T>; }
100  //**********************************************************************************************
101 
102  //**********************************************************************************************
107  static constexpr bool paddingEnabled() { return true; }
108  //**********************************************************************************************
109 
110  //**********************************************************************************************
116  template< typename T >
117  BLAZE_ALWAYS_INLINE decltype(auto) load( const T& a ) const
118  {
120  return pow3( a );
121  }
122  //**********************************************************************************************
123 };
124 //*************************************************************************************************
125 
126 
127 
128 
129 //=================================================================================================
130 //
131 // YIELDSUNIFORM SPECIALIZATIONS
132 //
133 //=================================================================================================
134 
135 //*************************************************************************************************
137 template< typename T >
138 struct YieldsUniform<Pow3,T>
139  : public IsUniform<T>
140 {};
142 //*************************************************************************************************
143 
144 
145 
146 
147 //=================================================================================================
148 //
149 // YIELDSLOWER SPECIALIZATIONS
150 //
151 //=================================================================================================
152 
153 //*************************************************************************************************
155 template< typename MT >
156 struct YieldsLower<Pow3,MT>
157  : public IsLower<MT>
158 {};
160 //*************************************************************************************************
161 
162 
163 
164 
165 //=================================================================================================
166 //
167 // YIELDSUNILOWER SPECIALIZATIONS
168 //
169 //=================================================================================================
170 
171 //*************************************************************************************************
173 template< typename MT >
174 struct YieldsUniLower<Pow3,MT>
175  : public IsUniLower<MT>
176 {};
178 //*************************************************************************************************
179 
180 
181 
182 
183 //=================================================================================================
184 //
185 // YIELDSSTRICTLYLOWER SPECIALIZATIONS
186 //
187 //=================================================================================================
188 
189 //*************************************************************************************************
191 template< typename MT >
192 struct YieldsStrictlyLower<Pow3,MT>
193  : public IsStrictlyLower<MT>
194 {};
196 //*************************************************************************************************
197 
198 
199 
200 
201 //=================================================================================================
202 //
203 // YIELDSUPPER SPECIALIZATIONS
204 //
205 //=================================================================================================
206 
207 //*************************************************************************************************
209 template< typename MT >
210 struct YieldsUpper<Pow3,MT>
211  : public IsUpper<MT>
212 {};
214 //*************************************************************************************************
215 
216 
217 
218 
219 //=================================================================================================
220 //
221 // YIELDSUNIUPPER SPECIALIZATIONS
222 //
223 //=================================================================================================
224 
225 //*************************************************************************************************
227 template< typename MT >
228 struct YieldsUniUpper<Pow3,MT>
229  : public IsUniUpper<MT>
230 {};
232 //*************************************************************************************************
233 
234 
235 
236 
237 //=================================================================================================
238 //
239 // YIELDSSTRICTLYUPPER SPECIALIZATIONS
240 //
241 //=================================================================================================
242 
243 //*************************************************************************************************
245 template< typename MT >
246 struct YieldsStrictlyUpper<Pow3,MT>
247  : public IsStrictlyUpper<MT>
248 {};
250 //*************************************************************************************************
251 
252 
253 
254 
255 //=================================================================================================
256 //
257 // YIELDSZERO SPECIALIZATIONS
258 //
259 //=================================================================================================
260 
261 //*************************************************************************************************
263 template< typename T >
264 struct YieldsZero<Pow3,T>
265  : public IsZero<T>
266 {};
268 //*************************************************************************************************
269 
270 } // namespace blaze
271 
272 #endif
Header file for the IsUniUpper type trait.
Header file for the YieldsStrictlyLower type trait.
Header file for the YieldsZero type trait.
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
Header file for the IsUniform type trait.
Header file for the IsStrictlyUpper 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.
Header file for the IsLower type trait.
decltype(auto) BLAZE_ALWAYS_INLINE load(const T &a) const
Returns the result of the pow3() function for the given SIMD vector.
Definition: Pow3.h:117
Constraint on the data type.
Header file for the pow3 shim.
Header file for the IsStrictlyLower type trait.
decltype(auto) pow3(const Proxy< PT, RT > &proxy)
Computing the cube value of the represented element.
Definition: Proxy.h:1405
Header file for the HasSIMDMult type trait.
static constexpr bool simdEnabled()
Returns whether SIMD is enabled for the specified data type T.
Definition: Pow3.h:99
Header file for the YieldsUniform type trait.
Header file for the YieldsUpper type trait.
Header file for the IsZero type trait.
Header file for the YieldsLower type trait.
Macro for CUDA compatibility.
Generic wrapper for the pow3() function.
Definition: Pow3.h:78
#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.
static constexpr bool paddingEnabled()
Returns whether the operation supports padding, i.e. whether it can deal with zeros.
Definition: Pow3.h:107
System settings for the inline keywords.