This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: OpenACC support in 4.9
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, Jeff Law <law at redhat dot com>, Evgeny Gavrin <e dot gavrin at samsung dot com>, gcc at gcc dot gnu dot org, GarbuzovViacheslav <v dot garbuzov at samsung dot com>, dtemirbulatov at gmail dot com
- Date: Tue, 7 May 2013 17:34:45 +0200
- Subject: Re: OpenACC support in 4.9
- References: <51879F4E dot 10402 at samsung dot com> <5187B30F dot 1050709 at net-b dot de> <5187C958 dot 9020606 at redhat dot com> <CAFiYyc3bnnFL=k8w-ZqJnL3UtQrFjdNmrdNmiA7mCiuGVtK_aQ at mail dot gmail dot com> <5188C310 dot 5050305 at net-b dot de>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, May 07, 2013 at 11:02:08AM +0200, Tobias Burnus wrote:
> Richard Biener wrote:
> >We're going to look at supporting HSA from GCC (which would make
> >it more or less trivial to also target openCL I think)
>
> For the friends of link-time optimization (LTO):
>
> Unless I missed some fine point in OpenACC and OpenMP's target, they
> only work with directives which are locally visible. Thus, if one
> does a function call in the device/target section, it can only be
> placed on the accelerator if the function can be inlined.
No, OpenMP 4.0 has
#pragma omp declare target
...
#pragma omp end declare target
where you can define/declare functions and variables in that ... and those
are all marked for cloning for the target device (guess parsing of
the above construct is going to just add "omp declare target" attribute
to all those variables/functions and we'd then just clone the functions
and map the variables into the target code).
The target code can perhaps be done by streaming LTO IL for the target
device into special sections during normal compilation and a linker plugin
invoked for -fopenmp could then collect those if any, compile the code
with a different backend and link both the host program and whatever
is needed for the target device.
Jakub