Skip to content

Commit

Permalink
Set default value for NVCC threads (microsoft#17866)
Browse files Browse the repository at this point in the history
Without doing this CMake gives a miscellaneous error on windows when
checking if NVCC is functional. It will be missing a number after
`--threads`.

Currently it is only possible to configure through the python build scripts and not CMake
only configure - which is what I am usually doing through CLion.
  • Loading branch information
gedoensmax authored Oct 12, 2023
1 parent e2cd674 commit 74a8acf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cmake/onnxruntime_providers_cuda.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
# CUDA 11.3+ supports parallel compilation
# https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#options-for-guiding-compiler-driver-threads
if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 11.3)
option(onnxruntime_NVCC_THREADS "Number of threads that NVCC can use for compilation." 1)
target_compile_options(${target} PRIVATE "$<$<COMPILE_LANGUAGE:CUDA>:SHELL:--threads \"${onnxruntime_NVCC_THREADS}\">")
endif()
if (UNIX)
Expand Down

0 comments on commit 74a8acf

Please sign in to comment.