We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 052179d commit 5e44128Copy full SHA for 5e44128
cmake/OpenCVDetectCUDA.cmake
@@ -354,6 +354,14 @@ if(CUDA_FOUND)
354
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-Xptxas;-dlcm=ca")
355
endif()
356
357
+ # Tell NVCC the maximum number of threads to be used to execute the compilation steps in parallel
358
+ # (option --threads was introduced in version 11.2)
359
+ if(NOT CUDA_VERSION VERSION_LESS "11.2")
360
+ if(NOT $ENV{CMAKE_BUILD_PARALLEL_LEVEL} STREQUAL "")
361
+ set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "--threads=$ENV{CMAKE_BUILD_PARALLEL_LEVEL}")
362
+ endif()
363
364
+
365
message(STATUS "CUDA NVCC target flags: ${CUDA_NVCC_FLAGS}")
366
367
OCV_OPTION(CUDA_FAST_MATH "Enable --use_fast_math for CUDA compiler " OFF)
0 commit comments