Skip to content

Commit 3f46413

Browse files
committed
[Offload] Fix using old deprecated CUDA root variable
Summary: This variable isn't being set properly since we moved to the new way to find the CUDA directory. That means this variable was just unset the whole time. This patch adds it in by calculating it using the binary directory so it can be passed to `--cuda-path`.
1 parent ffed34e commit 3f46413

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

offload/test/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ endif()
1616
# char into the lit command.
1717
string(REPLACE " " ";" LIBOMPTARGET_LIT_ARG_LIST "${LIBOMPTARGET_LIT_ARGS}")
1818

19+
if(CUDAToolkit_FOUND)
20+
get_filename_component(CUDA_ROOT "${CUDAToolkit_BIN_DIR}" DIRECTORY ABSOLUTE)
21+
endif()
22+
1923
string(REGEX MATCHALL "([^\ ]+\ |[^\ ]+$)" SYSTEM_TARGETS "${LIBOMPTARGET_SYSTEM_TARGETS}")
2024
foreach(CURRENT_TARGET IN LISTS SYSTEM_TARGETS)
2125
string(STRIP "${CURRENT_TARGET}" CURRENT_TARGET)

offload/test/lit.site.cfg.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ config.test_fortran_compiler="@OPENMP_TEST_Fortran_COMPILER@"
77
config.test_compiler_features = @OPENMP_TEST_COMPILER_FEATURES@
88
config.test_openmp_flags = "@OPENMP_TEST_OPENMP_FLAGS@"
99
config.test_extra_flags = "@OPENMP_TEST_FLAGS@"
10-
config.cuda_path = "@CUDA_TOOLKIT_ROOT_DIR@"
10+
config.cuda_path = "@CUDA_ROOT@"
1111
config.cuda_libdir = "@CUDA_LIBDIR@"
1212
config.cuda_test_arch = "@LIBOMPTARGET_DEP_CUDA_ARCH@"
1313
config.amdgpu_test_arch = "@LIBOMPTARGET_AMDGPU_DETECTED_ARCH_LIST@"

0 commit comments

Comments
 (0)