Blaze  3.6
Ceil.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_FUNCTORS_CEIL_H_
36 #define _BLAZE_MATH_FUNCTORS_CEIL_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
44 #include <blaze/math/shims/Ceil.h>
45 #include <blaze/math/simd/Ceil.h>
66 #include <blaze/system/Inline.h>
67 
68 
69 namespace blaze {
70 
71 //=================================================================================================
72 //
73 // CLASS DEFINITION
74 //
75 //=================================================================================================
76 
77 //*************************************************************************************************
81 struct Ceil
82 {
83  //**********************************************************************************************
89  template< typename T >
90  BLAZE_ALWAYS_INLINE BLAZE_DEVICE_CALLABLE decltype(auto) operator()( const T& a ) const
91  {
92  return ceil( a );
93  }
94  //**********************************************************************************************
95 
96  //**********************************************************************************************
101  template< typename T >
102  static constexpr bool simdEnabled() { return HasSIMDCeil_v<T>; }
103  //**********************************************************************************************
104 
105  //**********************************************************************************************
110  static constexpr bool paddingEnabled() { return true; }
111  //**********************************************************************************************
112 
113  //**********************************************************************************************
119  template< typename T >
120  BLAZE_ALWAYS_INLINE decltype(auto) load( const T& a ) const
121  {
123  return ceil( a );
124  }
125  //**********************************************************************************************
126 };
127 //*************************************************************************************************
128 
129 
130 
131 
132 //=================================================================================================
133 //
134 // YIELDSUNIFORM SPECIALIZATIONS
135 //
136 //=================================================================================================
137 
138 //*************************************************************************************************
140 template< typename T >
141 struct YieldsUniform<Ceil,T>
142  : public IsUniform<T>
143 {};
145 //*************************************************************************************************
146 
147 
148 
149 
150 //=================================================================================================
151 //
152 // YIELDSSYMMETRIC SPECIALIZATIONS
153 //
154 //=================================================================================================
155 
156 //*************************************************************************************************
158 template< typename MT >
159 struct YieldsSymmetric<Ceil,MT>
160  : public IsSymmetric<MT>
161 {};
163 //*************************************************************************************************
164 
165 
166 
167 
168 //=================================================================================================
169 //
170 // YIELDSLOWER SPECIALIZATIONS
171 //
172 //=================================================================================================
173 
174 //*************************************************************************************************
176 template< typename MT >
177 struct YieldsLower<Ceil,MT>
178  : public IsLower<MT>
179 {};
181 //*************************************************************************************************
182 
183 
184 
185 
186 //=================================================================================================
187 //
188 // YIELDSUNILOWER SPECIALIZATIONS
189 //
190 //=================================================================================================
191 
192 //*************************************************************************************************
194 template< typename MT >
195 struct YieldsUniLower<Ceil,MT>
196  : public IsUniLower<MT>
197 {};
199 //*************************************************************************************************
200 
201 
202 
203 
204 //=================================================================================================
205 //
206 // YIELDSSTRICTLYLOWER SPECIALIZATIONS
207 //
208 //=================================================================================================
209 
210 //*************************************************************************************************
212 template< typename MT >
213 struct YieldsStrictlyLower<Ceil,MT>
214  : public IsStrictlyLower<MT>
215 {};
217 //*************************************************************************************************
218 
219 
220 
221 
222 //=================================================================================================
223 //
224 // YIELDSUPPER SPECIALIZATIONS
225 //
226 //=================================================================================================
227 
228 //*************************************************************************************************
230 template< typename MT >
231 struct YieldsUpper<Ceil,MT>
232  : public IsUpper<MT>
233 {};
235 //*************************************************************************************************
236 
237 
238 
239 
240 //=================================================================================================
241 //
242 // YIELDSUNIUPPER SPECIALIZATIONS
243 //
244 //=================================================================================================
245 
246 //*************************************************************************************************
248 template< typename MT >
249 struct YieldsUniUpper<Ceil,MT>
250  : public IsUniUpper<MT>
251 {};
253 //*************************************************************************************************
254 
255 
256 
257 
258 //=================================================================================================
259 //
260 // YIELDSSTRICTLYUPPER SPECIALIZATIONS
261 //
262 //=================================================================================================
263 
264 //*************************************************************************************************
266 template< typename MT >
267 struct YieldsStrictlyUpper<Ceil,MT>
268  : public IsStrictlyUpper<MT>
269 {};
271 //*************************************************************************************************
272 
273 
274 
275 
276 //=================================================================================================
277 //
278 // YIELDSZERO SPECIALIZATIONS
279 //
280 //=================================================================================================
281 
282 //*************************************************************************************************
284 template< typename T >
285 struct YieldsZero<Ceil,T>
286  : public IsZero<T>
287 {};
289 //*************************************************************************************************
290 
291 } // namespace blaze
292 
293 #endif
Generic wrapper for the ceil() function.
Definition: Ceil.h:81
Header file for the IsUniUpper type trait.
static constexpr bool paddingEnabled()
Returns whether the operation supports padding, i.e. whether it can deal with zeros.
Definition: Ceil.h:110
Header file for the YieldsStrictlyLower type trait.
Header file for the YieldsZero type trait.
decltype(auto) ceil(const DenseMatrix< MT, SO > &dm)
Applies the ceil() function to each single element of the dense matrix dm.
Definition: DMatMapExpr.h:1240
Header file for the HasSIMDCeil 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.
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 simdEnabled()
Returns whether SIMD is enabled for the specified data type T.
Definition: Ceil.h:102
Header file for the IsLower type trait.
Constraint on the data type.
Header file for the IsStrictlyLower type trait.
Header file for the YieldsUniform type trait.
Header file for the YieldsSymmetric type trait.
Header file for the SIMD ceil functionality.
decltype(auto) BLAZE_ALWAYS_INLINE load(const T &a) const
Returns the result of the ceil() function for the given SIMD vector.
Definition: Ceil.h:120
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.
#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.
System settings for the inline keywords.
Header file for the ceil shim.