gromacs: add support for opencl build (#18461)

Co-authored-by: Gvozden Nešković <neskovic@dev06.compeng.uni-frankfurt.de>
This commit is contained in:
Gvozden Neskovic 2020-09-02 17:07:43 +02:00 committed by GitHub
parent d904c57d2b
commit 1e05321c8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -59,6 +59,7 @@ class Gromacs(CMakePackage):
description='Produces a double precision version of the executables') description='Produces a double precision version of the executables')
variant('plumed', default=False, description='Enable PLUMED support') variant('plumed', default=False, description='Enable PLUMED support')
variant('cuda', default=False, description='Enable CUDA support') variant('cuda', default=False, description='Enable CUDA support')
variant('opencl', default=False, description='Enable OpenCL support')
variant('nosuffix', default=False, description='Disable default suffixes') variant('nosuffix', default=False, description='Disable default suffixes')
variant('build_type', default='RelWithDebInfo', variant('build_type', default='RelWithDebInfo',
description='The build type to build', description='The build type to build',
@ -130,13 +131,18 @@ def cmake_args(self):
else: else:
options.append('-DGMX_HWLOC:BOOL=OFF') options.append('-DGMX_HWLOC:BOOL=OFF')
if '+cuda' in self.spec: if '+cuda' in self.spec or '+opencl' in self.spec:
options.append('-DGMX_GPU:BOOL=ON') options.append('-DGMX_GPU:BOOL=ON')
options.append('-DCUDA_TOOLKIT_ROOT_DIR:STRING=' +
self.spec['cuda'].prefix)
else: else:
options.append('-DGMX_GPU:BOOL=OFF') options.append('-DGMX_GPU:BOOL=OFF')
if '+cuda' in self.spec:
options.append('-DCUDA_TOOLKIT_ROOT_DIR:STRING=' +
self.spec['cuda'].prefix)
if '+opencl' in self.spec:
options.append('-DGMX_USE_OPENCL=on')
# Activate SIMD based on properties of the target # Activate SIMD based on properties of the target
target = self.spec.target target = self.spec.target
if target >= llnl.util.cpu.targets['bulldozer']: if target >= llnl.util.cpu.targets['bulldozer']: