CUDA 8.0 in the function of the call is easy to move people. The following is the VC + + from the online learning of the. cpp file calls the Cuda. cu file in the function method, and the general VC + + function call method basically no difference.
The Cuda version used is Cuda 8.0, which is installed by default.
1.vs2013 New Cuda 8.0 Project
2. Modification of the project
The. cpp call. cu file is based on the definition of functions and the implementation of functions can be in different files, and. cu files also support this feature, so you can modify the following conditions, That is, new kernel.h and Main.cpp, the head file and function declaration are written in the header file, Kernel.cu contains the header file, and implements the function declared in the header file, the function is called in main.cpp.
3. Running Results
Project Source: http://download.csdn.net/download/qq_33892166/9840090
VS2013 VC + + the. cpp file invokes a function in the cuda. cu file