This forum has been archived. All content is frozen. Please use KDE Discuss instead.

warning forceinline not inlined

Tags: None
(comma "," separated)
xaffeine
Registered Member
Posts
24
Karma
0

warning forceinline not inlined

Mon Apr 21, 2014 6:20 pm
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> ]
User avatar
benoitsteiner
Registered Member
Posts
13
Karma
0

Re: warning forceinline not inlined

Tue Apr 22, 2014 4:27 am
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.


xaffeine
Registered Member
Posts
24
Karma
0

Re: warning forceinline not inlined

Tue Apr 22, 2014 5:21 pm
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?
User avatar
benoitsteiner
Registered Member
Posts
13
Karma
0

Re: warning forceinline not inlined

Wed Apr 23, 2014 3:37 am
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.


xaffeine
Registered Member
Posts
24
Karma
0

Re: warning forceinline not inlined

Wed Apr 23, 2014 10:49 pm
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.


Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], Google [Bot], rblackwell