Lines 125-165
Link Here
|
125 |
// concatenate two tokens |
125 |
// concatenate two tokens |
126 |
#define EIGEN_CAT2(a,b) a ## b |
126 |
#define EIGEN_CAT2(a,b) a ## b |
127 |
#define EIGEN_CAT(a,b) EIGEN_CAT2(a,b) |
127 |
#define EIGEN_CAT(a,b) EIGEN_CAT2(a,b) |
128 |
|
128 |
|
129 |
// convert a token to a string |
129 |
// convert a token to a string |
130 |
#define EIGEN_MAKESTRING2(a) #a |
130 |
#define EIGEN_MAKESTRING2(a) #a |
131 |
#define EIGEN_MAKESTRING(a) EIGEN_MAKESTRING2(a) |
131 |
#define EIGEN_MAKESTRING(a) EIGEN_MAKESTRING2(a) |
132 |
|
132 |
|
133 |
// EIGEN_ALWAYS_INLINE_ATTRIB should be use in the declaration of function |
|
|
134 |
// which should be inlined even in debug mode. |
135 |
// FIXME with the always_inline attribute, |
136 |
// gcc 3.4.x reports the following compilation error: |
137 |
// Eval.h:91: sorry, unimplemented: inlining failed in call to 'const Eigen::Eval<Derived> Eigen::MatrixBase<Scalar, Derived>::eval() const' |
138 |
// : function body not available |
139 |
#if EIGEN_GNUC_AT_LEAST(4,0) |
140 |
#define EIGEN_ALWAYS_INLINE_ATTRIB __attribute__((always_inline)) |
141 |
#else |
142 |
#define EIGEN_ALWAYS_INLINE_ATTRIB |
143 |
#endif |
144 |
|
145 |
#if EIGEN_GNUC_AT_LEAST(4,1) && !defined(__clang__) && !defined(__INTEL_COMPILER) |
133 |
#if EIGEN_GNUC_AT_LEAST(4,1) && !defined(__clang__) && !defined(__INTEL_COMPILER) |
146 |
#define EIGEN_FLATTEN_ATTRIB __attribute__((flatten)) |
134 |
#define EIGEN_FLATTEN_ATTRIB __attribute__((flatten)) |
147 |
#else |
135 |
#else |
148 |
#define EIGEN_FLATTEN_ATTRIB |
136 |
#define EIGEN_FLATTEN_ATTRIB |
149 |
#endif |
137 |
#endif |
150 |
|
138 |
|
151 |
// EIGEN_FORCE_INLINE means "inline as much as possible" |
139 |
// EIGEN_STRONG_INLINE is a stronger version of the inline, using __forceinline on MSVC, |
|
|
140 |
// but it still doesn't use GCC's always_inline. This is useful in (common) situations where MSVC needs forceinline |
141 |
// but GCC is still doing fine with just inline. |
152 |
#if (defined _MSC_VER) || (defined __INTEL_COMPILER) |
142 |
#if (defined _MSC_VER) || (defined __INTEL_COMPILER) |
153 |
#define EIGEN_STRONG_INLINE __forceinline |
143 |
#define EIGEN_STRONG_INLINE __forceinline |
154 |
#else |
144 |
#else |
155 |
#define EIGEN_STRONG_INLINE inline |
145 |
#define EIGEN_STRONG_INLINE inline |
156 |
#endif |
146 |
#endif |
157 |
|
147 |
|
|
|
148 |
// EIGEN_ALWAYS_INLINE is the stronget, it has the effect of making the function inline and adding every possible |
149 |
// attribute to maximize inlining. This should only be used when really necessary: in particular, |
150 |
// it uses __attribute__((always_inline)) on GCC, which most of the time is useless and can severely harm compile times. |
151 |
// FIXME with the always_inline attribute, |
152 |
// gcc 3.4.x reports the following compilation error: |
153 |
// Eval.h:91: sorry, unimplemented: inlining failed in call to 'const Eigen::Eval<Derived> Eigen::MatrixBase<Scalar, Derived>::eval() const' |
154 |
// : function body not available |
155 |
#if EIGEN_GNUC_AT_LEAST(4,0) |
156 |
#define EIGEN_ALWAYS_INLINE __attribute__((always_inline)) inline |
157 |
#else |
158 |
#define EIGEN_ALWAYS_INLINE EIGEN_STRONG_INLINE |
159 |
#endif |
160 |
|
158 |
#if (defined __GNUC__) |
161 |
#if (defined __GNUC__) |
159 |
#define EIGEN_DONT_INLINE __attribute__((noinline)) |
162 |
#define EIGEN_DONT_INLINE __attribute__((noinline)) |
160 |
#elif (defined _MSC_VER) |
163 |
#elif (defined _MSC_VER) |
161 |
#define EIGEN_DONT_INLINE __declspec(noinline) |
164 |
#define EIGEN_DONT_INLINE __declspec(noinline) |
162 |
#else |
165 |
#else |
163 |
#define EIGEN_DONT_INLINE |
166 |
#define EIGEN_DONT_INLINE |
164 |
#endif |
167 |
#endif |
165 |
|
168 |
|