public inbox for
 help / color / mirror / Atom feed
From: Chung-Lin Tang <>
To: Thomas Schwinge <>,
	Chung-Lin Tang <>
Cc:, Catherine Moore <>
Subject: Re: [PATCH, OpenACC 2.7] Implement default clause support for data constructs
Date: Fri, 14 Jul 2023 18:34:01 +0800	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

Hi Thomas,

On 2023/6/23 6:47 PM, Thomas Schwinge wrote:
>> +
>>    ctx->clauses = *orig_list_p;
>>    gimplify_omp_ctxp = ctx;
>>  }
> Instead of this, in 'gimplify_omp_workshare', before the
> 'gimplify_scan_omp_clauses' call, do something like:
>     if ((ort & ORT_ACC)
>         && !omp_find_clause (OMP_CLAUSES (expr), OMP_CLAUSE_DEFAULT))
>       {
>         /* Determine effective 'default' clause for OpenACC compute construct.  */
>         for (struct gimplify_omp_ctx *ctx = gimplify_omp_ctxp; ctx; ctx = ctx->outer_context)
>           {
>             if (ctx->region_type == ORT_ACC_DATA
>                 && ctx->default_kind != OMP_CLAUSE_DEFAULT_SHARED)
>               {
>                 [Append actual default clause on compute construct.]
>                 break;
>               }
>           }
>       }
> That seems conceptually simpler to me?

I'm not sure if this is conceptually simpler, but using 'oacc_default_kind'
is definitely faster computationally :)

However, as you mention below...

> For the 'build_omp_clause', does using 'ctx->location' instead of
> 'UNKNOWN_LOCATION' help diagnostics in any way?  Like if we add in
> 'gcc/',
> 'if (ctx->default_kind == OMP_CLAUSE_DEFAULT_NONE)' another 'inform' to
> point to the 'data' construct's 'default' clause?  (But not sure if
> that's easily done; otherwise don't.)

Noticed that we will need to track the actually lexically enclosing OpenACC construct
with the user set default-clause somewhere in 'ctx', in order to satisfy the current
diagnostics in oacc_default_clause().

(the UNKNOWN_LOCATION for the internally created default-clause probably doesn't
matter, that one is just for reminder in internal dumps, probably never plays role
in user diagnostics)

> Similar to the ones you've already got, please also add a few test cases
> for nested 'default' clauses, like:
>     #pragma acc data // no vs. 'default(none)' vs. 'default(present)'
>     {
>       #pragma acc data // no vs. same vs. different 'default' clause
>       {
>         #pragma acc data // no vs. same vs. different 'default' clause
>         {
>           #pragma acc parallel
> Similarly, test cases where 'default' on the compute construct overrides
> 'default' of an outer 'data' construct.

Okay, will add more testcases.


  reply	other threads:[~2023-07-14 10:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-06 15:11 Chung-Lin Tang
2023-06-23 10:47 ` Thomas Schwinge
2023-07-14 10:34   ` Chung-Lin Tang [this message]
2023-08-15 14:35     ` [v3] OpenACC 2.7: default clause support for data constructs (was: [PATCH, OpenACC 2.7, v2] Implement default clause support for data constructs) Thomas Schwinge
2023-08-01 15:35 [PATCH, OpenACC 2.7, v2] Implement default clause support for data constructs Chung-Lin Tang

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:

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

  git send-email \ \ \ \ \ \ \

* 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).