2023-12-01 13:34:11 +08:00
|
|
|
# nvcc
|
|
|
|
|
|
|
|
> The NVIDIA CUDA Compiler Driver.
|
|
|
|
> More information: <https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc>.
|
|
|
|
|
|
|
|
- Compile a CUDA program:
|
|
|
|
|
2025-03-28 05:26:23 +02:00
|
|
|
`nvcc {{path/to/source.cu}} {{[-o|--output-file]}} {{path/to/executable}}`
|
2023-12-01 13:34:11 +08:00
|
|
|
|
2025-03-28 05:26:23 +02:00
|
|
|
- Generate debug information:
|
2023-12-01 13:34:11 +08:00
|
|
|
|
2025-03-28 05:26:23 +02:00
|
|
|
`nvcc {{path/to/source.cu}} {{[-o|--output-file]}} {{path/to/executable}} {{[-g|--debug]}} {{[-G|--device-debug]}}`
|
2023-12-01 13:34:11 +08:00
|
|
|
|
|
|
|
- Include libraries from a different path:
|
|
|
|
|
2025-03-28 05:26:23 +02:00
|
|
|
`nvcc {{path/to/source.cu}} {{[-o|--output-file]}} {{path/to/executable}} {{[-I|--include-path]}} {{path/to/includes}} {{[-L|--library-path]}} {{path/to/library}} {{[-l|--library]}} {{library_name}}`
|
2023-12-01 13:34:11 +08:00
|
|
|
|
|
|
|
- Specify the compute capability for a specific GPU architecture:
|
|
|
|
|
2025-03-28 05:26:23 +02:00
|
|
|
`nvcc {{path/to/source.cu}} {{[-o|--output-file]}} {{path/to/executable}} {{[-gencode|--generate-code]}} arch={{arch_name}},code={{gpu_code_name}}`
|