Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#9392 closed Bugs (fixed)

BOOST_NOINLINE NVCC in __HOST__

Reported by: a.huebl@… 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:

Attachments (1)

nvcc.patch (352 bytes ) - added by a.huebl@… 9 years ago.
patch for nvcc

Download all attachments as: .zip

Change History (4)

by a.huebl@…, 9 years ago

Attachment: nvcc.patch added

patch for nvcc

comment:1 by a.huebl@…, 9 years ago

the patch should work for boost/config/suffix.hpp 806db13db73d2773278f31bf2f96bcb8d3fe9bcf

comment:2 by John Maddock, 9 years ago

Resolution: fixed
Status: newclosed

Fixed in Git develop.

comment:3 by a.huebl@…, 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.