Emulation stops working after I load a DLL How do we compile external DLL's to be compatible wit

Hello everyone,

I’m trying to make the emulation work in my application. I have some C++ classes which are implemented in an external DLL (which I compiled myself). Those classes have nothing to do with CUDA.

Basically, everything works fine, until I instantiate one of the external C++ classes. When I do, it takes a second or two (I hear the hard drive working), and after that, any call to CUDA returns with cudaErrorMixedDeviceExecution.

I guess that in emulation mode CUDA enumerates all DLLs currently loaded and make sure they’re all in ‘emulation mode’. How do I make sure that my DLL is emulation-compatible?

unsigned char *hostData1 = NULL;

   unsigned char *hostData2 = NULL;

   cudaError_t errVal;

errVal = cudaMallocHost( (void**)&hostData1, 1024);  // <b>cudaSuccess</b>

CImage dummy;   // First instantiation of class using the DLL, takes a second or two

errVal = cudaMallocHost( (void**)&hostData2, 1024);  // <b>cudaErrorMixedDeviceExecution</b>