mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-11 19:29:02 +08:00
Some cleaning in evaluators
This commit is contained in:
parent
e30bc89190
commit
5cc7251188
@ -311,7 +311,6 @@ struct dense_assignment_loop<Kernel, DefaultTraversal, CompleteUnrolling>
|
|||||||
template<typename Kernel>
|
template<typename Kernel>
|
||||||
struct dense_assignment_loop<Kernel, DefaultTraversal, InnerUnrolling>
|
struct dense_assignment_loop<Kernel, DefaultTraversal, InnerUnrolling>
|
||||||
{
|
{
|
||||||
typedef typename Kernel::StorageIndex StorageIndex;
|
|
||||||
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel)
|
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel)
|
||||||
{
|
{
|
||||||
typedef typename Kernel::DstEvaluatorType::XprType DstXprType;
|
typedef typename Kernel::DstEvaluatorType::XprType DstXprType;
|
||||||
@ -392,7 +391,6 @@ struct dense_assignment_loop<Kernel, LinearVectorizedTraversal, NoUnrolling>
|
|||||||
template<typename Kernel>
|
template<typename Kernel>
|
||||||
struct dense_assignment_loop<Kernel, LinearVectorizedTraversal, CompleteUnrolling>
|
struct dense_assignment_loop<Kernel, LinearVectorizedTraversal, CompleteUnrolling>
|
||||||
{
|
{
|
||||||
typedef typename Kernel::StorageIndex StorageIndex;
|
|
||||||
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel)
|
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel)
|
||||||
{
|
{
|
||||||
typedef typename Kernel::DstEvaluatorType::XprType DstXprType;
|
typedef typename Kernel::DstEvaluatorType::XprType DstXprType;
|
||||||
@ -438,7 +436,6 @@ struct dense_assignment_loop<Kernel, InnerVectorizedTraversal, CompleteUnrolling
|
|||||||
template<typename Kernel>
|
template<typename Kernel>
|
||||||
struct dense_assignment_loop<Kernel, InnerVectorizedTraversal, InnerUnrolling>
|
struct dense_assignment_loop<Kernel, InnerVectorizedTraversal, InnerUnrolling>
|
||||||
{
|
{
|
||||||
typedef typename Kernel::StorageIndex StorageIndex;
|
|
||||||
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel)
|
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE void run(Kernel &kernel)
|
||||||
{
|
{
|
||||||
typedef typename Kernel::DstEvaluatorType::XprType DstXprType;
|
typedef typename Kernel::DstEvaluatorType::XprType DstXprType;
|
||||||
@ -545,7 +542,6 @@ public:
|
|||||||
typedef DstEvaluatorTypeT DstEvaluatorType;
|
typedef DstEvaluatorTypeT DstEvaluatorType;
|
||||||
typedef SrcEvaluatorTypeT SrcEvaluatorType;
|
typedef SrcEvaluatorTypeT SrcEvaluatorType;
|
||||||
typedef typename DstEvaluatorType::Scalar Scalar;
|
typedef typename DstEvaluatorType::Scalar Scalar;
|
||||||
typedef typename DstEvaluatorType::StorageIndex StorageIndex;
|
|
||||||
typedef copy_using_evaluator_traits<DstEvaluatorTypeT, SrcEvaluatorTypeT, Functor> AssignmentTraits;
|
typedef copy_using_evaluator_traits<DstEvaluatorTypeT, SrcEvaluatorTypeT, Functor> AssignmentTraits;
|
||||||
typedef typename AssignmentTraits::PacketType PacketType;
|
typedef typename AssignmentTraits::PacketType PacketType;
|
||||||
|
|
||||||
|
@ -98,9 +98,6 @@ struct evaluator<const T>
|
|||||||
template<typename ExpressionType>
|
template<typename ExpressionType>
|
||||||
struct evaluator_base : public noncopyable
|
struct evaluator_base : public noncopyable
|
||||||
{
|
{
|
||||||
// FIXME is it really usefull?
|
|
||||||
typedef typename traits<ExpressionType>::StorageIndex StorageIndex;
|
|
||||||
|
|
||||||
// TODO that's not very nice to have to propagate all these traits. They are currently only needed to handle outer,inner indices.
|
// TODO that's not very nice to have to propagate all these traits. They are currently only needed to handle outer,inner indices.
|
||||||
typedef traits<ExpressionType> ExpressionTraits;
|
typedef traits<ExpressionType> ExpressionTraits;
|
||||||
|
|
||||||
@ -636,13 +633,16 @@ struct evaluator<Map<PlainObjectType, MapOptions, StrideType> >
|
|||||||
HasNoStride = HasNoInnerStride && HasNoOuterStride,
|
HasNoStride = HasNoInnerStride && HasNoOuterStride,
|
||||||
IsDynamicSize = PlainObjectType::SizeAtCompileTime==Dynamic,
|
IsDynamicSize = PlainObjectType::SizeAtCompileTime==Dynamic,
|
||||||
|
|
||||||
PacketAlignment = unpacket_traits<PacketScalar>::alignment,
|
// FIXME I don't get the code below, in particular why outer-stride-at-compile-time should have any effect on PacketAccessBit...
|
||||||
|
// Let's remove the code below for 3.4 if no issue occur
|
||||||
KeepsPacketAccess = bool(HasNoInnerStride)
|
// PacketAlignment = unpacket_traits<PacketScalar>::alignment,
|
||||||
&& ( bool(IsDynamicSize)
|
// KeepsPacketAccess = bool(HasNoInnerStride)
|
||||||
|| HasNoOuterStride
|
// && ( bool(IsDynamicSize)
|
||||||
|| ( OuterStrideAtCompileTime!=Dynamic
|
// || HasNoOuterStride
|
||||||
&& ((static_cast<int>(sizeof(Scalar))*OuterStrideAtCompileTime) % PacketAlignment)==0 ) ),
|
// || ( OuterStrideAtCompileTime!=Dynamic
|
||||||
|
// && ((static_cast<int>(sizeof(Scalar))*OuterStrideAtCompileTime) % PacketAlignment)==0 ) ),
|
||||||
|
KeepsPacketAccess = bool(HasNoInnerStride),
|
||||||
|
|
||||||
Flags0 = evaluator<PlainObjectType>::Flags,
|
Flags0 = evaluator<PlainObjectType>::Flags,
|
||||||
Flags1 = (bool(HasNoStride) || bool(PlainObjectType::IsVectorAtCompileTime))
|
Flags1 = (bool(HasNoStride) || bool(PlainObjectType::IsVectorAtCompileTime))
|
||||||
? int(Flags0) : int(Flags0 & ~LinearAccessBit),
|
? int(Flags0) : int(Flags0 & ~LinearAccessBit),
|
||||||
@ -825,14 +825,14 @@ struct block_evaluator<ArgType, BlockRows, BlockCols, InnerPanel, /* HasDirectAc
|
|||||||
EIGEN_DEVICE_FUNC explicit block_evaluator(const XprType& block)
|
EIGEN_DEVICE_FUNC explicit block_evaluator(const XprType& block)
|
||||||
: mapbase_evaluator<XprType, typename XprType::PlainObject>(block)
|
: mapbase_evaluator<XprType, typename XprType::PlainObject>(block)
|
||||||
{
|
{
|
||||||
// FIXME this should be an internal assertion
|
// TODO: for the 3.3 release, this should be turned to an internal assertion, but let's keep it as is for the beta lifetime
|
||||||
eigen_assert(((size_t(block.data()) % EIGEN_PLAIN_ENUM_MAX(1,evaluator<XprType>::Alignment)) == 0) && "data is not aligned");
|
eigen_assert(((size_t(block.data()) % EIGEN_PLAIN_ENUM_MAX(1,evaluator<XprType>::Alignment)) == 0) && "data is not aligned");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// -------------------- Select --------------------
|
// -------------------- Select --------------------
|
||||||
// TODO shall we introduce a ternary_evaluator?
|
// NOTE shall we introduce a ternary_evaluator?
|
||||||
|
|
||||||
// TODO enable vectorization for Select
|
// TODO enable vectorization for Select
|
||||||
template<typename ConditionMatrixType, typename ThenMatrixType, typename ElseMatrixType>
|
template<typename ConditionMatrixType, typename ThenMatrixType, typename ElseMatrixType>
|
||||||
@ -957,7 +957,7 @@ struct unary_evaluator<Replicate<ArgType, RowFactor, ColFactor> >
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const ArgTypeNested m_arg; // FIXME is it OK to store both the argument and its evaluator?? (we have the same situation in evaluator_product)
|
const ArgTypeNested m_arg;
|
||||||
evaluator<ArgTypeNestedCleaned> m_argImpl;
|
evaluator<ArgTypeNestedCleaned> m_argImpl;
|
||||||
const variable_if_dynamic<Index, ArgType::RowsAtCompileTime> m_rows;
|
const variable_if_dynamic<Index, ArgType::RowsAtCompileTime> m_rows;
|
||||||
const variable_if_dynamic<Index, ArgType::ColsAtCompileTime> m_cols;
|
const variable_if_dynamic<Index, ArgType::ColsAtCompileTime> m_cols;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user