Subject: [Boost-bugs] [Boost C++ Libraries] #9392: BOOST_NOINLINE NVCC in __HOST__
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-11-14 16:52:44
#9392: BOOST_NOINLINE NVCC in __HOST__
--------------------------------+-------------------------
Reporter: a.huebl@⦠| Owner: johnmaddock
Type: Bugs | Status: new
Milestone: To Be Determined | Component: config
Version: Boost 1.55.0 | Severity: Problem
Keywords: NOINLINE NVCC HOST |
--------------------------------+-------------------------
I am compiling with '''gcc 4.6.2''' and CUDA ('''nvcc 5.0''', V0.2.1221)
causing an:
{{{
include/boost/assert.hpp:102:47: Error: »noinline« was not defined in
this scope
}}}
if I do '''not''' override with
{{{
-DBOOST_NOINLINE='__attribute__ ((noinline))'
}}}
The problem resides at ''boost/config/suffix.hpp''.
Affected files (using):
- ''include/boost/assert.hpp''
- ''include/boost/log/detail/spin_mutex.hpp''
That's strange, since it works in code not included in {{{__host__}}}
calls.
Example to reproduce the problem:
{{{
#include <stdlib.h> /* srand, rand */
#include <time.h> /* time */
#include <boost/assert.hpp>
__host__ void abc()
{
int i = 3;
BOOST_ASSERT_MSG( i%2 == 0, "MYMESSAGE" );
}
int main()
{
srand (time(NULL));
int i = rand() % 10 + 1;
BOOST_ASSERT_MSG( i%2 == 0, "MYMESSAGE" );
return 0;
}
}}}
Compile with:
- {{{nvcc main.cu}}}
- {{{nvcc -DBOOST_NOINLINE='__attribute__ ((noinline))' main.cu}}}
References:
- [http://gcc.gnu.org/onlinedocs/gcc-3.1.1/gcc/Function-Attributes.html
gcc 3.1.1 attributes] (without the {{{__}}})
- [http://gcc.gnu.org/onlinedocs/gcc-4.6.2/gcc/Function-Attributes.html
gcc 4.6.2 attributes] (allowing the {{{__}}})
- [https://svn.boost.org/trac/boost/ticket/8849 boost 1.54:]
{{{__attribute__((__visibility__("default")))}}}
-
[https://github.com/boostorg/utility/commit/b813232bba9a7f474e3efa3a2b9ad89cf874fa83
#diff-b76ed5c8913bc58c7aeeaa522f48d702 boost 1.55:] ''BOOST_NOINLINE'' in
''assert.hpp''
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/9392> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:14 UTC