Creating a CUDA Project in Visual Studio 2008
Using NvCudaRuntimeApi.rules File
Note: This method is recommended for CUDA Toolkit version 3.2 and later.
- Create a new project (e.g., empty console application).
- Add the NvCudaRuntimeApi.rules file to your project's Custom Build Rules.
- Add the CUDA runtime library to the Additional Library Directories and Additional Dependencies in the linker settings.
- Optionally, add the CUDA include files to the Additional Include Directories in the compiler settings.
- Build your project.
Using Cuda.rules File
Note: This method is for CUDA Toolkit version 3.1 and earlier.
- Create a new project (e.g., empty console application).
- Add the Cuda.rules file to your project's Custom Build Rules.
- Add the CUDA runtime library to the Additional Library Directories and Additional Dependencies in the linker settings.
- Optionally, add the CUDA include files to the Additional Include Directories in the compiler settings.
- Build your project.
Additional Tips
- Change the Code Generation to use statically loaded C runtime.
- Enable syntax highlighting using the usertype.dat file.
- Enable Intellisense support by adding the provided registry entry.
- Avoid using cutil and create your own error handling.
The above is the detailed content of How to Create a CUDA Project in Visual Studio 2008?. For more information, please follow other related articles on the PHP Chinese website!