This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: OpenACC support in 4.9
- From: Torvald Riegel <triegel at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Tobias Burnus <burnus at net-b dot de>, 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: Wed, 08 May 2013 22:04:29 +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> <20130507153445 dot GA22740 at tucnak dot redhat dot com>
On Tue, 2013-05-07 at 17:34 +0200, Jakub Jelinek wrote:
> 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).
Additional examples of such "special" functions are (1) the OpenMP /
Cilk+ SIMD functions (aka "elemental functions), for which programmers
make assertions such as that they can do with weaker forward progress
guarantees (eg, no locks in SIMD code), and (2) transaction-safe
functions for TM (but there the programmer doesn't make an assertion,
but a requirement. Both might or might not need special code being
generated. OpenACC 2.0 also proposes a similar feature (but the
description didn't seem like a finished spec back when I read it).
So, this isn't just about accelerators.
Torvald