Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Well, there is another option although not so easy to do it.

Now you are linking the libraries at the build time, therefore they must be present at runtime. The alternative is to link and load the libraries at runtime. The disadvantage of this is that you'll no longer know that what function is where inside the library. Therefore you will need to perform an additional step to check it. Furthermore, the runtime library loading is different per platform. Nevertheless, the Poco C++ libraries do a nice job in abstracting this away. Read this tutorial and you'll get the idea.

The basic idea is to build both the CUDA and non-CUDA versions. At runtime just check what you need and load that (still, you'll probably need to pack both DLLs).