summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/build_systems/cuda.py3
-rw-r--r--lib/spack/spack/build_systems/rocm.py3
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/spack/spack/build_systems/cuda.py b/lib/spack/spack/build_systems/cuda.py
index 634cfad637..79f57b046e 100644
--- a/lib/spack/spack/build_systems/cuda.py
+++ b/lib/spack/spack/build_systems/cuda.py
@@ -35,7 +35,8 @@ class CudaPackage(PackageBase):
variant('cuda_arch',
description='CUDA architecture',
- values=spack.variant.any_combination_of(*cuda_arch_values))
+ values=spack.variant.any_combination_of(*cuda_arch_values),
+ when='+cuda')
# https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#nvcc-examples
# https://llvm.org/docs/CompileCudaWithLLVM.html#compiling-cuda-code
diff --git a/lib/spack/spack/build_systems/rocm.py b/lib/spack/spack/build_systems/rocm.py
index 977db700db..828ebe7a67 100644
--- a/lib/spack/spack/build_systems/rocm.py
+++ b/lib/spack/spack/build_systems/rocm.py
@@ -100,7 +100,8 @@ class ROCmPackage(PackageBase):
# possible amd gpu targets for rocm builds
variant('amdgpu_target',
description='AMD GPU architecture',
- values=spack.variant.any_combination_of(*amdgpu_targets))
+ values=spack.variant.any_combination_of(*amdgpu_targets),
+ when='+rocm')
depends_on('llvm-amdgpu', when='+rocm')
depends_on('hsa-rocr-dev', when='+rocm')