summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorGvozden Neskovic <neskovic@gmail.com>2020-09-02 17:07:43 +0200
committerGitHub <noreply@github.com>2020-09-02 09:07:43 -0600
commit1e05321c8fa28ede1a228c47b4f6b2e753124d0a (patch)
tree3bf9d0eb1fad8a5845afe30d99cb2a13cfba4b73 /var
parentd904c57d2be9699597364ca802d1c4944a23fc88 (diff)
downloadspack-1e05321c8fa28ede1a228c47b4f6b2e753124d0a.tar.gz
spack-1e05321c8fa28ede1a228c47b4f6b2e753124d0a.tar.bz2
spack-1e05321c8fa28ede1a228c47b4f6b2e753124d0a.tar.xz
spack-1e05321c8fa28ede1a228c47b4f6b2e753124d0a.zip
gromacs: add support for opencl build (#18461)
Co-authored-by: Gvozden Nešković <neskovic@dev06.compeng.uni-frankfurt.de>
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']: