Using __constant__ memory in DLLs


I have some constant memory objects. Everything works perfectly when I compile and run the project. When I make a DLL out where these constants are accessed by some exported functions, the program crashes always.

My question is: are there any constraints about using constant memory objects with DLLs?

If you are using a particular constant memory symbol in more than one compilation unit within the DLL, then your DLL must be linked together with cuda separable compilation and device code linking. And I don’t believe it will be possible to expose a constant memory symbol (variable) across the DLL interface, because that would require separable compilation and linking across the interface, which is not supported.

Make sure your constant memory symbols are only used internally to the DLL.