look at that subtle difference in Product.h...

the cacheOptimal is only good for large enough matrices.
When taking a block in a fixed-size (hence small) matrix,
the SizeAtCompileTime is Dynamic hence that's not a good
indicator. This example shows that the good indicator is
MaxSizeAtCompileTime.
Result: +10% speed in echelon.cpp
This commit is contained in:
Benoit Jacob
2008-03-26 09:29:29 +00:00
parent a994e51c96
commit c9b0dcd733
2 changed files with 4 additions and 3 deletions

View File

@@ -91,8 +91,9 @@ struct ei_product_eval_mode
{
enum {
SizeAtCompileTime = MatrixBase<Product<Lhs,Rhs,UnrolledDotProduct> >::SizeAtCompileTime,
MaxSizeAtCompileTime = MatrixBase<Product<Lhs,Rhs,UnrolledDotProduct> >::MaxSizeAtCompileTime,
EvalMode = ( EIGEN_UNROLLED_LOOPS
&& SizeAtCompileTime != Dynamic
&& MaxSizeAtCompileTime != Dynamic
&& SizeAtCompileTime <= EIGEN_UNROLLING_LIMIT) ? UnrolledDotProduct : CacheOptimal,
};
};