You need to include the header files in which the CUDA functions are declared:
#include <cuda_runtime_api.h> #include <cuda.h>
and then on the cmd line you also need to add PATH ( -I option) where these components are located.
On my system, version 2.1 of CUDA installed the header files on /usr/local/cuda . To compile, I would do something like:
nvcc -I/usr/local/cuda/include -L/usr/local/cuda/lib -lcutil -lcudpp -lcuda -lcudart -c -o FSPB_main.o FSPB_main.cpp
Remember to add -I. to this command if your code depends on custom headers you wrote that are in the same source code directory.
karlphillip
source share