From 18d14eb7654287875fbcb5b2e6c823a1b1e8b63c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Lacroix?= Date: Tue, 5 Jan 2021 19:37:00 +0100 Subject: [PATCH] ParaView: Allow choosing a CUDA architecture. (#20623) This is useful when the "native" architecture cannot be guessed. --- var/spack/repos/builtin/packages/paraview/package.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/var/spack/repos/builtin/packages/paraview/package.py b/var/spack/repos/builtin/packages/paraview/package.py index be39eada0e..fa01c8121f 100644 --- a/var/spack/repos/builtin/packages/paraview/package.py +++ b/var/spack/repos/builtin/packages/paraview/package.py @@ -51,6 +51,10 @@ class Paraview(CMakePackage, CudaPackage): description='Builds a shared version of the library') variant('kits', default=True, description='Use module kits') + variant('cuda_arch', default='native', multi=False, + values=('native', 'fermi', 'kepler', 'maxwell', + 'pascal', 'volta', 'turing', 'all', 'none'), + description='CUDA architecture') conflicts('+python', when='+python3') # Python 2 support dropped with 5.9.0 @@ -334,6 +338,9 @@ def nvariant_bool(feature): else: cmake_args.append('-DVTKm_ENABLE_CUDA:BOOL=%s' % variant_bool('+cuda')) + if spec.satisfies('+cuda') and not spec.satisfies('cuda_arch=native'): + cmake_args.append('-DVTKm_CUDA_Architecture=%s' % + spec.variants['cuda_arch'].value) if 'darwin' in spec.architecture: cmake_args.extend([