How do I use CUDA function in a cpp file?
I must use a CUDA function declared in "cuda.h" (or other cuda libraries), for example cudaMalloc
. I know it is simple to do in .cu files but my project is extended, we decide call some CUDA functions in .cpp files.
I saw in the SDK some CUDA functions are called from main.cpp, so why is it not working for me? How do I configure CUDA with Visual Studio 2010?
The error is:
cudaMalloc identifier not found
and
undeclared identifier for size_t types