diff options
author | Glenn Johnson <glenn-johnson@uiowa.edu> | 2020-10-12 07:00:56 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-12 14:00:56 +0200 |
commit | bd8c73ef1887564ed628748ce5c8ec0a85aa4a76 (patch) | |
tree | b0559f563940bcdbd1bdd20069d6c6d7702385b3 /var | |
parent | 3107f0367b2c9dbae0b7201f3272111dcde70674 (diff) | |
download | spack-bd8c73ef1887564ed628748ce5c8ec0a85aa4a76.tar.gz spack-bd8c73ef1887564ed628748ce5c8ec0a85aa4a76.tar.bz2 spack-bd8c73ef1887564ed628748ce5c8ec0a85aa4a76.tar.xz spack-bd8c73ef1887564ed628748ce5c8ec0a85aa4a76.zip |
Change how CUDA variants are handled (#18983)
- Override the cuda_arch variant setup, with multi=False to ensure one
value is selected
- Use a conflicts statement rather than InstallError
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/gpu-burn/package.py | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/var/spack/repos/builtin/packages/gpu-burn/package.py b/var/spack/repos/builtin/packages/gpu-burn/package.py index 62ef82eb05..47bef447ea 100644 --- a/var/spack/repos/builtin/packages/gpu-burn/package.py +++ b/var/spack/repos/builtin/packages/gpu-burn/package.py @@ -24,21 +24,22 @@ class GpuBurn(MakefilePackage, CudaPackage): variant('cuda', 'True', description='Use CUDA; must be true') conflicts('~cuda', msg='gpu-burn requires cuda') + conflicts('cuda_arch=none', msg='must select a CUDA architecture') + + cuda_arch_values = CudaPackage.cuda_arch_values + variant( + 'cuda_arch', + description='CUDA architecture', + default='none', + values=cuda_arch_values, + multi=False + ) def edit(self, spec, prefix): # update cuda architecture if necessary if '+cuda' in self.spec: cuda_arch = self.spec.variants['cuda_arch'].value - archflag = '' - - if cuda_arch != 'none': - if len(cuda_arch) > 1: - raise InstallError( - 'gpu-burn only supports compilation for a single GPU' - 'type.' - ) - archflag = '-arch=compute_{0}'.format(cuda_arch[0]) - + archflag = '-arch=compute_{0}'.format(cuda_arch) filter_file('-arch=compute_30', archflag, 'Makefile', string=True) |