diff options
author | Nichols A. Romero <naromero77@users.noreply.github.com> | 2020-01-14 11:54:07 -0600 |
---|---|---|
committer | Adam J. Stewart <ajstewart426@gmail.com> | 2020-01-14 11:54:07 -0600 |
commit | 6d8ec8890a5fe847d0dc71d79bf8c8b9e36386f5 (patch) | |
tree | d2ef6e52282970c377154ff08775246e4dab8e8a | |
parent | 2e5c9eb2e3a4e9048893ce371622d1b2389a4291 (diff) | |
download | spack-6d8ec8890a5fe847d0dc71d79bf8c8b9e36386f5.tar.gz spack-6d8ec8890a5fe847d0dc71d79bf8c8b9e36386f5.tar.bz2 spack-6d8ec8890a5fe847d0dc71d79bf8c8b9e36386f5.tar.xz spack-6d8ec8890a5fe847d0dc71d79bf8c8b9e36386f5.zip |
Flang OpenMP target support for NVidia GPUs. (#14486)
* Flang OpenMP target support for NVidia GPUs.
* explictly disable gpu option with else clause.
-rw-r--r-- | var/spack/repos/builtin/packages/flang/package.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/flang/package.py b/var/spack/repos/builtin/packages/flang/package.py index 60d705d17e..853a8dfb35 100644 --- a/var/spack/repos/builtin/packages/flang/package.py +++ b/var/spack/repos/builtin/packages/flang/package.py @@ -24,6 +24,11 @@ class Flang(CMakePackage): version('20180921', sha256='f33bd1f054e474f1e8a204bb6f78d42f8f6ecf7a894fdddc3999f7c272350784') version('20180612', sha256='6af858bea013548e091371a97726ac784edbd4ff876222575eaae48a3c2920ed') + # Variants + variant('nvptx', + default=False, + description='Target OpenMP offload to NVidia GPUs') + # Build dependency depends_on('cmake@3.8:', type='build') depends_on('python@2.7:', type='build') @@ -40,6 +45,12 @@ class Flang(CMakePackage): depends_on('pgmath@20180921', when='@20180921') depends_on('pgmath@20180612', when='@20180612') + depends_on('cuda', when='+nvptx', type=('run')) + + # conflicts + conflicts('+nvptx', when='@:20181226', + msg='OMP offload to NVidia GPUs available March 2019 or later') + def cmake_args(self): spec = self.spec options = [ @@ -56,6 +67,11 @@ class Flang(CMakePackage): spec['python'].command.path) ] + if '+nvptx' in spec: + options.append('-DFLANG_OPENMP_GPU_NVIDIA=ON') + else: + options.append('-DFLANG_OPENMP_GPU_NVIDIA=OFF') + return options @run_after('install') |