arborx: inherit from CudaPackage, ROCmPackage (#30490)

This commit is contained in:
eugeneswalker 2022-05-06 07:18:06 -07:00 committed by GitHub
parent 6c6685b5fa
commit c2afb4b916
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,7 +6,7 @@
from spack import *
class Arborx(CMakePackage):
class Arborx(CMakePackage, CudaPackage, ROCmPackage):
"""ArborX is a performance-portable library for geometric search"""
homepage = "https://github.com/arborx/arborx"
@ -28,9 +28,7 @@ class Arborx(CMakePackage):
# does not provide them.
kokkos_backends = {
'serial': (True, "enable Serial backend (default)"),
'cuda': (False, "enable Cuda backend"),
'openmp': (False, "enable OpenMP backend"),
'rocm': (False, "enable HIP backend"),
'sycl': (False, "enable SYCL backend")
}
@ -51,6 +49,15 @@ class Arborx(CMakePackage):
for backend in kokkos_backends:
depends_on('kokkos+%s' % backend.lower(), when='~trilinos+%s' %
backend.lower())
for arch in CudaPackage.cuda_arch_values:
cuda_dep = "+cuda cuda_arch={0}".format(arch)
depends_on("kokkos {0}".format(cuda_dep), when=cuda_dep)
for arch in ROCmPackage.amdgpu_targets:
rocm_dep = "+rocm amdgpu_target={0}".format(arch)
depends_on("kokkos {0}".format(rocm_dep), when=rocm_dep)
depends_on('kokkos+cuda_lambda', when='~trilinos+cuda')
# Trilinos/Kokkos