![]() Registered Member ![]()
|
My compiler gives me warnings that a certain function marked as __forceinline is not inlined. I am using the Microsoft Visual C++ 10 (2010) compiler. I could also use the Intel 2013 compiler, but that gives many more warnings.
Is this a bug in Eigen or is there something I should be doing differently? Here is a simple example. void MyMul( const Eigen::MatrixXf & aa, const Eigen::MatrixXf & bb, Eigen::MatrixXf & cc ) { cc = aa * bb; // warning __forceinline not inlined } The full warning message is: 1>p:\private_bug11010\devel\thirdparty\eigen\eigen-eigen-6b38706d90a9\eigen\src/Core/CwiseNullaryOp.h(81): warning C4714: function 'const Eigen::Matrix<_Scalar,_Rows,_Cols> Eigen::DenseBase<Derived>::eval(void) const' marked as __forceinline not inlined 1> with 1> [ 1> _Scalar=float, 1> _Rows=-1, 1> _Cols=-1, 1> Derived=Eigen::GeneralProduct<Eigen::Matrix<float,-1,-1>,Eigen::Matrix<float,-1,-1>,5> 1> ] 1> p:\private_bug11010\devel\thirdparty\eigen\eigen-eigen-6b38706d90a9\eigen\src/Core/DenseBase.h(362) : see declaration of 'Eigen::DenseBase<Derived>::eval' 1> with 1> [ 1> Derived=Eigen::GeneralProduct<Eigen::Matrix<float,-1,-1>,Eigen::Matrix<float,-1,-1>,5> 1> ] |
![]() Registered Member ![]()
|
Are you attempting to compile a debug or an optimized build? IIRC in the case of a debug build, MSVC will not attempt to inline the code as requested by the __forceinline statement but instead issue numerous warnings.
|
![]() Registered Member ![]()
|
It is the same in release and debug builds. I am building a 64-bit dll (a mex function). I wonder if building for dll makes a difference.
Or could it be that it just can't inline functions that take Eigen::Map<Eigen::MatrixXf> reference args? |
![]() Registered Member ![]()
|
I just found out that this warning is explicitly silenced in the Eigen CMakeLists.txt when compiling with Visual Studio. So to answer your original question it looks like this warning is expected and you can disable it by invoking MSVC with the /wd4714 option.
|
![]() Registered Member ![]()
|
OK, I might do that or put pragma in the code (where I can also add a comment).
Still, I keep wondering if it's a bug that forceinline is specified for something that can't be inlined on either the Intel or Microsoft compiler. |
Registered users: Baidu [Spider], Bing [Bot], Google [Bot], rblackwell