diff options
author | Gael Guennebaud <g.gael@free.fr> | 2010-07-06 23:36:00 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2010-07-06 23:36:00 +0200 |
commit | bfa606d16fcb475025f55b226617c969a623877a (patch) | |
tree | 7ce851995e67f922301f4a29ff9fa9c45d3172aa /Eigen/src/Core/products/GeneralMatrixVector.h | |
parent | 38d0a0d5d6a28ac5cbf1323f85105dfd0a073725 (diff) |
* add a IsVectorized mechanism (instead of packet-size>1...)
* vectorize complex<double>
Diffstat (limited to 'Eigen/src/Core/products/GeneralMatrixVector.h')
-rw-r--r-- | Eigen/src/Core/products/GeneralMatrixVector.h | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/Eigen/src/Core/products/GeneralMatrixVector.h b/Eigen/src/Core/products/GeneralMatrixVector.h index 4cf843422..4df13f3be 100644 --- a/Eigen/src/Core/products/GeneralMatrixVector.h +++ b/Eigen/src/Core/products/GeneralMatrixVector.h @@ -55,7 +55,10 @@ void ei_cache_friendly_product_colmajor_times_vector( typedef typename NumTraits<Scalar>::Real RealScalar; typedef typename ei_packet_traits<Scalar>::type Packet; - const Index PacketSize = sizeof(Packet)/sizeof(Scalar); + enum { + PacketSize = sizeof(Packet)/sizeof(Scalar), + IsVectorized = ei_packet_traits<Scalar>::IsVectorized + }; ei_conj_helper<Scalar,Scalar,ConjugateLhs,ConjugateRhs> cj; ei_conj_helper<Packet,Packet,ConjugateLhs,ConjugateRhs> pcj; @@ -128,7 +131,7 @@ void ei_cache_friendly_product_colmajor_times_vector( const Scalar *lhs0 = lhs + i*lhsStride, *lhs1 = lhs + (i+offset1)*lhsStride, *lhs2 = lhs + (i+2)*lhsStride, *lhs3 = lhs + (i+offset3)*lhsStride; - if (PacketSize>1) + if (IsVectorized) { /* explicit vectorization */ // process initial unaligned coeffs @@ -216,7 +219,7 @@ void ei_cache_friendly_product_colmajor_times_vector( Packet ptmp0 = ei_pset1(alpha*rhs[i]); const Scalar* lhs0 = lhs + i*lhsStride; - if (PacketSize>1) + if (IsVectorized) { /* explicit vectorization */ // process first unaligned result's coeffs @@ -244,7 +247,7 @@ void ei_cache_friendly_product_colmajor_times_vector( } else break; - } while(PacketSize>1); + } while(IsVectorized); #undef _EIGEN_ACCUMULATE_PACKETS } @@ -269,7 +272,10 @@ static EIGEN_DONT_INLINE void ei_cache_friendly_product_rowmajor_times_vector( typedef typename NumTraits<Scalar>::Real RealScalar; typedef typename ei_packet_traits<Scalar>::type Packet; - const Index PacketSize = sizeof(Packet)/sizeof(Scalar); + enum { + PacketSize = sizeof(Packet)/sizeof(Scalar), + IsVectorized = ei_packet_traits<Scalar>::IsVectorized + }; ei_conj_helper<Scalar,Scalar,ConjugateLhs,ConjugateRhs> cj; ei_conj_helper<Packet,Packet,ConjugateLhs,ConjugateRhs> pcj; @@ -341,7 +347,7 @@ static EIGEN_DONT_INLINE void ei_cache_friendly_product_rowmajor_times_vector( const Scalar *lhs0 = lhs + i*lhsStride, *lhs1 = lhs + (i+offset1)*lhsStride, *lhs2 = lhs + (i+2)*lhsStride, *lhs3 = lhs + (i+offset3)*lhsStride; - if (PacketSize>1) + if (IsVectorized) { /* explicit vectorization */ Packet ptmp0 = ei_pset1(Scalar(0)), ptmp1 = ei_pset1(Scalar(0)), ptmp2 = ei_pset1(Scalar(0)), ptmp3 = ei_pset1(Scalar(0)); @@ -470,7 +476,7 @@ static EIGEN_DONT_INLINE void ei_cache_friendly_product_rowmajor_times_vector( } else break; - } while(PacketSize>1); + } while(IsVectorized); #undef _EIGEN_ACCUMULATE_PACKETS } |