mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-06-04 18:54:00 +08:00
Fix a few regression when moving the flags
This commit is contained in:
parent
0bd5671b9e
commit
a6be1952f4
@ -11,6 +11,13 @@
|
|||||||
#ifndef EIGEN_CORE_H
|
#ifndef EIGEN_CORE_H
|
||||||
#define EIGEN_CORE_H
|
#define EIGEN_CORE_H
|
||||||
|
|
||||||
|
// EIGEN_TEST_EVALUATORS => EIGEN_ENABLE_EVALUATORS
|
||||||
|
#ifdef EIGEN_TEST_EVALUATORS
|
||||||
|
#ifndef EIGEN_ENABLE_EVALUATORS
|
||||||
|
#define EIGEN_ENABLE_EVALUATORS
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
// first thing Eigen does: stop the compiler from committing suicide
|
// first thing Eigen does: stop the compiler from committing suicide
|
||||||
#include "src/Core/util/DisableStupidWarnings.h"
|
#include "src/Core/util/DisableStupidWarnings.h"
|
||||||
|
|
||||||
|
@ -126,6 +126,10 @@ public:
|
|||||||
EIGEN_DEBUG_VAR(PacketSize)
|
EIGEN_DEBUG_VAR(PacketSize)
|
||||||
EIGEN_DEBUG_VAR(StorageOrdersAgree)
|
EIGEN_DEBUG_VAR(StorageOrdersAgree)
|
||||||
EIGEN_DEBUG_VAR(MightVectorize)
|
EIGEN_DEBUG_VAR(MightVectorize)
|
||||||
|
std::cerr.setf(std::ios::hex, std::ios::basefield);
|
||||||
|
EIGEN_DEBUG_VAR(DstFlags)
|
||||||
|
EIGEN_DEBUG_VAR(SrcFlags)
|
||||||
|
std::cerr.unsetf(std::ios::hex);
|
||||||
EIGEN_DEBUG_VAR(MayLinearize)
|
EIGEN_DEBUG_VAR(MayLinearize)
|
||||||
EIGEN_DEBUG_VAR(MayInnerVectorize)
|
EIGEN_DEBUG_VAR(MayInnerVectorize)
|
||||||
EIGEN_DEBUG_VAR(MayLinearVectorize)
|
EIGEN_DEBUG_VAR(MayLinearVectorize)
|
||||||
|
@ -779,10 +779,10 @@ struct evaluator<Block<ArgType, BlockRows, BlockCols, InnerPanel> >
|
|||||||
MaskAlignedBit = (InnerPanel && (OuterStrideAtCompileTime!=Dynamic) && (((OuterStrideAtCompileTime * int(sizeof(Scalar))) % 16) == 0)) ? AlignedBit : 0,
|
MaskAlignedBit = (InnerPanel && (OuterStrideAtCompileTime!=Dynamic) && (((OuterStrideAtCompileTime * int(sizeof(Scalar))) % 16) == 0)) ? AlignedBit : 0,
|
||||||
FlagsLinearAccessBit = (RowsAtCompileTime == 1 || ColsAtCompileTime == 1) ? LinearAccessBit : 0,
|
FlagsLinearAccessBit = (RowsAtCompileTime == 1 || ColsAtCompileTime == 1) ? LinearAccessBit : 0,
|
||||||
FlagsRowMajorBit = XprType::Flags&RowMajorBit,
|
FlagsRowMajorBit = XprType::Flags&RowMajorBit,
|
||||||
Flags0 = traits<XprType>::Flags & ( (HereditaryBits & ~RowMajorBit) |
|
Flags0 = evaluator<ArgType>::Flags & ( (HereditaryBits & ~RowMajorBit) |
|
||||||
DirectAccessBit |
|
DirectAccessBit |
|
||||||
MaskPacketAccessBit |
|
MaskPacketAccessBit |
|
||||||
MaskAlignedBit),
|
MaskAlignedBit),
|
||||||
Flags = Flags0 | FlagsLinearAccessBit | FlagsRowMajorBit
|
Flags = Flags0 | FlagsLinearAccessBit | FlagsRowMajorBit
|
||||||
};
|
};
|
||||||
typedef block_evaluator<ArgType, BlockRows, BlockCols, InnerPanel> block_evaluator_type;
|
typedef block_evaluator<ArgType, BlockRows, BlockCols, InnerPanel> block_evaluator_type;
|
||||||
|
@ -117,6 +117,9 @@ struct traits<Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
|
|||||||
Flags = compute_matrix_flags<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>::ret,
|
Flags = compute_matrix_flags<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>::ret,
|
||||||
#ifndef EIGEN_TEST_EVALUATORS
|
#ifndef EIGEN_TEST_EVALUATORS
|
||||||
CoeffReadCost = NumTraits<Scalar>::ReadCost,
|
CoeffReadCost = NumTraits<Scalar>::ReadCost,
|
||||||
|
#else
|
||||||
|
// FIXME, the following flag in only used to define NeedsToAlign in PlainObjectBase
|
||||||
|
EvaluatorFlags = compute_matrix_evaluator_flags<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>::ret,
|
||||||
#endif
|
#endif
|
||||||
Options = _Options,
|
Options = _Options,
|
||||||
InnerStrideAtCompileTime = 1,
|
InnerStrideAtCompileTime = 1,
|
||||||
|
@ -128,7 +128,11 @@ class PlainObjectBase : public internal::dense_xpr_base<Derived>::type
|
|||||||
DenseStorage<Scalar, Base::MaxSizeAtCompileTime, Base::RowsAtCompileTime, Base::ColsAtCompileTime, Options> m_storage;
|
DenseStorage<Scalar, Base::MaxSizeAtCompileTime, Base::RowsAtCompileTime, Base::ColsAtCompileTime, Options> m_storage;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
#ifndef EIGEN_TEST_EVALUATORS
|
||||||
enum { NeedsToAlign = SizeAtCompileTime != Dynamic && (internal::traits<Derived>::Flags & AlignedBit) != 0 };
|
enum { NeedsToAlign = SizeAtCompileTime != Dynamic && (internal::traits<Derived>::Flags & AlignedBit) != 0 };
|
||||||
|
#else
|
||||||
|
enum { NeedsToAlign = SizeAtCompileTime != Dynamic && (internal::traits<Derived>::EvaluatorFlags & AlignedBit) != 0 };
|
||||||
|
#endif
|
||||||
EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF(NeedsToAlign)
|
EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF(NeedsToAlign)
|
||||||
|
|
||||||
EIGEN_DEVICE_FUNC
|
EIGEN_DEVICE_FUNC
|
||||||
|
@ -51,6 +51,14 @@ struct traits<Product<Lhs, Rhs, Option> >
|
|||||||
MaxRowsAtCompileTime = LhsCleaned::MaxRowsAtCompileTime,
|
MaxRowsAtCompileTime = LhsCleaned::MaxRowsAtCompileTime,
|
||||||
MaxColsAtCompileTime = RhsCleaned::MaxColsAtCompileTime,
|
MaxColsAtCompileTime = RhsCleaned::MaxColsAtCompileTime,
|
||||||
|
|
||||||
|
// FIXME: only needed by GeneralMatrixMatrixTriangular
|
||||||
|
InnerSize = EIGEN_SIZE_MIN_PREFER_FIXED(LhsCleaned::ColsAtCompileTime, RhsCleaned::RowsAtCompileTime),
|
||||||
|
|
||||||
|
#ifndef EIGEN_TEST_EVALUATORS
|
||||||
|
// dummy, for evaluators unit test only
|
||||||
|
CoeffReadCost = Dynamic,
|
||||||
|
#endif
|
||||||
|
|
||||||
// The storage order is somewhat arbitrary here. The correct one will be determined through the evaluator.
|
// The storage order is somewhat arbitrary here. The correct one will be determined through the evaluator.
|
||||||
Flags = (MaxRowsAtCompileTime==1 ? RowMajorBit : 0)
|
Flags = (MaxRowsAtCompileTime==1 ? RowMajorBit : 0)
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user