I would like to use boost::function objects in host code contained in a CUDA file. However, when including <boost/function.hpp>, nvcc (CUDA 2.0 with VS2005 express) refuses to compile the code (which compiles in .cpp files with VS2005 express). The error message is:
function_base.hpp(507): error: must be included before typeid is used
function_base.hpp(507): error: no suitable user-defined conversion from “const type_info” to “const type_info” exists
The strange thing is that is included by function_base.hpp before typeid is used.
This annoys me also because it prohibits use of several other boost libraries since they include this file.
Same here, although I did get a more sensible error message
[codebox]/usr/include/boost/function/function_template.hpp(786): internal error: assertion failed: gen_initializer_constant: ran out of fields (/home/buildmeister/nightly/rel/gpgpu/toolkit/r2.1/compiler/edg/EDG_3.9/src/cp_gen_be.c, line 3295)
1 catastrophic error detected in the compilation of “CudaCollision.cpp1.ii”.
Compilation aborted.[/codebox]
I wonder if there’s a chance that a fix of this would make it into version 2.2?