mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-26 14:54:30 +08:00
fix bug introduced yesterday preventing vectorization of vectors when the storage order is not "the right one".
expand a little the vectorization_logic test and backport EIGEN_DEBUG_ASSIGN.
This commit is contained in:
parent
eaa81c135a
commit
e7b6a4bcba
@ -90,6 +90,28 @@ public:
|
|||||||
? ( int(MayUnrollCompletely) && int(DstIsAligned) ? int(CompleteUnrolling) : int(NoUnrolling) )
|
? ( int(MayUnrollCompletely) && int(DstIsAligned) ? int(CompleteUnrolling) : int(NoUnrolling) )
|
||||||
: int(NoUnrolling)
|
: int(NoUnrolling)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef EIGEN_DEBUG_ASSIGN
|
||||||
|
#define EIGEN_DEBUG_VAR(x) std::cerr << #x << " = " << x << std::endl;
|
||||||
|
static void debug()
|
||||||
|
{
|
||||||
|
EIGEN_DEBUG_VAR(DstIsAligned)
|
||||||
|
EIGEN_DEBUG_VAR(SrcIsAligned)
|
||||||
|
EIGEN_DEBUG_VAR(SrcAlignment)
|
||||||
|
EIGEN_DEBUG_VAR(InnerSize)
|
||||||
|
EIGEN_DEBUG_VAR(InnerMaxSize)
|
||||||
|
EIGEN_DEBUG_VAR(PacketSize)
|
||||||
|
EIGEN_DEBUG_VAR(MightVectorize)
|
||||||
|
EIGEN_DEBUG_VAR(MayInnerVectorize)
|
||||||
|
EIGEN_DEBUG_VAR(MayLinearVectorize)
|
||||||
|
EIGEN_DEBUG_VAR(MaySliceVectorize)
|
||||||
|
EIGEN_DEBUG_VAR(Vectorization)
|
||||||
|
EIGEN_DEBUG_VAR(UnrollingLimit)
|
||||||
|
EIGEN_DEBUG_VAR(MayUnrollCompletely)
|
||||||
|
EIGEN_DEBUG_VAR(MayUnrollInner)
|
||||||
|
EIGEN_DEBUG_VAR(Unrolling)
|
||||||
|
}
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
@ -400,6 +422,9 @@ template<typename OtherDerived>
|
|||||||
EIGEN_STRONG_INLINE Derived& MatrixBase<Derived>
|
EIGEN_STRONG_INLINE Derived& MatrixBase<Derived>
|
||||||
::lazyAssign(const MatrixBase<OtherDerived>& other)
|
::lazyAssign(const MatrixBase<OtherDerived>& other)
|
||||||
{
|
{
|
||||||
|
#ifdef EIGEN_DEBUG_ASSIGN
|
||||||
|
ei_assign_traits<Derived, OtherDerived>::debug();
|
||||||
|
#endif
|
||||||
EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Derived,OtherDerived)
|
EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Derived,OtherDerived)
|
||||||
EIGEN_STATIC_ASSERT((ei_is_same_type<typename Derived::Scalar, typename OtherDerived::Scalar>::ret),
|
EIGEN_STATIC_ASSERT((ei_is_same_type<typename Derived::Scalar, typename OtherDerived::Scalar>::ret),
|
||||||
YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)
|
YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)
|
||||||
|
@ -94,7 +94,9 @@ class ei_compute_matrix_flags
|
|||||||
{
|
{
|
||||||
enum {
|
enum {
|
||||||
row_major_bit = Options&RowMajor ? RowMajorBit : 0,
|
row_major_bit = Options&RowMajor ? RowMajorBit : 0,
|
||||||
inner_max_size = row_major_bit ? MaxCols : MaxRows,
|
inner_max_size = int(MaxRows==1) ? int(MaxCols)
|
||||||
|
: int(MaxCols==1) ? int(MaxRows)
|
||||||
|
: int(row_major_bit) ? int(MaxCols) : int(MaxRows),
|
||||||
is_big = inner_max_size == Dynamic,
|
is_big = inner_max_size == Dynamic,
|
||||||
storage_has_fixed_size = MaxRows != Dynamic && MaxCols != Dynamic,
|
storage_has_fixed_size = MaxRows != Dynamic && MaxCols != Dynamic,
|
||||||
storage_has_aligned_fixed_size = storage_has_fixed_size
|
storage_has_aligned_fixed_size = storage_has_fixed_size
|
||||||
|
@ -85,6 +85,8 @@ void test_vectorization_logic()
|
|||||||
VERIFY(test_assign(MatrixXf(10,10),MatrixXf(20,20).block(10,10,2,3),
|
VERIFY(test_assign(MatrixXf(10,10),MatrixXf(20,20).block(10,10,2,3),
|
||||||
SliceVectorization,NoUnrolling));
|
SliceVectorization,NoUnrolling));
|
||||||
|
|
||||||
|
VERIFY(test_assign(VectorXf(10),VectorXf(10)+VectorXf(10),
|
||||||
|
LinearVectorization,NoUnrolling));
|
||||||
|
|
||||||
VERIFY(test_sum(VectorXf(10),
|
VERIFY(test_sum(VectorXf(10),
|
||||||
LinearVectorization,NoUnrolling));
|
LinearVectorization,NoUnrolling));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user