From 64a85800bd3573a7da7a396fde9707dce87a58d9 Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Wed, 29 Jan 2014 11:43:05 -0800 Subject: Added support for AVX to Eigen. --- Eigen/src/Core/Redux.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'Eigen/src/Core/Redux.h') diff --git a/Eigen/src/Core/Redux.h b/Eigen/src/Core/Redux.h index b2c775d90..5b82c9a65 100644 --- a/Eigen/src/Core/Redux.h +++ b/Eigen/src/Core/Redux.h @@ -303,10 +303,15 @@ struct redux_impl static EIGEN_STRONG_INLINE Scalar run(const Derived& mat, const Func& func) { eigen_assert(mat.rows()>0 && mat.cols()>0 && "you are using an empty matrix"); - Scalar res = func.predux(redux_vec_unroller::run(mat,func)); - if (VectorizedSize != Size) - res = func(res,redux_novec_unroller::run(mat,func)); - return res; + if (VectorizedSize > 0) { + Scalar res = func.predux(redux_vec_unroller::run(mat,func)); + if (VectorizedSize != Size) + res = func(res,redux_novec_unroller::run(mat,func)); + return res; + } + else { + return redux_novec_unroller::run(mat,func); + } } }; -- cgit v1.2.3