Mult.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_FUNCTORS_MULT_H_
36 #define _BLAZE_MATH_FUNCTORS_MULT_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
44 #include <blaze/math/simd/Mult.h>
61 #include <blaze/system/Inline.h>
63 
64 
65 namespace blaze {
66 
67 //=================================================================================================
68 //
69 // CLASS DEFINITION
70 //
71 //=================================================================================================
72 
73 //*************************************************************************************************
77 struct Mult
78 {
79  //**********************************************************************************************
82  explicit inline Mult()
83  {}
84  //**********************************************************************************************
85 
86  //**********************************************************************************************
93  template< typename T1, typename T2 >
94  BLAZE_ALWAYS_INLINE decltype(auto) operator()( const T1& a, const T2& b ) const
95  {
96  return a * b;
97  }
98  //**********************************************************************************************
99 
100  //**********************************************************************************************
105  template< typename T1, typename T2 >
106  static constexpr bool simdEnabled() { return HasSIMDMult_v<T1,T2>; }
107  //**********************************************************************************************
108 
109  //**********************************************************************************************
114  static constexpr bool paddingEnabled() { return true; }
115  //**********************************************************************************************
116 
117  //**********************************************************************************************
124  template< typename T1, typename T2 >
125  BLAZE_ALWAYS_INLINE decltype(auto) load( const T1& a, const T2& b ) const
126  {
129  return a * b;
130  }
131  //**********************************************************************************************
132 };
133 //*************************************************************************************************
134 
135 
136 
137 
138 //=================================================================================================
139 //
140 // YIELDSUNIFORM SPECIALIZATIONS
141 //
142 //=================================================================================================
143 
144 //*************************************************************************************************
146 template< typename T1, typename T2 >
147 struct YieldsUniform<Mult,T1,T2>
148  : public BoolConstant< IsUniform_v<T1> && IsUniform_v<T2> >
149 {};
151 //*************************************************************************************************
152 
153 
154 
155 
156 //=================================================================================================
157 //
158 // YIELDSLOWER SPECIALIZATIONS
159 //
160 //=================================================================================================
161 
162 //*************************************************************************************************
164 template< typename MT1, typename MT2 >
165 struct YieldsLower<Mult,MT1,MT2>
166  : public BoolConstant< IsLower_v<MT1> || IsLower_v<MT2> >
167 {};
169 //*************************************************************************************************
170 
171 
172 
173 
174 //=================================================================================================
175 //
176 // YIELDSUNILOWER SPECIALIZATIONS
177 //
178 //=================================================================================================
179 
180 //*************************************************************************************************
182 template< typename MT1, typename MT2 >
183 struct YieldsUniLower<Mult,MT1,MT2>
184  : public BoolConstant< ( IsUniLower_v<MT1> && IsUniTriangular_v<MT2> ) ||
185  ( IsUniLower_v<MT2> && IsUniTriangular_v<MT1> ) >
186 {};
188 //*************************************************************************************************
189 
190 
191 
192 
193 //=================================================================================================
194 //
195 // YIELDSSTRICTLYLOWER SPECIALIZATIONS
196 //
197 //=================================================================================================
198 
199 //*************************************************************************************************
201 template< typename MT1, typename MT2 >
202 struct YieldsStrictlyLower<Mult,MT1,MT2>
203  : public BoolConstant< IsStrictlyLower_v<MT1> || IsStrictlyLower_v<MT2> >
204 {};
206 //*************************************************************************************************
207 
208 
209 
210 
211 //=================================================================================================
212 //
213 // YIELDSUPPER SPECIALIZATIONS
214 //
215 //=================================================================================================
216 
217 //*************************************************************************************************
219 template< typename MT1, typename MT2 >
220 struct YieldsUpper<Mult,MT1,MT2>
221  : public BoolConstant< IsUpper_v<MT1> || IsUpper_v<MT2> >
222 {};
224 //*************************************************************************************************
225 
226 
227 
228 
229 //=================================================================================================
230 //
231 // YIELDSUNIUPPER SPECIALIZATIONS
232 //
233 //=================================================================================================
234 
235 //*************************************************************************************************
237 template< typename MT1, typename MT2 >
238 struct YieldsUniUpper<Mult,MT1,MT2>
239  : public BoolConstant< ( IsUniUpper_v<MT1> && IsUniTriangular_v<MT2> ) ||
240  ( IsUniUpper_v<MT2> && IsUniTriangular_v<MT1> ) >
241 {};
243 //*************************************************************************************************
244 
245 
246 
247 
248 //=================================================================================================
249 //
250 // YIELDSSTRICTLYUPPER SPECIALIZATIONS
251 //
252 //=================================================================================================
253 
254 //*************************************************************************************************
256 template< typename MT1, typename MT2 >
257 struct YieldsStrictlyUpper<Mult,MT1,MT2>
258  : public BoolConstant< IsStrictlyUpper_v<MT1> || IsStrictlyUpper_v<MT2> >
259 {};
261 //*************************************************************************************************
262 
263 } // namespace blaze
264 
265 #endif
Header file for the IsUniUpper type trait.
Header file for the YieldsStrictlyLower type trait.
decltype(auto) BLAZE_ALWAYS_INLINE load(const T1 &a, const T2 &b) const
Returns the result of the multiplication operation for the given SIMD vectors.
Definition: Mult.h:125
Header file for the SIMD multiplication functionality.
Mult()
Default constructor of the Mult functor.
Definition: Mult.h:82
Header file for the IsUniLower type trait.
static constexpr bool simdEnabled()
Returns whether SIMD is enabled for the specified data types T1 and T2.
Definition: Mult.h:106
#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
static constexpr bool paddingEnabled()
Returns whether the operation supports padding, i.e. whether it can deal with zeros.
Definition: Mult.h:114
Header file for the YieldsStrictlyUpper type trait.
Header file for the YieldsUniLower type trait.
Header file for the IsLower type trait.
Header file for the IsUniTriangular type trait.
Constraint on the data type.
Header file for the IsStrictlyLower type trait.
Header file for the HasSIMDMult type trait.
Header file for the YieldsUniform type trait.
Header file for the YieldsUpper type trait.
Header file for the YieldsLower type trait.
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant class template represents ...
Definition: IntegralConstant.h:101
Generic wrapper for the multiplication operator.
Definition: Mult.h:77
Header file for the IntegralConstant class template.
Header file for the IsUpper type trait.
Header file for the YieldsUniUpper type trait.
System settings for the inline keywords.