diff options
author | Satish Balay <balay@mcs.anl.gov> | 2021-07-20 02:48:48 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-20 09:48:48 +0200 |
commit | 2c87992506db934521e85186ab7565eb904848ad (patch) | |
tree | 77b2277ba35c629d62007ec01939ba83bad49593 /var | |
parent | 330507f329c4d79a08fd5e0b4d4e9f3b20ce37c9 (diff) | |
download | spack-2c87992506db934521e85186ab7565eb904848ad.tar.gz spack-2c87992506db934521e85186ab7565eb904848ad.tar.bz2 spack-2c87992506db934521e85186ab7565eb904848ad.tar.xz spack-2c87992506db934521e85186ab7565eb904848ad.zip |
petsc: pass in 'cuda_arch' to configure via --with-cuda-gencodearch [or CUDAFLAGS for older releases] (#24962)
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/petsc/package.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/petsc/package.py b/var/spack/repos/builtin/packages/petsc/package.py index 9fbf97ea75..aaf0aabf9b 100644 --- a/var/spack/repos/builtin/packages/petsc/package.py +++ b/var/spack/repos/builtin/packages/petsc/package.py @@ -431,6 +431,15 @@ class Petsc(Package, CudaPackage, ROCmPackage): library=petsclibname, path=spec[library].prefix) ) + if '+cuda' in spec: + if not spec.satisfies('cuda_arch=none'): + cuda_arch = spec.variants['cuda_arch'].value + if spec.satisfies('@3.14:'): + options.append('--with-cuda-gencodearch={0}'.format(cuda_arch[0])) + else: + options.append('CUDAFLAGS=-gencode arch=compute_{0},code=sm_{0}' + .format(cuda_arch[0])) + # PETSc does not pick up SuperluDist from the dir as they look for # superlu_dist_4.1.a if 'superlu-dist' in spec: |