public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Cesar Philippidis <cesar@codesourcery.com>
To: Tom de Vries <Tom_deVries@mentor.com>,
	Thomas Schwinge	<thomas@codesourcery.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	Nathan Sidwell	<nathan@codesourcery.com>
Subject: Re: Combined constructs' clause splitting
Date: Thu, 19 Nov 2015 00:03:00 -0000	[thread overview]
Message-ID: <564D11BB.7090701@codesourcery.com> (raw)
In-Reply-To: <563F6E2D.7070107@mentor.com>

On 11/08/2015 07:45 AM, Tom de Vries wrote:
> On 07/11/15 12:45, Thomas Schwinge wrote:
>> Hi!
>>
>> On Fri, 6 Nov 2015 15:31:23 -0800, Cesar Philippidis
>> <cesar@codesourcery.com> wrote:
>>> I've applied this patch to gomp-4_0-branch which backports most of my
>>> front end changes from trunk. Note that I found a regression while
>>> testing, which is also present in trunk. It looks like
>>> kernels-acc-loop-reduction.c is failing because I'm incorrectly
>>> propagating the reduction variable to both to the kernels and loop
>>> constructs for combined 'acc kernels loop'. The problem here is that
>>> kernels don't support the reduction clause. I'll fix that next week.
>>
>> Always need to consider both what the specification allows -- and thus
>> what the front ends accept/refuse -- as well as what we might do
>> differently, internally in later processing stages.  I have not analyzed
>> whether it makes sense to have the OMP_CLAUSE_REDUCTION of a combined
>> "kernels loop reduction([...])" construct be attached to the outer
>> OACC_KERNELS or inner OACC_LOOP, or duplicated for both.
>>
>> Tom, if you need a solution for that right now/want to restore the
>> previous behavior (attached to innter OACC_LOOP only), here's what you
>> should try: in gcc/c-family/c-omp.c:c_oacc_split_loop_clauses remove the
>> special handling for OMP_CLAUSE_REDUCTION, and move it to "Loop clauses"
>> section,
> 
> Committed to gomp-4_0-branch, as attached.

Can you port this patch to trunk? Originally we were attaching the
reduction clause to both the acc loop and parallel construct so that the
reduction variable would get a copy clause implicitly. However, Nathan
later interpreted

  #pragma acc parallel reduction(+:var)

as

  #pragma acc parallel reduction(+:var) private(var)

Therefore, the burden is on the user to ensure that 'var' is transferred
to the parallel region in an appropriate data clause. As a result, we
only need to associate reductions with loops now. So your patch is good
for trunk.

Cesar



  reply	other threads:[~2015-11-19  0:03 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-03 22:17 [openacc] tile, independent, default, private and firstprivate support in c/++ Cesar Philippidis
2015-11-04 10:24 ` Jakub Jelinek
2015-11-04 17:55   ` Cesar Philippidis
2015-11-05 16:31     ` Jakub Jelinek
2015-11-05  4:58   ` Cesar Philippidis
2015-11-05  7:29     ` Jakub Jelinek
2015-11-05 14:58       ` Cesar Philippidis
2015-11-05 12:15 ` Thomas Schwinge
2015-11-05 14:48   ` Cesar Philippidis
2015-11-05 17:02     ` Thomas Schwinge
2015-11-05 17:13       ` Nathan Sidwell
2015-11-05 17:27         ` Cesar Philippidis
2015-11-06  2:11         ` Cesar Philippidis
2015-11-06  6:50           ` Jakub Jelinek
2015-11-06 13:44             ` Nathan Sidwell
2015-11-06 13:42           ` Nathan Sidwell
2015-11-09 11:31           ` [gomp4] " Thomas Schwinge
2021-07-21 22:06           ` Thomas Schwinge
     [not found]         ` <563D0735.7070601@mentor.com>
     [not found]           ` <87h9lqaofq.fsf@schwinge.name>
2015-11-06 23:31             ` [gomp4] backport trunk FE changes Cesar Philippidis
2015-11-07 11:45               ` Combined constructs' clause splitting (was: [gomp4] backport trunk FE changes) Thomas Schwinge
2015-11-07 16:14                 ` Combined constructs' clause splitting Cesar Philippidis
2015-11-08 15:46                 ` Tom de Vries
2015-11-19  0:03                   ` Cesar Philippidis [this message]
2015-11-19  0:09                     ` Tom de Vries
2015-11-07 12:30               ` [gomp4] backport trunk FE changes Thomas Schwinge
2015-11-07 16:05                 ` Cesar Philippidis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=564D11BB.7090701@codesourcery.com \
    --to=cesar@codesourcery.com \
    --cc=Tom_deVries@mentor.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=nathan@codesourcery.com \
    --cc=thomas@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).