Blaze  3.6
Div.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_FUNCTORS_DIV_H_
36 #define _BLAZE_MATH_FUNCTORS_DIV_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
44 #include <blaze/math/simd/Div.h>
63 #include <blaze/system/Inline.h>
65 
66 
67 namespace blaze {
68 
69 //=================================================================================================
70 //
71 // CLASS DEFINITION
72 //
73 //=================================================================================================
74 
75 //*************************************************************************************************
79 struct Div
80 {
81  //**********************************************************************************************
88  template< typename T1, typename T2 >
89  BLAZE_ALWAYS_INLINE BLAZE_DEVICE_CALLABLE decltype(auto) operator()( const T1& a, const T2& b ) const
90  {
91  return a / b;
92  }
93  //**********************************************************************************************
94 
95  //**********************************************************************************************
100  template< typename T1, typename T2 >
101  static constexpr bool simdEnabled() { return HasSIMDDiv_v<T1,T2>; }
102  //**********************************************************************************************
103 
104  //**********************************************************************************************
109  static constexpr bool paddingEnabled() { return false; }
110  //**********************************************************************************************
111 
112  //**********************************************************************************************
119  template< typename T1, typename T2 >
120  BLAZE_ALWAYS_INLINE decltype(auto) load( const T1& a, const T2& b ) const
121  {
124  return a / b;
125  }
126  //**********************************************************************************************
127 };
128 //*************************************************************************************************
129 
130 
131 
132 
133 //=================================================================================================
134 //
135 // YIELDSUNIFORM SPECIALIZATIONS
136 //
137 //=================================================================================================
138 
139 //*************************************************************************************************
141 template< typename T1, typename T2 >
142 struct YieldsUniform<Div,T1,T2>
143  : public BoolConstant< IsUniform_v<T1> && IsUniform_v<T2> >
144 {};
146 //*************************************************************************************************
147 
148 
149 
150 
151 //=================================================================================================
152 //
153 // YIELDSSYMMETRIC SPECIALIZATIONS
154 //
155 //=================================================================================================
156 
157 //*************************************************************************************************
159 template< typename MT1, typename MT2 >
160 struct YieldsSymmetric<Div,MT1,MT2>
161  : public BoolConstant< IsSymmetric_v<MT1> && IsSymmetric_v<MT2> >
162 {};
164 //*************************************************************************************************
165 
166 
167 
168 
169 //=================================================================================================
170 //
171 // YIELDSHERMITIAN SPECIALIZATIONS
172 //
173 //=================================================================================================
174 
175 //*************************************************************************************************
177 template< typename MT1, typename MT2 >
178 struct YieldsHermitian<Div,MT1,MT2>
179  : public BoolConstant< IsHermitian_v<MT1> && IsHermitian_v<MT2> >
180 {};
182 //*************************************************************************************************
183 
184 
185 
186 
187 //=================================================================================================
188 //
189 // YIELDSLOWER SPECIALIZATIONS
190 //
191 //=================================================================================================
192 
193 //*************************************************************************************************
195 template< typename MT1, typename MT2 >
196 struct YieldsLower<Div,MT1,MT2>
197  : public BoolConstant< IsLower_v<MT1> >
198 {};
200 //*************************************************************************************************
201 
202 
203 
204 
205 //=================================================================================================
206 //
207 // YIELDSSTRICTLYLOWER SPECIALIZATIONS
208 //
209 //=================================================================================================
210 
211 //*************************************************************************************************
213 template< typename MT1, typename MT2 >
214 struct YieldsStrictlyLower<Div,MT1,MT2>
215  : public BoolConstant< IsStrictlyLower_v<MT1> >
216 {};
218 //*************************************************************************************************
219 
220 
221 
222 
223 //=================================================================================================
224 //
225 // YIELDSUPPER SPECIALIZATIONS
226 //
227 //=================================================================================================
228 
229 //*************************************************************************************************
231 template< typename MT1, typename MT2 >
232 struct YieldsUpper<Div,MT1,MT2>
233  : public BoolConstant< IsUpper_v<MT1> >
234 {};
236 //*************************************************************************************************
237 
238 
239 
240 
241 //=================================================================================================
242 //
243 // YIELDSSTRICTLYUPPER SPECIALIZATIONS
244 //
245 //=================================================================================================
246 
247 //*************************************************************************************************
249 template< typename MT1, typename MT2 >
250 struct YieldsStrictlyUpper<Div,MT1,MT2>
251  : public BoolConstant< IsStrictlyUpper_v<MT1> >
252 {};
254 //*************************************************************************************************
255 
256 
257 
258 
259 //=================================================================================================
260 //
261 // YIELDSZERO SPECIALIZATIONS
262 //
263 //=================================================================================================
264 
265 //*************************************************************************************************
267 template< typename T1, typename T2 >
268 struct YieldsZero<Div,T1,T2>
269  : public BoolConstant< IsZero_v<T1> >
270 {};
272 //*************************************************************************************************
273 
274 } // namespace blaze
275 
276 #endif
Generic wrapper for the division operator.
Definition: Div.h:79
Header file for the YieldsStrictlyLower type trait.
Header file for the YieldsZero type trait.
static constexpr bool paddingEnabled()
Returns whether the operation supports padding, i.e. whether it can deal with zeros.
Definition: Div.h:109
decltype(auto) BLAZE_ALWAYS_INLINE load(const T1 &a, const T2 &b) const
Returns the result of the division operation for the given SIMD vectors.
Definition: Div.h:120
Header file for the SIMD division functionality.
#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 IsLower type trait.
Constraint on the data type.
Header file for the IsStrictlyLower type trait.
static constexpr bool simdEnabled()
Returns whether SIMD is enabled for the specified data types T1 and T2.
Definition: Div.h:101
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 YieldsLower type trait.
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant alias template represents ...
Definition: IntegralConstant.h:110
Macro for CUDA compatibility.
Header file for the HasSIMDDiv type trait.
Header file for the IntegralConstant class template.
#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 YieldsHermitian type trait.
Header file for the IsHermitian type trait.
System settings for the inline keywords.