I am using Cuda in an existing project (and so without using templates). I have no problem with release and debug configuration mode but I try to configure my project for emudebug and emurelease.
I have created these 2 new configuration : emudebug based on debug and emurelease based on release mode and for each .cu file added –deviceemu (for these 2 conf.) in the command line.
The compilation is good but the execution fail when I call : CUDA_SAFE_CALL(cudaMalloc((void**) &utVariable, uiSize));
to be more specific, here’s my problem again - execution (not compilation) fails in emuDebug mode (but is fine in normal debug mode) for following line:
You say you’re not using the SDK templates. Did you compare against them very carefully? Are you defining all the right constants? Look at the definition of the CUDA_SAFE_CALL() macro to see what it is doing and what #ifdefs etc. surround it.
This isnt related to the problems above, but i fixed my Debug and EmuDebug compilation problems in Visual Studio by removing the
“_DEBUG” from the preprocessor directive under Project Properties → CUDA settings.
I’ve had this problem before and errors were saying you cannot mix device and emulation modes. I worked around it by removing the CUDA_SAFE_CALL macros. It would run past that point, but ultimately it was due to one of my linked libraries that wasn’t compiled in emulation mode.