summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreugeneswalker <38933153+eugeneswalker@users.noreply.github.com>2023-05-18 22:03:50 -0500
committerGitHub <noreply@github.com>2023-05-18 23:03:50 -0400
commit2ac343581069730ef872c9f549d56d7aa2099954 (patch)
tree9553761c65d3d3dce22b0557b879e3681aeb7745
parent69ea180d26a6ed4d8be220c14e1436007f03e748 (diff)
downloadspack-2ac343581069730ef872c9f549d56d7aa2099954.tar.gz
spack-2ac343581069730ef872c9f549d56d7aa2099954.tar.bz2
spack-2ac343581069730ef872c9f549d56d7aa2099954.tar.xz
spack-2ac343581069730ef872c9f549d56d7aa2099954.zip
legion +rocm: apply patch for --offload-arch (#37775)
* legion +rocm: apply patch for --offload-arch * constrain to latest version
-rw-r--r--var/spack/repos/builtin/packages/legion/hip-offload-arch.patch24
-rw-r--r--var/spack/repos/builtin/packages/legion/package.py3
2 files changed, 27 insertions, 0 deletions
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",