From 2ac343581069730ef872c9f549d56d7aa2099954 Mon Sep 17 00:00:00 2001 From: eugeneswalker <38933153+eugeneswalker@users.noreply.github.com> Date: Thu, 18 May 2023 22:03:50 -0500 Subject: legion +rocm: apply patch for --offload-arch (#37775) * legion +rocm: apply patch for --offload-arch * constrain to latest version --- .../builtin/packages/legion/hip-offload-arch.patch | 24 ++++++++++++++++++++++ var/spack/repos/builtin/packages/legion/package.py | 3 +++ 2 files changed, 27 insertions(+) create mode 100644 var/spack/repos/builtin/packages/legion/hip-offload-arch.patch (limited to 'var') diff --git a/var/spack/repos/builtin/packages/legion/hip-offload-arch.patch b/var/spack/repos/builtin/packages/legion/hip-offload-arch.patch new file mode 100644 index 0000000000..9d716cff18 --- /dev/null +++ b/var/spack/repos/builtin/packages/legion/hip-offload-arch.patch @@ -0,0 +1,24 @@ +diff -ruN spack-src/CMakeLists.txt spack-src-patched/CMakeLists.txt +--- spack-src/CMakeLists.txt 2023-05-18 14:18:00.897162488 -0400 ++++ spack-src-patched/CMakeLists.txt 2023-05-18 14:20:09.532413649 -0400 +@@ -495,7 +495,7 @@ + if("${Legion_HIP_ARCH}" STREQUAL "") + set(HIP_GENCODE "") + else() +- set(HIP_GENCODE "--offload-target=${Legion_HIP_ARCH}") ++ set(HIP_GENCODE "--offload-arch=${Legion_HIP_ARCH}") + endif() + endif() + +diff -ruN spack-src/runtime/runtime.mk spack-src-patched/runtime/runtime.mk +--- spack-src/runtime/runtime.mk 2023-05-18 14:18:00.969164248 -0400 ++++ spack-src-patched/runtime/runtime.mk 2023-05-18 14:20:51.317470176 -0400 +@@ -499,7 +499,7 @@ + HIPCC_FLAGS += -O2 + endif + ifneq ($(strip $(HIP_ARCH)),) +- HIPCC_FLAGS += --offload-target=$(HIP_ARCH) ++ HIPCC_FLAGS += --offload-arch=$(HIP_ARCH) + endif + LEGION_LD_FLAGS += -lm -L$(HIP_PATH)/lib -lamdhip64 + else ifeq ($(strip $(HIP_TARGET)),CUDA) diff --git a/var/spack/repos/builtin/packages/legion/package.py b/var/spack/repos/builtin/packages/legion/package.py index 7bb99e435c..6f422d8e0e 100644 --- a/var/spack/repos/builtin/packages/legion/package.py +++ b/var/spack/repos/builtin/packages/legion/package.py @@ -70,6 +70,9 @@ class Legion(CMakePackage, ROCmPackage): depends_on("kokkos@3.3.01:~cuda", when="+kokkos~cuda") depends_on("kokkos@3.3.01:~cuda+openmp", when="+kokkos+openmp") + # https://github.com/spack/spack/issues/37232#issuecomment-1553376552 + patch("hip-offload-arch.patch", when="@23.03.0 +rocm") + # HIP specific variant( "hip_hijack", -- cgit v1.2.3-70-g09d2