VS2019&CUDA | VS2019 programming CUDA environment configuration

1. Open vs2019, (we can observe that "NVIDIA/CUDA 10.2" appears under the VS2017 template column.) Create an empty win32 program, namely the cuda_test project.
2. Select cuda_test, right-click -> Generate Dependencies -> Generate Custom, select CUDA 10.2.
3. Right-click the source file folder->Add->New Item->Select CUDA C/C++File, and name it cuda_main.
4. Click the properties of cuda_main.cu, and select "CUDA C/C++" in Configuration Properties -> General -> Item Type ->.
5. Select debug x64
6. Include directory configuration:
   1. Right-click the project properties -> Properties -> Configuration Properties -> VC++ directory -> Include directory
   2. Add include directory: KaTeX parse error: Undefined control sequence: \include at position 12: (CUDA_PATH)\̲i̲n̲c̲l̲u̲d̲e̲(in in your cuda installation directory... (CUDA_PATH)\lib\x64 (found lib/x64 in your cuda installation directory)
8. Dependencies
1. Configuration properties -> linker -> Input -> additional dependencies
2. Add library files: cublas.lib;cuda.lib;cudadevrt.lib;cudart.lib;cudart_static.lib;OpenCL.lib

Guess you like

Origin blog.csdn.net/weixin_43236007/article/details/109404051