[llvm] [Offload] Fix using old deprecated CUDA root variable (PR #96307)
Joseph Huber via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 21 06:41:21 PDT 2024
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/96307
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`.
>From 3f46413fd373b5ae8162be97a11ce6f2725e91a7 Mon Sep 17 00:00:00 2001
From: Joseph Huber <huberjn at outlook.com>
Date: Fri, 21 Jun 2024 08:40:04 -0500
Subject: [PATCH] [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`.
---
offload/test/CMakeLists.txt | 4 ++++
offload/test/lit.site.cfg.in | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/offload/test/CMakeLists.txt b/offload/test/CMakeLists.txt
index 58cd56911f241..ddbf0181a70da 100644
--- a/offload/test/CMakeLists.txt
+++ b/offload/test/CMakeLists.txt
@@ -16,6 +16,10 @@ endif()
# char into the lit command.
string(REPLACE " " ";" LIBOMPTARGET_LIT_ARG_LIST "${LIBOMPTARGET_LIT_ARGS}")
+if(CUDAToolkit_FOUND)
+ get_filename_component(CUDA_ROOT "${CUDAToolkit_BIN_DIR}" DIRECTORY ABSOLUTE)
+endif()
+
string(REGEX MATCHALL "([^\ ]+\ |[^\ ]+$)" SYSTEM_TARGETS "${LIBOMPTARGET_SYSTEM_TARGETS}")
foreach(CURRENT_TARGET IN LISTS SYSTEM_TARGETS)
string(STRIP "${CURRENT_TARGET}" CURRENT_TARGET)
diff --git a/offload/test/lit.site.cfg.in b/offload/test/lit.site.cfg.in
index 7c75aaa18fa77..43751970cac27 100644
--- a/offload/test/lit.site.cfg.in
+++ b/offload/test/lit.site.cfg.in
@@ -7,7 +7,7 @@ config.test_fortran_compiler="@OPENMP_TEST_Fortran_COMPILER@"
config.test_compiler_features = @OPENMP_TEST_COMPILER_FEATURES@
config.test_openmp_flags = "@OPENMP_TEST_OPENMP_FLAGS@"
config.test_extra_flags = "@OPENMP_TEST_FLAGS@"
-config.cuda_path = "@CUDA_TOOLKIT_ROOT_DIR@"
+config.cuda_path = "@CUDA_ROOT@"
config.cuda_libdir = "@CUDA_LIBDIR@"
config.cuda_test_arch = "@LIBOMPTARGET_DEP_CUDA_ARCH@"
config.amdgpu_test_arch = "@LIBOMPTARGET_AMDGPU_DETECTED_ARCH_LIST@"
More information about the llvm-commits
mailing list