This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 2/5] omp-low: implement SIMT privatization, part 1
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Alexander Monakov <amonakov at ispras dot ru>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 20 Apr 2017 18:47:54 +0200
- Subject: Re: [PATCH 2/5] omp-low: implement SIMT privatization, part 1
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jakub at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 7117CC073D57
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7117CC073D57
- References: <1490197595-31938-1-git-send-email-amonakov@ispras.ru> <1490197595-31938-3-git-send-email-amonakov@ispras.ru> <20170323103159.GM11094@tucnak> <alpine.LNX.2.20.13.1703311800330.7566@monopod.intra.ispras.ru> <20170420151622.GV1809@tucnak> <alpine.LNX.2.20.13.1704201902590.19960@monopod.intra.ispras.ru>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Apr 20, 2017 at 07:37:13PM +0300, Alexander Monakov wrote:
> On Thu, 20 Apr 2017, Jakub Jelinek wrote:
> > > This wasn't caught in testing, as apparently all testcases that have target
> > > simd loops with linear/lastprivate clauses also have the corresponding variables
> > > mentioned in target map clause, which makes them addressable (is that necessary?),
> >
> > Yes, in order to map something you need to map its address (+ size) on the
> > host to its address on the device, so it needs to be addressable.
> > Compared to that, firstprivate on target should not make it addressable.
>
> But ideally if nothing else is taking the address of a mapped variable inside
> of a target region, then it'd be more efficient to create a non-addressable
> instance and just copy its value from/to the addressable one on target
> region entry/exit.
Perhaps, but you'd need to do only if it is map on the target construct
because that is the only case where you can actually add copy in/out code
on the host as well as target. And you'd need to think about nowait
implications etc., or what happens if it in addition to target construct
is mentioned in map clause on some other construct etc., i.e. take into
account all the clauses of the variable in the scope of the variable, not
just a single one. That is GCC8 material for sure. If it is say map(to:),
it could as well be just promotion into firstprivate, or for map(alloc:) to
private etc.
> > Would be nice to also test explicit linear, perhaps in the same testcase,
> > just add ch and c and use say linear(c:2).
>
> Unfortunately that uncovers a separate wrong-code issue, explicit linear is
> not specifically handled in simt regions, but it should be, since we change
> the loop iteration step.
Then please commit what you have now and deal with the rest incrementally.
Jakub