mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-13 20:26:03 +08:00
Remove HasEvalTo and all at once eval mode
This commit is contained in:
parent
cc6dd878ee
commit
5584275325
@ -32,8 +32,7 @@ public:
|
|||||||
DstIsAligned = Derived::Flags & AlignedBit,
|
DstIsAligned = Derived::Flags & AlignedBit,
|
||||||
DstHasDirectAccess = Derived::Flags & DirectAccessBit,
|
DstHasDirectAccess = Derived::Flags & DirectAccessBit,
|
||||||
SrcIsAligned = OtherDerived::Flags & AlignedBit,
|
SrcIsAligned = OtherDerived::Flags & AlignedBit,
|
||||||
JointAlignment = bool(DstIsAligned) && bool(SrcIsAligned) ? Aligned : Unaligned,
|
JointAlignment = bool(DstIsAligned) && bool(SrcIsAligned) ? Aligned : Unaligned
|
||||||
SrcEvalBeforeAssign = (evaluator_traits<OtherDerived>::HasEvalTo == 1)
|
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -68,8 +67,7 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
enum {
|
enum {
|
||||||
Traversal = int(SrcEvalBeforeAssign) ? int(AllAtOnceTraversal)
|
Traversal = int(MayInnerVectorize) ? int(InnerVectorizedTraversal)
|
||||||
: int(MayInnerVectorize) ? int(InnerVectorizedTraversal)
|
|
||||||
: int(MayLinearVectorize) ? int(LinearVectorizedTraversal)
|
: int(MayLinearVectorize) ? int(LinearVectorizedTraversal)
|
||||||
: int(MaySliceVectorize) ? int(SliceVectorizedTraversal)
|
: int(MaySliceVectorize) ? int(SliceVectorizedTraversal)
|
||||||
: int(MayLinearize) ? int(LinearTraversal)
|
: int(MayLinearize) ? int(LinearTraversal)
|
||||||
@ -496,23 +494,6 @@ struct dense_assignment_loop<Kernel, SliceVectorizedTraversal, NoUnrolling>
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/****************************
|
|
||||||
*** All-at-once traversal ***
|
|
||||||
****************************/
|
|
||||||
|
|
||||||
// TODO: this 'AllAtOnceTraversal' should be dropped or caught earlier (Gael)
|
|
||||||
// Indeed, what to do with the kernel's functor??
|
|
||||||
template<typename Kernel>
|
|
||||||
struct dense_assignment_loop<Kernel, AllAtOnceTraversal, NoUnrolling>
|
|
||||||
{
|
|
||||||
static inline void run(Kernel & kernel)
|
|
||||||
{
|
|
||||||
// Evaluate rhs in temporary to prevent aliasing problems in a = a * a;
|
|
||||||
// TODO: Do not pass the xpr object to evalTo() (Jitse)
|
|
||||||
kernel.srcEvaluator().evalTo(kernel.dstEvaluator(), kernel.dstExpression());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Part 4 : Generic dense assignment kernel
|
* Part 4 : Generic dense assignment kernel
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
@ -22,10 +22,6 @@ namespace internal {
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
struct evaluator_traits
|
struct evaluator_traits
|
||||||
{
|
{
|
||||||
// 1 if evaluator_impl<T>::evalTo() exists
|
|
||||||
// 0 if evaluator_impl<T> allows coefficient-based access
|
|
||||||
static const int HasEvalTo = 0;
|
|
||||||
|
|
||||||
// 1 if assignment A = B assumes aliasing when B is of type T and thus B needs to be evaluated into a
|
// 1 if assignment A = B assumes aliasing when B is of type T and thus B needs to be evaluated into a
|
||||||
// temporary; 0 if not.
|
// temporary; 0 if not.
|
||||||
static const int AssumeAliasing = 0;
|
static const int AssumeAliasing = 0;
|
||||||
@ -37,32 +33,16 @@ template<typename ArgType>
|
|||||||
class EvalToTemp;
|
class EvalToTemp;
|
||||||
|
|
||||||
// evaluator<T>::type is type of evaluator for T
|
// evaluator<T>::type is type of evaluator for T
|
||||||
// evaluator<T>::nestedType is type of evaluator if T is nested inside another evaluator
|
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct evaluator_impl
|
struct evaluator_impl
|
||||||
{ };
|
{ };
|
||||||
|
|
||||||
template<typename T, int Nested = evaluator_traits<T>::HasEvalTo>
|
|
||||||
struct evaluator_nested_type;
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
struct evaluator_nested_type<T, 0>
|
|
||||||
{
|
|
||||||
typedef evaluator_impl<T> type;
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
struct evaluator_nested_type<T, 1>
|
|
||||||
{
|
|
||||||
typedef evaluator_impl<EvalToTemp<T> > type;
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct evaluator
|
struct evaluator
|
||||||
{
|
{
|
||||||
typedef evaluator_impl<T> type;
|
typedef evaluator_impl<T> type;
|
||||||
typedef typename evaluator_nested_type<T>::type nestedType;
|
typedef evaluator_impl<T> nestedType;
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: Think about const-correctness
|
// TODO: Think about const-correctness
|
||||||
|
Loading…
x
Reference in New Issue
Block a user