C++ class to use CUDA into a C++ project

I want to create a C++ class to instantiate CUDA methods (kernels in CUDA) into my C++ project. Does CUDA work to compile the code?

Thanks,

Diego

There’s a sample project called cppIntegration that explains how it can be done. You can find it in the projects\cppIntegration folder within your CUDA SDK install directory.

You can integrate CUDA code into C++ projects and you can also call functions that call kernels from C++ classes. I don’t think you can do it directly - the kernel must be called from a C function (which you can wrap with a C++ method) because this function will contain CUDA code (the fabulous <<< >>> construct).

Hi Seb,

The cppIntegation does not use classes but it explains about the extern declaration for the CUDA kernels. I saw a thread about a library that you built.

http://forums.nvidia.com/index.php?showtopic=45310

Could you please give more details about how you did implement the library.

Thanks a lot,

Diego

It does not use classes but it is a C++ application compiled with the default CPP compiler. I’ll try to explain the lib integration in the other thread.

Thanks a lot,

Diego