Flang OpenMP target support for NVidia GPUs. (#14486)

* Flang OpenMP target support for NVidia GPUs.

* explictly disable gpu option with else clause.
This commit is contained in:
Nichols A. Romero 2020-01-14 11:54:07 -06:00 committed by Adam J. Stewart
parent 2e5c9eb2e3
commit 6d8ec8890a

View file

@ -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 @@ def cmake_args(self):
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')