gromacs: add support for opencl build (#18461)
Co-authored-by: Gvozden Nešković <neskovic@dev06.compeng.uni-frankfurt.de>
This commit is contained in:
parent
d904c57d2b
commit
1e05321c8f
@ -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']:
|
||||||
|
Loading…
Reference in New Issue
Block a user