Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhance Hypre easyblock to enable CUDA support #2482

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions easybuild/easyblocks/h/hypre.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@
@author: Kenneth Hoste (Ghent University)
@author: Mikael OEhman (Chalmers University of Technology)
@author: Alex Domingo (Vrije Universiteit Brussel)
@author: Simon Branford (University of Birmingham)
"""
import os

from easybuild.easyblocks.generic.configuremake import ConfigureMake
from easybuild.tools.build_log import EasyBuildError
from easybuild.tools.config import build_option
from easybuild.tools.modules import get_software_root
from easybuild.tools.systemtools import get_shared_lib_ext


Expand Down Expand Up @@ -67,6 +71,18 @@ def configure_step(self):
# Use MPI implementation from EB
self.cfg.update('configopts', '--with-MPI-include=%s' % os.getenv('MPI_INC_DIR'))

if get_software_root('CUDA'):
self.cfg.update('configopts', '--with-cuda')

cuda_cc = build_option('cuda_compute_capabilities') or self.cfg['cuda_compute_capabilities']
if not cuda_cc:
raise EasyBuildError('List of CUDA compute capabilities must be specified, either via '
'cuda_compute_capabilities easyconfig parameter or via '
'--cuda-compute-capabilities')

cuda_cc_string = ' '.join([x.replace('.', '') for x in cuda_cc])
self.cfg.update('configopts', '--with-gpu-arch="%s"' % cuda_cc_string)

super(EB_Hypre, self).configure_step()

def sanity_check_step(self):
Expand Down