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.
This commit is contained in:
Nichols A. Romero 2019-03-13 16:03:28 -05:00 committed by Adam J. Stewart
parent 2bca687605
commit ec5bf38245

View file

@ -215,9 +215,15 @@ def cmake_args(self):
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,