rocm-openmp-extras: Avoiding registration of duplicate check-targets and fix for the failure in hostexec (#45658)

* Adding addtional check for omptarget library for amdgpu in nvidia environment
* Avoiding registration of duplicate when built on cuda
* Adding hsa library path in LD_LIBRARY_PATH
* Correction in hsa prefix library path in LD_LIBRARY_PATH
This commit is contained in:
renjithravindrankannath 2024-09-04 10:31:28 -07:00 committed by GitHub
parent cd4c40fdbd
commit 7e20874f54
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 36 additions and 0 deletions

View File

@ -0,0 +1,26 @@
From 518621c818c285d8b5d11f56c331243b985d7654 Mon Sep 17 00:00:00 2001
From: Renjith Ravindran <Renjith.RavindranKannath@amd.com>
Date: Fri, 9 Aug 2024 22:04:55 +0000
Subject: [PATCH] Avoiding registration of duplicate when built on cuda
environemnt
---
.../openmp/libomptarget/plugins/cuda/CMakeLists.txt | 2 --
1 file changed, 2 deletions(-)
diff --git a/rocm-openmp-extras/llvm-project/openmp/libomptarget/plugins/cuda/CMakeLists.txt b/rocm-openmp-extras/llvm-project/openmp/libomptarget/plugins/cuda/CMakeLists.txt
index 9b991c735..f21cccdd5 100644
--- a/rocm-openmp-extras/llvm-project/openmp/libomptarget/plugins/cuda/CMakeLists.txt
+++ b/rocm-openmp-extras/llvm-project/openmp/libomptarget/plugins/cuda/CMakeLists.txt
@@ -102,8 +102,6 @@ target_include_directories(omptarget.rtl.cuda PRIVATE
option(LIBOMPTARGET_FORCE_NVIDIA_TESTS "Build NVIDIA libomptarget tests" OFF)
if (LIBOMPTARGET_FOUND_NVIDIA_GPU OR LIBOMPTARGET_FORCE_NVIDIA_TESTS)
libomptarget_say("Enable tests using CUDA plugin")
- set(LIBOMPTARGET_SYSTEM_TARGETS "${LIBOMPTARGET_SYSTEM_TARGETS} nvptx64-nvidia-cuda nvptx64-nvidia-cuda-oldDriver" PARENT_SCOPE)
- set(LIBOMPTARGET_SYSTEM_TARGETS "${LIBOMPTARGET_SYSTEM_TARGETS} nvptx64-nvidia-cuda nvptx64-nvidia-cuda-LTO" PARENT_SCOPE)
list(APPEND LIBOMPTARGET_TESTED_PLUGINS "omptarget.rtl.cuda")
set(LIBOMPTARGET_TESTED_PLUGINS "${LIBOMPTARGET_TESTED_PLUGINS}" PARENT_SCOPE)
else()
--
2.34.1

View File

@ -288,6 +288,7 @@ class RocmOpenmpExtras(Package):
working_dir="rocm-openmp-extras/llvm-project/openmp/libomptarget",
when="@6.1",
)
patch("0001-Avoid-duplicate-registration-on-cuda-env.patch", when="@6.1:")
def setup_run_environment(self, env):
devlibs_prefix = self.spec["llvm-amdgpu"].prefix
@ -308,6 +309,8 @@ def setup_build_environment(self, env):
llvm_prefix = self.spec["llvm-amdgpu"].prefix
env.set("AOMP", "{0}".format(llvm_prefix))
env.set("FC", "{0}/bin/flang".format(openmp_extras_prefix))
if self.spec.satisfies("@6.1:"):
env.prepend_path("LD_LIBRARY_PATH", self.spec["hsa-rocr-dev"].prefix.lib)
if self.spec.satisfies("+asan"):
env.set("SANITIZER", 1)
env.set("VERBOSE", 1)
@ -437,6 +440,13 @@ def patch(self):
flang.format(src) + "CMakeLists.txt",
)
filter_file(
"if (LIBOMPTARGET_DEP_CUDA_FOUND)",
"if (LIBOMPTARGET_DEP_CUDA_FOUND AND NOT LIBOMPTARGET_AMDGPU_ARCH)",
libomptarget.format(src) + "/hostexec/CMakeLists.txt",
string=True,
)
def install(self, spec, prefix):
src = self.stage.source_path
gfx_list = os.environ["GFXLIST"]