hypre: fix to correctly find rocsparse and rocrand when not in ROCM_PATH (#33073)

This commit is contained in:
Sarah Osborn 2022-10-10 06:46:26 -07:00 committed by GitHub
parent 86aaede202
commit cbc867a24c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -93,7 +93,9 @@ class Hypre(AutotoolsPackage, CudaPackage, ROCmPackage):
depends_on("blas")
depends_on("lapack")
depends_on("superlu-dist", when="+superlu-dist+mpi")
depends_on("rocsparse", when="+rocm")
depends_on("rocthrust", when="+rocm")
depends_on("rocrand", when="+rocm")
depends_on("umpire", when="+umpire")
for sm_ in CudaPackage.cuda_arch_values:
depends_on(
@ -235,11 +237,16 @@ def configure_args(self):
configure_args.append("--disable-cub")
if "+rocm" in spec:
rocm_pkgs = ["rocsparse", "rocthrust", "rocprim", "rocrand"]
rocm_inc = ""
for pkg in rocm_pkgs:
rocm_inc += spec[pkg].headers.include_flags + " "
configure_args.extend(
[
"--with-hip",
"--enable-rocrand",
"--enable-rocsparse",
"--with-extra-CUFLAGS={0}".format(rocm_inc),
]
)
rocm_arch_vals = spec.variants["amdgpu_target"].value