What we talking about here are problems with VS which is such a bloated, unwieldy, illogical, pain-in-the-arse system to work with it drives me to despair. I’ve been using CUDA successfully for a year now and both the documentation and the forums are very helpful if you have problems with CUDA. To the more negative posters in this thread, I don’t believe it’s a problem with CUDA or the CUDA documentation. I’ve been banging my head against a brick wall all day with all sorts of other stupid problems. The VS Wizard seems to work pretty well, that got me going. I’ll have a closer look at your suggestion tomorrow. cu for calling kernels, and calling those functions from a C++ class.īut now I see that I can just put the implementation of some C++ class functions straight into the. I’ve been using a bunch of extern functions in my. cu implementation to a library (there’s an option in CUDA build rules) so people without nvcc can still compile the framework or can switch it over for a CPU only lib. Kernel1>(deviceData) //launching kernel legal, it's a. use CUDA functions to to memcpy data and to launch a kernel Void CudaWorker::doCuda(std::vector hostData) You can even have: //cudaWorker.h, framework friendly C++ with no notion of CUDA/nvcc etc. cu files and you can create wrappers around them so that they work in C/C++.
Now have all your CUDA code (kernels and host code that launches the kernels) in. Check this item’s properties, it will be compiled with nvcc. cu extension (like cudaFunctions.cu), the extension will be automatically recognized and the CUDA build rule will be applied. Now you can Add a new Item and name a file any way you want with a.
An easier way: download and install, it will add a CUDA build rule and integrate with Visual Studio. That usually requires a custom build step. Integrating CUDA in a project is easy enough, the only real crux is having CUDA C compiled by nvcc and not by whichever compiler you have in the framework. If we integrate CUDA into an existing project, which method is recommended? Which method is generally considered the “right” way in this case?īoth methods are valid. Why does the “template” project of the CUDA SDK use a Command Line Custom Build Step when all of the other SDK examples seem to use the. What are other advantages/disadvantages of these 2 methods? cu file basis, simplifying the project setup. An advantage to method 2 seems that settings won’t have to be done on a per. An advantage to method 1 seems that one could have greater control over nvcc and the environment in general.
We have successfully created projects from scratch using either method. cu files will be built based on these rules. cu file, set a custom build step, and call nvcc from the Command Line.īased on other projects from the CUDA SDK: Import the les file into the project and the project’s. There seem to be two ways of using CUDA in a Visual Studio project:īased on the “template” project from the CUDA SDK: for each.
What is the recommended way to integrate CUDA into an existing Visual Studio (2008) C++ project?