hypre: add cublas and rocblas variants (#44038)
* Add cublas and roblas variants to hypre. * Fix mistakes. * Remove newline. * Address suggestions.
This commit is contained in:
parent
2e40c88d50
commit
5d1038c512
@ -83,6 +83,8 @@ class Hypre(AutotoolsPackage, CudaPackage, ROCmPackage):
|
|||||||
variant("sycl", default=False, description="Enable SYCL support")
|
variant("sycl", default=False, description="Enable SYCL support")
|
||||||
variant("magma", default=False, description="Enable MAGMA interface")
|
variant("magma", default=False, description="Enable MAGMA interface")
|
||||||
variant("caliper", default=False, description="Enable Caliper support")
|
variant("caliper", default=False, description="Enable Caliper support")
|
||||||
|
variant("rocblas", default=False, description="Enable rocBLAS")
|
||||||
|
variant("cublas", default=False, description="Enable cuBLAS")
|
||||||
|
|
||||||
# Patch to add gptune hookup codes
|
# Patch to add gptune hookup codes
|
||||||
patch("ij_gptune.patch", when="+gptune@2.19.0")
|
patch("ij_gptune.patch", when="+gptune@2.19.0")
|
||||||
@ -114,6 +116,8 @@ def patch(self): # fix sequential compilation in 'src/seq_mv'
|
|||||||
depends_on("rocprim", when="+rocm")
|
depends_on("rocprim", when="+rocm")
|
||||||
depends_on("hipblas", when="+rocm +superlu-dist")
|
depends_on("hipblas", when="+rocm +superlu-dist")
|
||||||
depends_on("umpire", when="+umpire")
|
depends_on("umpire", when="+umpire")
|
||||||
|
depends_on("umpire+rocm", when="+umpire+rocm")
|
||||||
|
depends_on("umpire+cuda", when="+umpire+cuda")
|
||||||
depends_on("caliper", when="+caliper")
|
depends_on("caliper", when="+caliper")
|
||||||
|
|
||||||
gpu_pkgs = ["magma", "umpire"]
|
gpu_pkgs = ["magma", "umpire"]
|
||||||
@ -166,6 +170,9 @@ def patch(self): # fix sequential compilation in 'src/seq_mv'
|
|||||||
# Option added in v2.29.0
|
# Option added in v2.29.0
|
||||||
conflicts("+magma", when="@:2.28")
|
conflicts("+magma", when="@:2.28")
|
||||||
|
|
||||||
|
conflicts("+cublas", when="~cuda", msg="cuBLAS requires CUDA to be enabled")
|
||||||
|
conflicts("+rocblas", when="~rocm", msg="rocBLAS requires ROCm to be enabled")
|
||||||
|
|
||||||
configure_directory = "src"
|
configure_directory = "src"
|
||||||
|
|
||||||
def url_for_version(self, version):
|
def url_for_version(self, version):
|
||||||
@ -257,6 +264,8 @@ def configure_args(self):
|
|||||||
configure_args.append("--with-cuda-home={0}".format(spec["cuda"].prefix))
|
configure_args.append("--with-cuda-home={0}".format(spec["cuda"].prefix))
|
||||||
else:
|
else:
|
||||||
configure_args.append("--enable-cub")
|
configure_args.append("--enable-cub")
|
||||||
|
if spec.satisfies("+cublas"):
|
||||||
|
conigure_args.append("--enable-cublas")
|
||||||
else:
|
else:
|
||||||
configure_args.extend(["--without-cuda", "--disable-curand", "--disable-cusparse"])
|
configure_args.extend(["--without-cuda", "--disable-curand", "--disable-cusparse"])
|
||||||
if spec.satisfies("@:2.20.99"):
|
if spec.satisfies("@:2.20.99"):
|
||||||
@ -282,6 +291,8 @@ def configure_args(self):
|
|||||||
rocm_arch_sorted = list(sorted(rocm_arch_vals, reverse=True))
|
rocm_arch_sorted = list(sorted(rocm_arch_vals, reverse=True))
|
||||||
rocm_arch = rocm_arch_sorted[0]
|
rocm_arch = rocm_arch_sorted[0]
|
||||||
configure_args.append("--with-gpu-arch={0}".format(rocm_arch))
|
configure_args.append("--with-gpu-arch={0}".format(rocm_arch))
|
||||||
|
if spec.satisfies("+rocblas"):
|
||||||
|
configure_args.append("--enable-rocblas")
|
||||||
else:
|
else:
|
||||||
configure_args.extend(["--without-hip", "--disable-rocrand", "--disable-rocsparse"])
|
configure_args.extend(["--without-hip", "--disable-rocrand", "--disable-rocsparse"])
|
||||||
|
|
||||||
@ -302,7 +313,7 @@ def configure_args(self):
|
|||||||
configure_args.append("--with-magma")
|
configure_args.append("--with-magma")
|
||||||
|
|
||||||
if "+gpu-aware-mpi" in spec:
|
if "+gpu-aware-mpi" in spec:
|
||||||
options.append("--enable-gpu-aware-mpi")
|
configure_args.append("--enable-gpu-aware-mpi")
|
||||||
|
|
||||||
configure_args.extend(self.enable_or_disable("fortran"))
|
configure_args.extend(self.enable_or_disable("fortran"))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user