Boost C++ Libraries: Ticket #12078: Warnings in boost/core/swap.hpp when using nvcc https://svn.boost.org/trac10/ticket/12078 <p> I get the following warning when I compile .cu files which uses the boost/core/swap.hpp file: </p> <pre class="wiki">~/sw/boost/include/boost/core/swap.hpp(36): warning: calling a __host__ function from a __host__ __device__ function is not allowed detected during: instantiation of "void boost_swap_impl::swap_impl(T &amp;, T &amp;) [with T=boost::signals2::detail::foreign_shared_ptr_impl_base *]" (56): here instantiation of "void boost::swap(T1 &amp;, T2 &amp;) [with T1=boost::signals2::detail::foreign_shared_ptr_impl_base *, T2=boost::signals2::detail::foreign_shared_ptr_impl_base *]" ~/sw/boost/include/boost/signals2/detail/foreign_ptr.hpp(111): here </pre><p> I get this even with the most recent git version (commit 3a94cde). The attached program gives this error when compiling like this: </p> <p> <code> nvcc -I ~/sw/boost/include test_swap.cu</code> </p> <p> I use CUDA 7.5 and g++ 4.9.2. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12078 Trac 1.4.3 Karl Ljungkvist <k.ljungkvist@…> Sat, 19 Mar 2016 16:02:09 GMT attachment set https://svn.boost.org/trac10/ticket/12078 https://svn.boost.org/trac10/ticket/12078 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">test_swap.cu</span> </li> </ul> <p> Minimal example giving the warning </p> Ticket viboes Fri, 19 Aug 2016 21:22:03 GMT component changed; owner set https://svn.boost.org/trac10/ticket/12078#comment:1 https://svn.boost.org/trac10/ticket/12078#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Peter Dimov</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">core</span> </li> </ul> Ticket