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:
parent
2bca687605
commit
ec5bf38245
1 changed files with 8 additions and 2 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue