Skip to content

Commit

Permalink
Fix bug introduced in #113
Browse files Browse the repository at this point in the history
The bug would prevent compilation with `-DCUDA=On -D -DCUDA_COMMON_ARCH=OFF`
  • Loading branch information
lorenzo-rovigatti committed Aug 30, 2024
1 parent ca876ea commit 68b8437
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions select_compute_arch.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ function(CUDA_DETECT_INSTALLED_GPUS OUT_VARIABLE)
"}\n")

if(CMAKE_CUDA_COMPILER_LOADED) # CUDA as a language
try_run(run_result compile_result SOURCES ${file}
try_run(run_result compile_result ${PROJECT_BINARY_DIR} ${file}
RUN_OUTPUT_VARIABLE compute_capabilities)
else()
try_run(run_result compile_result SOURCES ${file}
try_run(run_result compile_result ${PROJECT_BINARY_DIR} ${file}
CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${CUDA_INCLUDE_DIRS}"
LINK_LIBRARIES ${CUDA_LIBRARIES}
RUN_OUTPUT_VARIABLE compute_capabilities)
Expand Down

0 comments on commit 68b8437

Please sign in to comment.