Update CUDA support in QMCPACK (#10587)
* Support in QMCPACK for CUDA_ARCH flag. * No need to have explicit CUDA variant anymore. * Internal QMCPACK CMake assumes a minimum GPU architecture if none is provided.
This commit is contained in:
parent
a93581e8de
commit
05269ad392
@ -7,7 +7,7 @@
|
||||
import llnl.util.tty as tty
|
||||
|
||||
|
||||
class Qmcpack(CMakePackage):
|
||||
class Qmcpack(CMakePackage, CudaPackage):
|
||||
"""QMCPACK, is a modern high-performance open-source Quantum Monte
|
||||
Carlo (QMC) simulation code."""
|
||||
|
||||
@ -34,8 +34,6 @@ class Qmcpack(CMakePackage):
|
||||
variant('debug', default=False, description='Build debug version')
|
||||
variant('mpi', default=True, description='Build with MPI support')
|
||||
variant('phdf5', default=True, description='Build with parallel collective I/O')
|
||||
variant('cuda', default=False,
|
||||
description='Enable CUDA and GPU acceleration')
|
||||
variant('complex', default=False,
|
||||
description='Build the complex (general twist/k-point) version')
|
||||
variant('mixed', default=False,
|
||||
@ -217,6 +215,11 @@ def cmake_args(self):
|
||||
|
||||
if '+cuda' in spec:
|
||||
args.append('-DQMC_CUDA=1')
|
||||
cuda_arch = spec.variants['cuda_arch'].value
|
||||
if cuda_arch is not None:
|
||||
args.append('-DCUDA_ARCH=sm_{0}'.format(cuda_arch[0]))
|
||||
else:
|
||||
args.append('-DCUDA_ARCH=sm_35')
|
||||
else:
|
||||
args.append('-DQMC_CUDA=0')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user