From 05269ad3929ec61b13549184b6c0fb4c63d64157 Mon Sep 17 00:00:00 2001 From: "Nichols A. Romero" Date: Sun, 17 Feb 2019 07:17:58 -0600 Subject: 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. --- var/spack/repos/builtin/packages/qmcpack/package.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/var/spack/repos/builtin/packages/qmcpack/package.py b/var/spack/repos/builtin/packages/qmcpack/package.py index b03db97727..3a1210fd19 100644 --- a/var/spack/repos/builtin/packages/qmcpack/package.py +++ b/var/spack/repos/builtin/packages/qmcpack/package.py @@ -7,7 +7,7 @@ from spack import * 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 @@ class Qmcpack(CMakePackage): 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') -- cgit v1.2.3-70-g09d2