From e2a942d07e88d0255c0e47fe6f2b92cfdb935785 Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Wed, 27 Mar 2024 13:38:28 -0700 Subject: legion: Add 24.03.0, update HIP dependency (#43398) * legion: Add 24.03.0, update HIP dependency. * legion: Remove CUDA upper bound, update HIP bounds, use f-strings. * legion: Fix format. * legion: Fix format again. --- var/spack/repos/builtin/packages/legion/package.py | 42 +++++++++++----------- .../legion/update-hip-path-legion-23.06.0.patch | 13 ------- 2 files changed, 20 insertions(+), 35 deletions(-) delete mode 100644 var/spack/repos/builtin/packages/legion/update-hip-path-legion-23.06.0.patch diff --git a/var/spack/repos/builtin/packages/legion/package.py b/var/spack/repos/builtin/packages/legion/package.py index ddf4deffd9..2437a8c1f0 100644 --- a/var/spack/repos/builtin/packages/legion/package.py +++ b/var/spack/repos/builtin/packages/legion/package.py @@ -27,6 +27,7 @@ class Legion(CMakePackage, ROCmPackage): maintainers("pmccormick", "streichler", "elliottslaughter") tags = ["e4s"] + version("24.03.0", tag="legion-24.03.0", commit="c61071541218747e35767317f6f89b83f374f264") version("23.12.0", tag="legion-23.12.0", commit="8fea67ee694a5d9fb27232a7976af189d6c98456") version("23.09.0", tag="legion-23.09.0", commit="7304dfcf9b69005dd3e65e9ef7d5bd49122f9b49") version("23.06.0", tag="legion-23.06.0", commit="7b5ff2fb9974511c28aec8d97b942f26105b5f6d") @@ -53,8 +54,10 @@ class Legion(CMakePackage, ROCmPackage): depends_on("mpi", when="conduit=mpi") depends_on("cuda@10.0:11.9", when="+cuda_unsupported_compiler @21.03.0:23.03.0") depends_on("cuda@10.0:11.9", when="+cuda @21.03.0:23.03.0") - depends_on("cuda@10.0:12.2", when="+cuda_unsupported_compiler") - depends_on("cuda@10.0:12.2", when="+cuda") + depends_on("cuda@10.0:", when="+cuda_unsupported_compiler") + depends_on("cuda@10.0:", when="+cuda") + depends_on("hip@5.1:5.7", when="+rocm @23.03.0:23.12.0") + depends_on("hip@5.1:", when="+rocm") depends_on("hdf5", when="+hdf5") depends_on("hwloc", when="+hwloc") @@ -62,12 +65,12 @@ class Legion(CMakePackage, ROCmPackage): cuda_arch_list = CudaPackage.cuda_arch_values for nvarch in cuda_arch_list: depends_on( - "kokkos@3.3.01:+cuda+cuda_lambda+wrapper cuda_arch={0}".format(nvarch), - when="%gcc+kokkos+cuda cuda_arch={0}".format(nvarch), + f"kokkos@3.3.01:+cuda+cuda_lambda+wrapper cuda_arch={nvarch}", + when=f"%gcc+kokkos+cuda cuda_arch={nvarch}", ) depends_on( - "kokkos@3.3.01:+cuda+cuda_lambda~wrapper cuda_arch={0}".format(nvarch), - when="%clang+kokkos+cuda cuda_arch={0}".format(nvarch), + f"kokkos@3.3.01:+cuda+cuda_lambda~wrapper cuda_arch={nvarch}", + when=f"%clang+kokkos+cuda cuda_arch={nvarch}", ) depends_on("kokkos@3.3.01:~cuda", when="+kokkos~cuda") @@ -75,7 +78,6 @@ class Legion(CMakePackage, ROCmPackage): # https://github.com/spack/spack/issues/37232#issuecomment-1553376552 patch("hip-offload-arch.patch", when="@23.03.0 +rocm") - patch("update-hip-path-legion-23.06.0.patch", when="@23.06.0:23.12.0 ^hip@6.0 +rocm") def patch(self): if "network=gasnet conduit=ofi-slingshot11 ^cray-mpich+wrappers" in self.spec: @@ -103,10 +105,7 @@ class Legion(CMakePackage, ROCmPackage): ) for arch in ROCmPackage.amdgpu_targets: - depends_on( - "kokkos@3.3.01:+rocm amdgpu_target={0}".format(arch), - when="+rocm amdgpu_target={0}".format(arch), - ) + depends_on(f"kokkos@3.3.01:+rocm amdgpu_target={arch}", when=f"+rocm amdgpu_target={arch}") depends_on("kokkos@3.3.01:+rocm", when="+kokkos+rocm") @@ -350,11 +349,10 @@ class Legion(CMakePackage, ROCmPackage): options.append(from_variant("Legion_HIP_TARGET", "hip_target")) options.append(from_variant("Legion_HIP_ARCH", "amdgpu_target")) options.append(from_variant("Legion_HIJACK_HIP", "hip_hijack")) - options.append(self.define("HIP_PATH", "{0}/hip".format(spec["hip"].prefix))) - if "^hip@:5.7" in spec: - options.append(self.define("HIP_PATH", "{0}/hip".format(spec["hip"].prefix))) - elif "^hip@6.0:" in spec: - options.append(self.define("HIP_PATH", "{0}".format(spec["hip"].prefix))) + if "@23.03.0:23.12.0" in spec: + options.append(self.define("HIP_PATH", f"{spec['hip'].prefix}/hip")) + else: + options.append(self.define("ROCM_PATH", spec["hip"].prefix)) if "+fortran" in spec: # default is off. @@ -460,21 +458,21 @@ class Legion(CMakePackage, ROCmPackage): exe = "local_function_tasks" cmake_args = [ - "-DCMAKE_C_COMPILER={0}".format(self.compiler.cc), - "-DCMAKE_CXX_COMPILER={0}".format(self.compiler.cxx), - "-DLegion_DIR={0}".format(join_path(self.prefix, "share", "Legion", "cmake")), + f"-DCMAKE_C_COMPILER={self.compiler.cc}", + f"-DCMAKE_CXX_COMPILER={self.compiler.cxx}", + f"-DLegion_DIR={join_path(self.prefix, 'share', 'Legion', 'cmake')}", ] self.run_test( "cmake", options=cmake_args, - purpose="test: generate makefile for {0} example".format(exe), + purpose=f"test: generate makefile for {exe} example", work_dir=test_dir, ) - self.run_test("make", purpose="test: build {0} example".format(exe), work_dir=test_dir) + self.run_test("make", purpose=f"test: build {exe} example", work_dir=test_dir) - self.run_test(exe, purpose="test: run {0} example".format(exe), work_dir=test_dir) + self.run_test(exe, purpose=f"test: run {exe} example", work_dir=test_dir) def test(self): self.run_local_function_tasks_test() diff --git a/var/spack/repos/builtin/packages/legion/update-hip-path-legion-23.06.0.patch b/var/spack/repos/builtin/packages/legion/update-hip-path-legion-23.06.0.patch deleted file mode 100644 index 9f7f6a7a86..0000000000 --- a/var/spack/repos/builtin/packages/legion/update-hip-path-legion-23.06.0.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/cmake/FindHIP.cmake b/cmake/FindHIP.cmake -index f86edd2..24492ad 100644 ---- a/cmake/FindHIP.cmake -+++ b/cmake/FindHIP.cmake -@@ -22,7 +22,7 @@ if(NOT DEFINED HIP_PATH) - set(HIP_PATH $ENV{HIP_PATH} CACHE PATH "Path to where HIP has been installed") - endif() - endif() --include(${HIP_PATH}/cmake/FindHIP.cmake) -+include(${HIP_PATH}/lib/cmake/hip/FindHIP.cmake) - - if(NOT HIP_INCLUDE_DIRS) - list(APPEND HIP_INCLUDE_DIRS -- cgit v1.2.3-70-g09d2