summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkwryankrattiger <80296582+kwryankrattiger@users.noreply.github.com>2022-03-09 10:23:47 -0600
committerGitHub <noreply@github.com>2022-03-09 11:23:47 -0500
commit30a9bfe38fd53a59bb185a26d0904f27ce7e76c1 (patch)
tree5e04ec8611dbdee0c41a01a27b02e1cda40b21cb
parent3370d3f57e2685963ed155e86ce635e1e0644b83 (diff)
downloadspack-30a9bfe38fd53a59bb185a26d0904f27ce7e76c1.tar.gz
spack-30a9bfe38fd53a59bb185a26d0904f27ce7e76c1.tar.bz2
spack-30a9bfe38fd53a59bb185a26d0904f27ce7e76c1.tar.xz
spack-30a9bfe38fd53a59bb185a26d0904f27ce7e76c1.zip
ECP-SDK/VTK-m: Make ROCm + VTK-m contraints (#28712)
* ECP-SDK/VTK-m: Update ROCm variant VTK-m set contraint for when rocm/kokkos are available. SDK Make ROCmPackage and propagate amdgpu_arch and rocm variant to VTK-m. Note: SDK has to check vtk-m@ 1.7: and :1.6 explicitly in orderer to have 1.7 be selected by default if +rocm in the SDK. * ECP-SDK: Enable ROCm + VTK-m constraints
-rw-r--r--var/spack/repos/builtin/packages/ecp-data-vis-sdk/package.py10
-rw-r--r--var/spack/repos/builtin/packages/vtk-m/package.py7
2 files changed, 15 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/ecp-data-vis-sdk/package.py b/var/spack/repos/builtin/packages/ecp-data-vis-sdk/package.py
index cf50f6d5a6..a211b3e855 100644
--- a/var/spack/repos/builtin/packages/ecp-data-vis-sdk/package.py
+++ b/var/spack/repos/builtin/packages/ecp-data-vis-sdk/package.py
@@ -6,7 +6,7 @@
from spack import *
-class EcpDataVisSdk(BundlePackage, CudaPackage):
+class EcpDataVisSdk(BundlePackage, CudaPackage, ROCmPackage):
"""ECP Data & Vis SDK"""
homepage = "https://github.com/chuckatkins/ecp-data-viz-sdk"
@@ -95,6 +95,8 @@ class EcpDataVisSdk(BundlePackage, CudaPackage):
############################################################
cuda_arch_variants = ['cuda_arch={0}'.format(x)
for x in CudaPackage.cuda_arch_values]
+ amdgpu_target_variants = ['amdgpu_target={0}'.format(x)
+ for x in ROCmPackage.amdgpu_targets]
dav_sdk_depends_on('adios2+shared+mpi+fortran+python+blosc+sst+ssc+dataman',
when='+adios2',
@@ -154,6 +156,12 @@ class EcpDataVisSdk(BundlePackage, CudaPackage):
dav_sdk_depends_on('vtk-m+shared+mpi+openmp+rendering',
when='+vtkm',
propagate=['cuda'] + cuda_arch_variants)
+ depends_on('vtk-m +rocm', when='+vtkm +rocm ^vtk-m@1.7:')
+ for amdgpu_target in amdgpu_target_variants:
+ depends_on('vtk-m {0}'.format(amdgpu_target),
+ when='+vtkm {0} ^vtk-m@1.7:'.format(amdgpu_target))
+
+ # depends_on('vtk-m ~rocm', when='+vtkm +rocm ^vtk-m@:1.6')
# +python is currently broken in sz
# dav_sdk_depends_on('sz+shared+fortran+python+random_access',
diff --git a/var/spack/repos/builtin/packages/vtk-m/package.py b/var/spack/repos/builtin/packages/vtk-m/package.py
index d571774dc9..2f39065197 100644
--- a/var/spack/repos/builtin/packages/vtk-m/package.py
+++ b/var/spack/repos/builtin/packages/vtk-m/package.py
@@ -61,7 +61,7 @@ class VtkM(CMakePackage, CudaPackage, ROCmPackage):
# Device variants
# CudaPackage provides cuda variant
# ROCmPackage provides rocm variant
- variant("kokkos", default=False, description="build using Kokkos backend")
+ variant("kokkos", default=False, when='@1.6:', description="build using Kokkos backend")
variant("cuda_native", default=True, description="build using native cuda backend", when="+cuda")
variant("openmp", default=(sys.platform != 'darwin'), description="build openmp support")
variant("tbb", default=(sys.platform == 'darwin'), description="build TBB support")
@@ -94,6 +94,11 @@ class VtkM(CMakePackage, CudaPackage, ROCmPackage):
depends_on("rocm-cmake@3.7:", when="+rocm")
depends_on("hip@3.7:", when="+rocm")
+ # The rocm variant is only valid options for >= 1.7. It would be better if
+ # this could be expressed as a when clause to disable the rocm variant,
+ # but that is not currently possible since when clauses are stacked,
+ # not overwritten.
+ conflicts('+rocm', when='@:1.6')
conflicts("+rocm", when="+cuda")
conflicts("+rocm", when="~kokkos", msg="VTK-m does not support HIP without Kokkos")