exago +cuda, +rocm: pass amdgpu_target, cuda_arch to dependencies, as appropriate (#30259)

* exago +rocm: pass amdgpu_target to raja, hiop dependencies

* +cuda builds: pass cuda_arch to dependencies

* hiop: pass cuda_arch to dependencies
This commit is contained in:
eugeneswalker 2022-04-25 12:48:35 -07:00 committed by GitHub
parent c72fba7e4c
commit b41de6d86b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 13 deletions

View file

@ -47,8 +47,6 @@ class Exago(CMakePackage, CudaPackage, ROCmPackage):
depends_on('cuda', when='+cuda')
depends_on('raja', when='+raja')
depends_on('raja+cuda', when='+raja+cuda')
depends_on('raja+rocm', when='+raja+rocm')
depends_on('raja@0.14.0:', when='@1.1.0: +raja')
depends_on('umpire', when='+raja')
depends_on('umpire@6.0.0:', when='@1.1.0: +raja')
@ -56,11 +54,6 @@ class Exago(CMakePackage, CudaPackage, ROCmPackage):
# Some allocator code in Umpire only works with static libs
depends_on('umpire+cuda~shared', when='+raja+cuda')
# For some versions of RAJA package, camp cuda variant does not get set
# correctly, so we must explicitly depend on it even though we don't use
# camp
depends_on('camp+cuda', when='+raja+cuda')
depends_on('cmake@3.18:', type='build')
# HiOp dependency logic
@ -69,8 +62,6 @@ class Exago(CMakePackage, CudaPackage, ROCmPackage):
depends_on('hiop@0.5.1:', when='@1.1.0:+hiop')
depends_on('hiop@0.5.3:', when='@1.3.0:+hiop')
depends_on('hiop+cuda', when='+hiop+cuda')
depends_on('hiop+rocm', when='+hiop+rocm')
depends_on('hiop~mpi', when='+hiop~mpi')
depends_on('hiop+mpi', when='+hiop+mpi')
@ -78,6 +69,21 @@ class Exago(CMakePackage, CudaPackage, ROCmPackage):
depends_on('petsc@3.16.0:3.16', when='@1.3.0:')
depends_on('petsc~mpi', when='~mpi')
for arch in CudaPackage.cuda_arch_values:
cuda_dep = "+cuda cuda_arch={0}".format(arch)
depends_on("hiop {0}".format(cuda_dep), when=cuda_dep)
depends_on("raja {0}".format(cuda_dep), when="+raja {0}".format(cuda_dep))
# For some versions of RAJA package, camp cuda variant does not get set
# correctly, so we must explicitly depend on it even though we don't use
# camp
depends_on("camp {0}".format(cuda_dep), when="+raja {0}".format(cuda_dep))
for arch in ROCmPackage.amdgpu_targets:
rocm_dep = "+rocm amdgpu_target={0}".format(arch)
depends_on("hiop {0}".format(rocm_dep), when=rocm_dep)
depends_on("raja {0}".format(rocm_dep), when="+raja {0}".format(rocm_dep))
depends_on('ipopt', when='+ipopt')
depends_on('py-mpi4py', when='@1.3.0:+mpi+python')

View file

@ -65,7 +65,11 @@ class Hiop(CMakePackage, CudaPackage, ROCmPackage):
depends_on('mpi', when='+mpi')
depends_on('magma+cuda', when='+cuda')
for arch in CudaPackage.cuda_arch_values:
cuda_dep = "+cuda cuda_arch={0}".format(arch)
depends_on("magma {0}".format(cuda_dep), when=cuda_dep)
depends_on("raja {0}".format(cuda_dep), when="+raja {0}".format(cuda_dep))
depends_on("umpire ~shared {0}".format(cuda_dep), when="+raja {0}".format(cuda_dep))
for arch in ROCmPackage.amdgpu_targets:
rocm_dep = "+rocm amdgpu_target={0}".format(arch)
@ -73,12 +77,13 @@ class Hiop(CMakePackage, CudaPackage, ROCmPackage):
depends_on("raja {0}".format(rocm_dep), when="+raja {0}".format(rocm_dep))
depends_on("umpire {0}".format(rocm_dep), when="+raja {0}".format(rocm_dep))
# Depends on Magma when +rocm or +cuda
magma_ver_constraints = (
('2.5.4', '0.4'),
('2.6.1', '0.4.6'),
('2.6.2', '0.5.4'),
)
# Depends on Magma when +rocm or +cuda
for (magma_v, hiop_v) in magma_ver_constraints:
depends_on('magma@{0}:'.format(magma_v), when='@{0}:+cuda'.format(hiop_v))
depends_on('magma@{0}:'.format(magma_v), when='@{0}:+rocm'.format(hiop_v))
@ -86,9 +91,7 @@ class Hiop(CMakePackage, CudaPackage, ROCmPackage):
depends_on('raja', when='+raja')
depends_on('raja+openmp', when='+raja~cuda~rocm')
depends_on('raja@0.14.0:', when='@0.5.0:+raja')
depends_on('raja+cuda', when='+raja+cuda')
depends_on('umpire', when='+raja')
depends_on('umpire+cuda~shared', when='+raja+cuda')
depends_on('umpire@6.0.0:', when='@0.5.0:+raja')
depends_on('hip', when='+rocm')
depends_on('hipblas', when='+rocm')