#9392 closed Bugs (fixed)
BOOST_NOINLINE NVCC in __HOST__
Reported by: | Owned by: | John Maddock | |
---|---|---|---|
Milestone: | To Be Determined | Component: | config |
Version: | Boost 1.55.0 | Severity: | Problem |
Keywords: | NOINLINE NVCC HOST | Cc: |
Description
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:
- gcc 3.1.1 attributes (without the
__
) - gcc 4.6.2 attributes (allowing the
__
) - boost 1.54:
__attribute__((__visibility__("default")))
- boost 1.55: BOOST_NOINLINE in assert.hpp
Attachments (1)
Change History (4)
by , 9 years ago
Attachment: | nvcc.patch added |
---|
comment:1 by , 9 years ago
the patch should work for boost/config/suffix.hpp
806db13db73d2773278f31bf2f96bcb8d3fe9bcf
comment:3 by , 8 years ago
Note: The latest CUDA release (version 6.5) fixed that problem in nvcc, too.
nvbug: 1422182 submission ID: 391854
Note:
See TracTickets
for help on using tickets.
patch for nvcc