Boost C++ Libraries: Ticket #9392: BOOST_NOINLINE NVCC in __HOST__ https://svn.boost.org/trac10/ticket/9392 <p> I am compiling with <strong>gcc 4.6.2</strong> and CUDA (<strong>nvcc 5.0</strong>, V0.2.1221) causing an: </p> <pre class="wiki">include/boost/assert.hpp:102:47: Error: »noinline« was not defined in this scope </pre><p> if I do <strong>not</strong> override with </p> <pre class="wiki">-DBOOST_NOINLINE='__attribute__ ((noinline))' </pre><p> The problem resides at <em>boost/config/suffix.hpp</em>. </p> <p> Affected files (using): </p> <ul><li><em>include/boost/assert.hpp</em> </li><li><em>include/boost/log/detail/spin_mutex.hpp</em> </li></ul><p> That's strange, since it works in code not included in <code>__host__</code> calls. </p> <p> Example to reproduce the problem: </p> <pre class="wiki">#include &lt;stdlib.h&gt; /* srand, rand */ #include &lt;time.h&gt; /* time */ #include &lt;boost/assert.hpp&gt; __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; } </pre><p> Compile with: </p> <ul><li><code>nvcc main.cu</code> </li><li><code>nvcc -DBOOST_NOINLINE='__attribute__ ((noinline))' main.cu</code> </li></ul><p> References: </p> <ul><li><a class="ext-link" href="http://gcc.gnu.org/onlinedocs/gcc-3.1.1/gcc/Function-Attributes.html"><span class="icon">​</span>gcc 3.1.1 attributes</a> (without the <code>__</code>) </li><li><a class="ext-link" href="http://gcc.gnu.org/onlinedocs/gcc-4.6.2/gcc/Function-Attributes.html"><span class="icon">​</span>gcc 4.6.2 attributes</a> (allowing the <code>__</code>) </li><li><a class="ext-link" href="https://svn.boost.org/trac/boost/ticket/8849"><span class="icon">​</span>boost 1.54:</a> <code>__attribute__((__visibility__("default")))</code> </li><li><a class="ext-link" href="https://github.com/boostorg/utility/commit/b813232bba9a7f474e3efa3a2b9ad89cf874fa83#diff-b76ed5c8913bc58c7aeeaa522f48d702"><span class="icon">​</span>boost 1.55:</a> <em>BOOST_NOINLINE</em> in <em>assert.hpp</em> </li></ul> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9392 Trac 1.4.3 a.huebl@… Tue, 26 Nov 2013 17:13:35 GMT attachment set https://svn.boost.org/trac10/ticket/9392 https://svn.boost.org/trac10/ticket/9392 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">nvcc.patch</span> </li> </ul> <p> patch for nvcc </p> Ticket a.huebl@… Tue, 26 Nov 2013 17:15:47 GMT <link>https://svn.boost.org/trac10/ticket/9392#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9392#comment:1</guid> <description> <p> the patch should work for <code>boost/config/suffix.hpp</code> 806db13db73d2773278f31bf2f96bcb8d3fe9bcf </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Fri, 13 Dec 2013 13:28:32 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/9392#comment:2 https://svn.boost.org/trac10/ticket/9392#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Fixed in Git develop. </p> Ticket a.huebl@… Thu, 02 Oct 2014 11:51:26 GMT <link>https://svn.boost.org/trac10/ticket/9392#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9392#comment:3</guid> <description> <p> Note: The latest CUDA release (version 6.5) fixed that problem in nvcc, too. </p> <p> nvbug: 1422182 submission ID: 391854 </p> </description> <category>Ticket</category> </item> </channel> </rss>