fix priority operator bugs in the computation

of the VectorizableBit flag, now benchmark.cpp is properly vectorized
This commit is contained in:
Gael Guennebaud 2008-04-09 18:24:13 +00:00
parent 8f957564ec
commit 212da8ffe0
3 changed files with 6 additions and 5 deletions

View File

@ -51,7 +51,7 @@ struct ei_traits<CwiseUnaryOp<UnaryOp, MatrixType> >
MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime, MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime,
MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime, MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime,
Flags = (MatrixType::Flags & ~VectorizableBit) Flags = (MatrixType::Flags & ~VectorizableBit)
| (ei_functor_traits<UnaryOp>::IsVectorizable ? MatrixType::Flags & VectorizableBit : 0), | (ei_functor_traits<UnaryOp>::IsVectorizable ? (MatrixType::Flags & VectorizableBit) : 0),
CoeffReadCost = MatrixType::CoeffReadCost + ei_functor_traits<UnaryOp>::Cost CoeffReadCost = MatrixType::CoeffReadCost + ei_functor_traits<UnaryOp>::Cost
}; };
}; };

View File

@ -135,8 +135,9 @@ struct ei_traits<Product<Lhs, Rhs, EvalMode> >
| EvalBeforeAssigningBit | EvalBeforeAssigningBit
| (ei_product_eval_mode<Lhs, Rhs>::value == (int)CacheOptimal ? EvalBeforeNestingBit : 0)) | (ei_product_eval_mode<Lhs, Rhs>::value == (int)CacheOptimal ? EvalBeforeNestingBit : 0))
& (~(RowMajorBit | VectorizableBit)) & (~(RowMajorBit | VectorizableBit))
| (((!Lhs::Flags&RowMajorBit) && Lhs::Flags&VectorizableBit) ? VectorizableBit | (((!(Lhs::Flags & RowMajorBit)) && (Lhs::Flags & VectorizableBit)) ? VectorizableBit
: ((Rhs::Flags&RowMajorBit && Rhs::Flags&VectorizableBit) ? (RowMajorBit|VectorizableBit) : EIGEN_DEFAULT_MATRIX_STORAGE_ORDER)), : ((Rhs::Flags & RowMajorBit && (Rhs::Flags & VectorizableBit)) ? (RowMajorBit | VectorizableBit)
: EIGEN_DEFAULT_MATRIX_STORAGE_ORDER)),
CoeffReadCost CoeffReadCost
= Lhs::ColsAtCompileTime == Dynamic = Lhs::ColsAtCompileTime == Dynamic
? Dynamic ? Dynamic