I upgraded from 2.1 to 2.2 and got a problem when compiling my code.
Switching on the emulation mode nvcc says ‘support for exception handling is disabled’.
When compiling without “-deviceemu” the error messages disapear.
Everything worked fine with Cuda 2.1.
The statements raising execptions are in host code, I use Ubuntu 8.04.
As a rule of thumb, if I need to use any C++ classes or even C++ header files, I tend to separate that code out and compile it with the host compiler (gcc/g++ my case). At least check if you can avoid compiling that source file with/through nvcc. Basically the only thing you need nvcc for is the <<<>>> kernel calls, and the kernel code itself. And you want those in separate files, and not much else around them. I really like how GPUWorker / HOOMD organises code: [url=“http://www.ameslab.gov/hoomd/”]http://www.ameslab.gov/hoomd/[/url]
The rule about seperation is true. But sometimes it is nice if your launcher function can throw an exception in case of failure. Sadly this doesn’t work in -deviceemu for some reason, even though it works device mode.
I have similar problems in windows with 2.2 where it looks like the compiler was turning all host C++ code into C code in emulation mode only: [url=“http://forums.nvidia.com/index.php?showtopic=96858”]http://forums.nvidia.com/index.php?showtopic=96858[/url]. This would make the “support for exception handling disabled” error make sense, since exceptions aren’t supported in C. It seems to be something strange happening in the compiler.