summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/gromacs/package.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/var/spack/repos/builtin/packages/gromacs/package.py b/var/spack/repos/builtin/packages/gromacs/package.py
index 8042e38864..a5e55b9bb2 100644
--- a/var/spack/repos/builtin/packages/gromacs/package.py
+++ b/var/spack/repos/builtin/packages/gromacs/package.py
@@ -59,6 +59,7 @@ class Gromacs(CMakePackage):
description='Produces a double precision version of the executables')
variant('plumed', default=False, description='Enable PLUMED 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('build_type', default='RelWithDebInfo',
description='The build type to build',
@@ -130,13 +131,18 @@ class Gromacs(CMakePackage):
else:
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('-DCUDA_TOOLKIT_ROOT_DIR:STRING=' +
- self.spec['cuda'].prefix)
else:
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
target = self.spec.target
if target >= llnl.util.cpu.targets['bulldozer']: