summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNichols A. Romero <naromero77@users.noreply.github.com>2019-03-13 16:03:28 -0500
committerAdam J. Stewart <ajstewart426@gmail.com>2019-03-13 16:03:28 -0500
commitec5bf382456deeedc79d972b496ac47eb1c86c65 (patch)
treef810aef30a35e779b389912d67a227654feb97d8
parent2bca68760535481f9ef5bc7f7b6565d7076379a3 (diff)
downloadspack-ec5bf382456deeedc79d972b496ac47eb1c86c65.tar.gz
spack-ec5bf382456deeedc79d972b496ac47eb1c86c65.tar.bz2
spack-ec5bf382456deeedc79d972b496ac47eb1c86c65.tar.xz
spack-ec5bf382456deeedc79d972b496ac47eb1c86c65.zip
QMCPACK More CUDA Fixes (#10864)
* Throw InstallError if more than one GPU architecture is passed to cuda_arch. Previous cuda_arch test was not actually working because comparison with none string was on the cuda_arch list instead of the first entry of the list. * Removing redundant cuda_arch statement.
-rw-r--r--var/spack/repos/builtin/packages/qmcpack/package.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/qmcpack/package.py b/var/spack/repos/builtin/packages/qmcpack/package.py
index ec6f1e0f16..f25a289a0f 100644
--- a/var/spack/repos/builtin/packages/qmcpack/package.py
+++ b/var/spack/repos/builtin/packages/qmcpack/package.py
@@ -215,9 +215,15 @@ class Qmcpack(CMakePackage, CudaPackage):
if '+cuda' in spec:
args.append('-DQMC_CUDA=1')
- cuda_arch = spec.variants['cuda_arch'].value
+ cuda_arch_list = spec.variants['cuda_arch'].value
+ cuda_arch = cuda_arch_list[0]
+ if len(cuda_arch_list) > 1:
+ raise InstallError(
+ 'QMCPACK only supports compilation for a single '
+ 'GPU architecture at a time'
+ )
if cuda_arch != 'none':
- args.append('-DCUDA_ARCH=sm_{0}'.format(cuda_arch[0]))
+ args.append('-DCUDA_ARCH=sm_{0}'.format(cuda_arch))
else:
# This is the default value set in QMCPACK's CMake
# Not possible to set default value for cuda_arch,