summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor A. P. Magri <50467563+victorapm@users.noreply.github.com>2023-09-26 00:27:14 -0400
committerGitHub <noreply@github.com>2023-09-26 06:27:14 +0200
commitaec88ef3e6cfddc354e9ac9fc2851ebea709289d (patch)
treecae736f5f0536e3fbfa16260849abc7fb5faec55
parent9fda22d942854098bc48bec4256456957d5005e8 (diff)
downloadspack-aec88ef3e6cfddc354e9ac9fc2851ebea709289d.tar.gz
spack-aec88ef3e6cfddc354e9ac9fc2851ebea709289d.tar.bz2
spack-aec88ef3e6cfddc354e9ac9fc2851ebea709289d.tar.xz
spack-aec88ef3e6cfddc354e9ac9fc2851ebea709289d.zip
hypre: add support for magma (#40121)
-rw-r--r--var/spack/repos/builtin/packages/hypre/package.py35
1 files changed, 25 insertions, 10 deletions
diff --git a/var/spack/repos/builtin/packages/hypre/package.py b/var/spack/repos/builtin/packages/hypre/package.py
index a891d4ab05..433d60a2ce 100644
--- a/var/spack/repos/builtin/packages/hypre/package.py
+++ b/var/spack/repos/builtin/packages/hypre/package.py
@@ -76,6 +76,7 @@ class Hypre(AutotoolsPackage, CudaPackage, ROCmPackage):
variant("gptune", default=False, description="Add the GPTune hookup code")
variant("umpire", default=False, description="Enable Umpire support")
variant("sycl", default=False, description="Enable SYCL support")
+ variant("magma", default=False, description="Enable MAGMA interface")
variant("caliper", default=False, description="Enable Caliper support")
# Patch to add gptune hookup codes
@@ -100,6 +101,7 @@ class Hypre(AutotoolsPackage, CudaPackage, ROCmPackage):
depends_on("mpi", when="+mpi")
depends_on("blas")
depends_on("lapack")
+ depends_on("magma", when="+magma")
depends_on("superlu-dist", when="+superlu-dist+mpi")
depends_on("rocsparse", when="+rocm")
depends_on("rocthrust", when="+rocm")
@@ -108,18 +110,23 @@ class Hypre(AutotoolsPackage, CudaPackage, ROCmPackage):
depends_on("umpire", when="+umpire")
depends_on("caliper", when="+caliper")
+ gpu_pkgs = ["magma", "umpire"]
for sm_ in CudaPackage.cuda_arch_values:
- depends_on(
- "umpire+cuda cuda_arch={0}".format(sm_), when="+umpire+cuda cuda_arch={0}".format(sm_)
- )
+ for pkg in gpu_pkgs:
+ depends_on(
+ "{0}+cuda cuda_arch={1}".format(pkg, sm_),
+ when="+{0}+cuda cuda_arch={1}".format(pkg, sm_),
+ )
+
for gfx in ROCmPackage.amdgpu_targets:
- depends_on(
- "umpire+rocm amdgpu_target={0}".format(gfx),
- when="+umpire+rocm amdgpu_target={0}".format(gfx),
- )
+ for pkg in gpu_pkgs:
+ depends_on(
+ "{0}+rocm amdgpu_target={1}".format(pkg, gfx),
+ when="+{0}+rocm amdgpu_target={1}".format(pkg, gfx),
+ )
- # Uses deprecated cuSPARSE functions/types (e.g. csrsv2Info_t).
- depends_on("cuda@:11", when="+cuda")
+ # hypre@:2.28.0 uses deprecated cuSPARSE functions/types (e.g. csrsv2Info_t).
+ depends_on("cuda@:11", when="@:2.28.0+cuda")
# Conflicts
conflicts("+cuda", when="+int64")
@@ -150,6 +157,9 @@ class Hypre(AutotoolsPackage, CudaPackage, ROCmPackage):
# Option added in v2.24.0
conflicts("+sycl", when="@:2.23")
+ # Option added in v2.29.0
+ conflicts("+magma", when="@:2.28")
+
configure_directory = "src"
def url_for_version(self, version):
@@ -280,6 +290,11 @@ class Hypre(AutotoolsPackage, CudaPackage, ROCmPackage):
if "+unified-memory" in spec:
configure_args.append("--enable-unified-memory")
+ if "+magma" in spec:
+ configure_args.append("--with-magma-include=%s" % spec["magma"].prefix.include)
+ configure_args.append("--with-magma-lib=%s" % spec["magma"].libs)
+ configure_args.append("--with-magma")
+
configure_args.extend(self.enable_or_disable("fortran"))
return configure_args
@@ -329,7 +344,7 @@ class Hypre(AutotoolsPackage, CudaPackage, ROCmPackage):
@run_after("install")
def cache_test_sources(self):
- self.cache_extra_test_sources(self.extra_install_tests)
+ cache_extra_test_sources(self, self.extra_install_tests)
@property
def _cached_tests_work_dir(self):