Contents
- 1. Introduction
- 2. Compilation Phases
- 3. The CUDA Compilation Trajectory
- 4. NVCC Command Options
- 4.1. Command Option Types and Notation
- 4.2. Command Option Description
- 4.2.1. File and Path Specifications
- 4.2.1.1.
--output-file file
(-o
) - 4.2.1.2.
--objdir-as-tempdir
(-objtemp
) - 4.2.1.3.
--pre-include file,...
(-include
) - 4.2.1.4.
--library library,...
(-l
) - 4.2.1.5.
--define-macro def,...
(-D
) - 4.2.1.6.
--undefine-macro def,...
(-U
) - 4.2.1.7.
--include-path path,...
(-I
) - 4.2.1.8.
--system-include path,...
(-isystem
) - 4.2.1.9.
--library-path path,...
(-L
) - 4.2.1.10.
--output-directory directory
(-odir
) - 4.2.1.11.
--dependency-output file
(-MF
) - 4.2.1.12.
--generate-dependency-targets
(-MP
) - 4.2.1.13.
--compiler-bindir directory
(-ccbin
) - 4.2.1.14.
--allow-unsupported-compiler
(-allow-unsupported-compiler
) - 4.2.1.15.
--archiver-binary executable
(-arbin
) - 4.2.1.16.
--cudart
{none
|shared
|static
} (-cudart
) - 4.2.1.17.
--cudadevrt
{none
|static
} (-cudadevrt
) - 4.2.1.18.
--libdevice-directory directory
(-ldir
) - 4.2.1.19.
--target-directory string
(-target-dir
)
- 4.2.1.1.
- 4.2.2. Options for Specifying the Compilation Phase
- 4.2.2.1.
--link
(-link
) - 4.2.2.2.
--lib
(-lib
) - 4.2.2.3.
--device-link
(-dlink
) - 4.2.2.4.
--device-c
(-dc
) - 4.2.2.5.
--device-w
(-dw
) - 4.2.2.6.
--cuda
(-cuda
) - 4.2.2.7.
--compile
(-c
) - 4.2.2.8.
--fatbin
(-fatbin
) - 4.2.2.9.
--cubin
(-cubin
) - 4.2.2.10.
--ptx
(-ptx
) - 4.2.2.11.
--preprocess
(-E
) - 4.2.2.12.
--generate-dependencies
(-M
) - 4.2.2.13.
--generate-nonsystem-dependencies
(-MM
) - 4.2.2.14.
--generate-dependencies-with-compile
(-MD
) - 4.2.2.15.
--generate-nonsystem-dependencies-with-compile
(-MMD
) - 4.2.2.16.
--optix-ir
(-optix-ir
) - 4.2.2.17.
--run
(-run
)
- 4.2.2.1.
- 4.2.3. Options for Specifying Behavior of Compiler/Linker
- 4.2.3.1.
--profile
(-pg
) - 4.2.3.2.
--debug
(-g
) - 4.2.3.3.
--device-debug
(-G
) - 4.2.3.4.
--extensible-whole-program
(-ewp
) - 4.2.3.5.
--no-compress
(-no-compress
) - 4.2.3.6.
--generate-line-info
(-lineinfo
) - 4.2.3.7.
--optimization-info kind,...
(-opt-info
) - 4.2.3.8.
--optimize level
(-O
) - 4.2.3.9.
--dopt kind
(-dopt
) - 4.2.3.10.
--dlink-time-opt
(-dlto
) - 4.2.3.11.
--gen-opt-lto
(-gen-opt-lto
) - 4.2.3.12.
--split-compile number
(-split-compile
) - 4.2.3.13.
--ftemplate-backtrace-limit limit
(-ftemplate-backtrace-limit
) - 4.2.3.14.
--ftemplate-depth limit
(-ftemplate-depth
) - 4.2.3.15.
--no-exceptions
(-noeh
) - 4.2.3.16.
--shared
(-shared
) - 4.2.3.17.
--x
{c
|c++
|cu
} (-x
) - 4.2.3.18.
--std
{c++03
|c++11
|c++14
|c++17
|c++20
} (-std
) - 4.2.3.19.
--no-host-device-initializer-list
(-nohdinitlist
) - 4.2.3.20.
--expt-relaxed-constexpr
(-expt-relaxed-constexpr
) - 4.2.3.21.
--extended-lambda
(-extended-lambda
) - 4.2.3.22.
--expt-extended-lambda
(-expt-extended-lambda
) - 4.2.3.23.
--machine
{64
} (-m
) - 4.2.3.24.
--m64
(-m64
) - 4.2.3.25.
--host-linker-script
{use-lcs
|gen-lcs
} (-hls
) - 4.2.3.26.
--augment-host-linker-script
(-aug-hls
) - 4.2.3.27.
--host-relocatable-link
(-r
)
- 4.2.3.1.
- 4.2.4. Options for Passing Specific Phase Options
- 4.2.5. Options for Guiding the Compiler Driver
- 4.2.5.1.
--forward-unknown-to-host-compiler
(-forward-unknown-to-host-compiler
) - 4.2.5.2.
--forward-unknown-to-host-linker
(-forward-unknown-to-host-linker
) - 4.2.5.3.
--dont-use-profile
(-noprof
) - 4.2.5.4.
--threads number
(-t
) - 4.2.5.5.
--dryrun
(-dryrun
) - 4.2.5.6.
--verbose
(-v
) - 4.2.5.7.
--keep
(-keep
) - 4.2.5.8.
--keep-dir directory
(-keep-dir
) - 4.2.5.9.
--save-temps
(-save-temps
) - 4.2.5.10.
--clean-targets
(-clean
) - 4.2.5.11.
--run-args arguments,...
(-run-args
) - 4.2.5.12.
--use-local-env
(-use-local-env
) - 4.2.5.13.
--input-drive-prefix prefix
(-idp
) - 4.2.5.14.
--dependency-drive-prefix prefix
(-ddp
) - 4.2.5.15.
--drive-prefix prefix
(-dp
) - 4.2.5.16.
--dependency-target-name target
(-MT
) - 4.2.5.17.
--no-align-double
- 4.2.5.18.
--no-device-link
(-nodlink
) - 4.2.5.19.
--allow-unsupported-compiler
(-allow-unsupported-compiler
)
- 4.2.5.1.
- 4.2.6. Options for Steering CUDA Compilation
- 4.2.7. Options for Steering GPU Code Generation
- 4.2.7.1.
--gpu-architecture
(-arch
) - 4.2.7.2.
--gpu-code code,...
(-code
) - 4.2.7.3.
--generate-code specification
(-gencode
) - 4.2.7.4.
--relocatable-device-code
{true
|false
} (-rdc
) - 4.2.7.5.
--entries entry,...
(-e
) - 4.2.7.6.
--maxrregcount amount
(-maxrregcount
) - 4.2.7.7.
--use_fast_math
(-use_fast_math
) - 4.2.7.8.
--ftz
{true
|false
} (-ftz
) - 4.2.7.9.
--prec-div
{true
|false
} (-prec-div
) - 4.2.7.10.
--prec-sqrt
{true
|false
} (-prec-sqrt
) - 4.2.7.11.
--fmad
{true
|false
} (-fmad
) - 4.2.7.12.
--extra-device-vectorization
(-extra-device-vectorization
) - 4.2.7.13.
--compile-as-tools-patch
(-astoolspatch
) - 4.2.7.14.
--keep-device-functions
(-keep-device-functions
) - 4.2.7.15.
--jump-table-density percentage
(-jtd
)
- 4.2.7.1.
- 4.2.8. Generic Tool Options
- 4.2.8.1.
--disable-warnings
(-w
) - 4.2.8.2.
--source-in-ptx
(-src-in-ptx
) - 4.2.8.3.
--restrict
(-restrict
) - 4.2.8.4.
--Wno-deprecated-gpu-targets
(-Wno-deprecated-gpu-targets
) - 4.2.8.5.
--Wno-deprecated-declarations
(-Wno-deprecated-declarations
) - 4.2.8.6.
--Wreorder
(-Wreorder
) - 4.2.8.7.
--Wdefault-stream-launch
(-Wdefault-stream-launch
) - 4.2.8.8.
--Wmissing-launch-bounds
(-Wmissing-launch-bounds
) - 4.2.8.9.
--Wext-lambda-captures-this
(-Wext-lambda-captures-this
) - 4.2.8.10.
--Werror kind,...
(-Werror
) - 4.2.8.11.
--display-error-number
(-err-no
) - 4.2.8.12.
--no-display-error-number
(-no-err-no
) - 4.2.8.13.
--diag-error errNum,...
(-diag-error
) - 4.2.8.14.
--diag-suppress errNum,...
(-diag-suppress
) - 4.2.8.15.
--diag-warn errNum,...
(-diag-warn
) - 4.2.8.16.
--resource-usage
(-res-usage
) - 4.2.8.17.
--help
(-h
) - 4.2.8.18.
--version
(-V
) - 4.2.8.19.
--options-file file,...
(-optf
) - 4.2.8.20.
--time filename
(-time
) - 4.2.8.21.
--qpp-config config
(-qpp-config
) - 4.2.8.22.
--list-gpu-code
(-code-ls
) - 4.2.8.23.
--list-gpu-arch
(-arch-ls
)
- 4.2.8.1.
- 4.2.9. Phase Options
- 4.2.9.1. Ptxas Options
- 4.2.9.1.1.
--allow-expensive-optimizations
(-allow-expensive-optimizations
) - 4.2.9.1.2.
--compile-only
(-c
) - 4.2.9.1.3.
--def-load-cache
(-dlcm
) - 4.2.9.1.4.
--def-store-cache
(-dscm
) - 4.2.9.1.5.
--device-debug
(-g
) - 4.2.9.1.6.
--disable-optimizer-constants
(-disable-optimizer-consts
) - 4.2.9.1.7.
--entry entry,...
(-e
) - 4.2.9.1.8.
--fmad
(-fmad
) - 4.2.9.1.9.
--force-load-cache
(-flcm
) - 4.2.9.1.10.
--force-store-cache
(-fscm
) - 4.2.9.1.11.
--generate-line-info
(-lineinfo
) - 4.2.9.1.12.
--gpu-name gpuname
(-arch
) - 4.2.9.1.13.
--help
(-h
) - 4.2.9.1.14.
--machine
(-m
) - 4.2.9.1.15.
--maxrregcount amount
(-maxrregcount
) - 4.2.9.1.16.
--opt-level N
(-O
) - 4.2.9.1.17.
--options-file file,...
(-optf
) - 4.2.9.1.18.
--position-independent-code
(-pic
) - 4.2.9.1.19.
--preserve-relocs
(-preserve-relocs
) - 4.2.9.1.20.
--sp-bound-check
(-sp-bound-check
) - 4.2.9.1.21.
--suppress-async-bulk-multicast-advisory-warning
(-suppress-async-bulk-multicast-advisory-warning
) - 4.2.9.1.22.
--verbose
(-v
) - 4.2.9.1.23.
--version
(-V
) - 4.2.9.1.24.
--warning-as-error
(-Werror
) - 4.2.9.1.25.
--warn-on-double-precision-use
(-warn-double-usage
) - 4.2.9.1.26.
--warn-on-local-memory-usage
(-warn-lmem-usage
) - 4.2.9.1.27.
--warn-on-spills
(-warn-spills
) - 4.2.9.1.28.
--compile-as-tools-patch
(-astoolspatch
) - 4.2.9.1.29.
--maxntid
(-maxntid
) - 4.2.9.1.30.
--minnctapersm
(-minnctapersm
) - 4.2.9.1.31.
--override-directive-values
(-override-directive-values
)
- 4.2.9.1.1.
- 4.2.9.2. NVLINK Options
- 4.2.9.2.1.
--disable-warnings
(-w
) - 4.2.9.2.2.
--preserve-relocs
(-preserve-relocs
) - 4.2.9.2.3.
--verbose
(-v
) - 4.2.9.2.4.
--warning-as-error
(-Werror
) - 4.2.9.2.5.
--suppress-arch-warning
(-suppress-arch-warning
) - 4.2.9.2.6.
--suppress-stack-size-warning
(-suppress-stack-size-warning
) - 4.2.9.2.7.
--dump-callgraph
(-dump-callgraph
) - 4.2.9.2.8.
--dump-callgraph-no-demangle
(-dump-callgraph-no-demangle
) - 4.2.9.2.9.
--Xptxas
(-Xptxas
) - 4.2.9.2.10.
--cpu-arch
(-cpu-arch
) - 4.2.9.2.11.
--extra-warnings
(-extrawarn
) - 4.2.9.2.12.
--gen-host-linker-script
(-ghls
) - 4.2.9.2.13.
--ignore-host-info
(-ignore-host-info
) - 4.2.9.2.14.
--keep-system-libraries
(-keep-system-libraries
) - 4.2.9.2.15.
--kernels-used
(-kernels-used
) - 4.2.9.2.16.
--options-file
(-optf
) - 4.2.9.2.17.
--report-arch
(-report-arch
) - 4.2.9.2.18.
--suppress-debug-info
(-suppress-debug-info
) - 4.2.9.2.19.
--variables-used
(-variables used
)
- 4.2.9.2.1.
- 4.2.9.1. Ptxas Options
- 4.2.1. File and Path Specifications
- 4.3. NVCC Environment Variables
- 5. GPU Compilation
- 6. Using Separate Compilation in CUDA
- 7. Miscellaneous NVCC Usage
- 8. Notices