From b27a3644a24248606092357a0b11aae56e6dbb91 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Thu, 18 Dec 2008 13:36:31 +0000 Subject: [PATCH] Macros: add MSVC paths, add an important comment on EIGEN_ALIGN_128 --- Eigen/src/Core/CwiseBinaryOp.h | 2 +- Eigen/src/Core/util/Macros.h | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Eigen/src/Core/CwiseBinaryOp.h b/Eigen/src/Core/CwiseBinaryOp.h index b951ee0f3..f1bfebd50 100644 --- a/Eigen/src/Core/CwiseBinaryOp.h +++ b/Eigen/src/Core/CwiseBinaryOp.h @@ -101,8 +101,8 @@ class CwiseBinaryOp : ei_no_assignment_operator, // add together a float matrix and a double matrix. EIGEN_STATIC_ASSERT((ei_is_same_type::ret), you_mixed_different_numeric_types__you_need_to_use_the_cast_method_of_MatrixBase_to_cast_numeric_types_explicitly) - EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Lhs, Rhs) // require the sizes to match + EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Lhs, Rhs) ei_assert(lhs.rows() == rhs.rows() && lhs.cols() == rhs.cols()); } diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h index 4d6905964..312d863e7 100644 --- a/Eigen/src/Core/util/Macros.h +++ b/Eigen/src/Core/util/Macros.h @@ -90,22 +90,34 @@ using Eigen::ei_cos; // : function body not available #if EIGEN_GNUC_AT_LEAST(4,0) #define EIGEN_ALWAYS_INLINE __attribute__((always_inline)) inline +#elif (defined _MSC_VER) +#define EIGEN_ALWAYS_INLINE __forceinline #else #define EIGEN_ALWAYS_INLINE inline #endif #if (defined __GNUC__) #define EIGEN_DONT_INLINE __attribute__((noinline)) +#elif (defined _MSC_VER) +#define EIGEN_DONT_INLINE __declspec(noinline) #else #define EIGEN_DONT_INLINE #endif #if (defined __GNUC__) #define EIGEN_DEPRECATED __attribute__((deprecated)) +#elif (defined _MSC_VER) +#define EIGEN_DEPRECATED __declspec(deprecated) #else #define EIGEN_DEPRECATED #endif +/* EIGEN_ALIGN_128 forces data to be 16-byte aligned, EVEN if vectorization (EIGEN_VECTORIZE) is disabled, + * so that vectorization doesn't affect binary compatibility. + * + * If we made alignment depend on whether or not EIGEN_VECTORIZE is defined, it would be impossible to link + * vectorized and non-vectorized code. + */ #if (defined __GNUC__) #define EIGEN_ALIGN_128 __attribute__((aligned(16))) #elif (defined _MSC_VER)