35 #ifndef _BLAZE_MATH_EXPRESSIONS_TDVECDVECMULTEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_TDVECDVECMULTEXPR_H_
75 struct TDVecDVecMultExprHelper
79 typedef RemoveReference_< CompositeType_<T1> > CT1;
82 typedef RemoveReference_< CompositeType_<T2> > CT2;
89 IsSame< ElementType_<CT1>, ElementType_<CT2> >::value &&
90 HasSIMDAdd< ElementType_<CT1>, ElementType_<CT1> >::value &&
91 HasSIMDMult< ElementType_<CT1>, ElementType_<CT1> >::value };
132 template<
typename T1
134 inline DisableIf_< TDVecDVecMultExprHelper<T1,T2>
135 ,
const MultTrait_< ElementType_<T1>, ElementType_<T2> > >
140 if( (~lhs).
size() != (~rhs).
size() ) {
150 if( (~lhs).
size() == 0UL )
return MultType();
155 MultType sp( left[0UL] * right[0UL] );
158 for( ; (i+4UL) <= left.size(); i+=4UL ) {
159 sp += left[i ] * right[i ] +
160 left[i+1UL] * right[i+1UL] +
161 left[i+2UL] * right[i+2UL] +
162 left[i+3UL] * right[i+3UL];
164 for( ; (i+2UL) <= left.size(); i+=2UL ) {
165 sp += left[i ] * right[i ] +
166 left[i+1UL] * right[i+1UL];
168 for( ; i<left.size(); ++i ) {
169 sp += left[i] * right[i];
205 template<
typename T1
207 inline EnableIf_< TDVecDVecMultExprHelper<T1,T2>
208 ,
const MultTrait_< ElementType_<T1>, ElementType_<T2> > >
213 if( (~lhs).
size() != (~rhs).
size() ) {
225 if( (~lhs).
size() == 0UL )
return MultType();
230 const size_t N( left.size() );
235 for( ; (i+SIMDSIZE*4UL) <= N; i+=SIMDSIZE*4UL ) {
236 xmm1 = xmm1 + ( left.load(i ) * right.load(i ) );
237 xmm2 = xmm2 + ( left.load(i+SIMDSIZE ) * right.load(i+SIMDSIZE ) );
238 xmm3 = xmm3 + ( left.load(i+SIMDSIZE*2UL) * right.load(i+SIMDSIZE*2UL) );
239 xmm4 = xmm4 + ( left.load(i+SIMDSIZE*3UL) * right.load(i+SIMDSIZE*3UL) );
241 for( ; (i+SIMDSIZE*2UL) <= N; i+=SIMDSIZE*2UL ) {
242 xmm1 = xmm1 + ( left.load(i ) * right.load(i ) );
243 xmm2 = xmm2 + ( left.load(i+SIMDSIZE) * right.load(i+SIMDSIZE) );
245 for( ; (i+SIMDSIZE) <= N; i+=SIMDSIZE ) {
246 xmm1 = xmm1 + ( left.load(i) * right.load(i) );
249 MultType sp(
sum( xmm1 + xmm2 + xmm3 + xmm4 ) );
252 sp += left[i] * right[i];
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
Header file for auxiliary alias declarations.
constexpr bool useOptimizedKernels
Configuration switch for optimized kernels.This configuration switch enables/disables all optimized c...
Definition: Optimizations.h:84
const DMatDMatMultExpr< T1, T2 > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:7800
Header file for basic type definitions.
BLAZE_ALWAYS_INLINE const complex< int8_t > sum(const SIMDcint8 &a) noexcept
Returns the sum of all elements in the 8-bit integral complex SIMD vector.
Definition: Reduction.h:63
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector) noexcept
Returns the current size/dimension of the vector.
Definition: Vector.h:258
Header file for the IsSame and IsStrictlySame type traits.
typename SIMDTrait< T >::Type SIMDTrait_
Auxiliary alias declaration for the SIMDTrait class template.The SIMDTrait_ alias declaration provide...
Definition: SIMDTrait.h:315
Header file for the DenseVector base class.
typename MultTrait< T1, T2 >::Type MultTrait_
Auxiliary alias declaration for the MultTrait class template.The MultTrait_ alias declaration provide...
Definition: MultTrait.h:245
System settings for performance optimizations.
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
Header file for the DisableIf class template.
Header file for the multiplication trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the HasSIMDAdd type trait.
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
Header file for all SIMD functionality.
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
Header file for the exception macros of the math module.
Header file for the EnableIf class template.
Header file for the HasSIMDMult type trait.
Header file for run time assertion macros.
SIMD characteristics of data types.The SIMDTrait class template provides the SIMD characteristics of ...
Definition: SIMDTrait.h:296
Header file for the RemoveReference type trait.
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
Header file for the FunctionTrace class.