my project uses 2 different C++ compilers, g++ and nvcc (cuda compiler).
I have noticed exception thrown from nvcc object files are not caught in g++ object files.
are C++ exceptions supposed to be binary compatible in the same machine?
what can cause such behavior?
try { kernel_= new cuda:: Kernel(); }
catch (...) { kernel_= NULL; }
// nvcc object
cuda:: Kernel:: Kernel () {
...
if (! impl_) throw;
}
everything else seems to work (C++ objects, operators). To be honest I do not know exceptions very well so maybe there is mistake in the code above.
nvcc is a wrapper around a normal c++ compiler, and is basically a preprocessor to convert the cuda syntax into something compilable. You can see what compiler it uses with the
--verboseflag.For instance on my machine compiling
with
nvcc -vgivesUsing the same compiler/flags as listed here should give you binary compatibility