Remove HasEvalTo and all at once eval mode

This commit is contained in:
Gael Guennebaud 2013-11-29 13:38:59 +01:00
parent cc6dd878ee
commit 5584275325
2 changed files with 3 additions and 42 deletions

View File

@ -32,8 +32,7 @@ public:
DstIsAligned = Derived::Flags & AlignedBit,
DstHasDirectAccess = Derived::Flags & DirectAccessBit,
SrcIsAligned = OtherDerived::Flags & AlignedBit,
JointAlignment = bool(DstIsAligned) && bool(SrcIsAligned) ? Aligned : Unaligned,
SrcEvalBeforeAssign = (evaluator_traits<OtherDerived>::HasEvalTo == 1)
JointAlignment = bool(DstIsAligned) && bool(SrcIsAligned) ? Aligned : Unaligned
};
private:
@ -68,8 +67,7 @@ private:
public:
enum {
Traversal = int(SrcEvalBeforeAssign) ? int(AllAtOnceTraversal)
: int(MayInnerVectorize) ? int(InnerVectorizedTraversal)
Traversal = int(MayInnerVectorize) ? int(InnerVectorizedTraversal)
: int(MayLinearVectorize) ? int(LinearVectorizedTraversal)
: int(MaySliceVectorize) ? int(SliceVectorizedTraversal)
: 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
***************************************************************************/

View File

@ -22,10 +22,6 @@ namespace internal {
template<typename T>
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
// temporary; 0 if not.
static const int AssumeAliasing = 0;
@ -37,32 +33,16 @@ template<typename ArgType>
class EvalToTemp;
// 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>
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>
struct evaluator
{
typedef evaluator_impl<T> type;
typedef typename evaluator_nested_type<T>::type nestedType;
typedef evaluator_impl<T> nestedType;
};
// TODO: Think about const-correctness