public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tobias Burnus <burnus@net-b.de>
To: Sandra Loosemore <sandra@codesourcery.com>, gcc-patches@gcc.gnu.org
Cc: kcy@codesourcery.com, tobias@codesourcery.com, jakub@redhat.com
Subject: Re: [PATCH 1/8] OpenMP: metadirective tree data structures and front-end interfaces
Date: Sun, 7 Jan 2024 13:18:42 +0100	[thread overview]
Message-ID: <ee62f4be-89f1-4101-8e6b-7226508068f5@net-b.de> (raw)
In-Reply-To: <af36b83e-1aa9-4400-875b-a387f3eb3319@net-b.de>

Hi Sandra,

Tobias Burnus wrote:
> (I have now an errant to do - and will continue later with the review.)

First, something a bit unrelated to this patch but affecting related 
code (quoting old, existing code):

> int               
> omp_context_selector_matches (tree ctx)
...
>             case OMP_TRAIT_DEVICE_KIND:
>               if (set == OMP_TRAIT_SET_DEVICE) 
>                 for (tree p = OMP_TS_PROPERTIES (ts); p; p = TREE_CHAIN (p))
>                   {
>                     const char *prop = omp_context_name_list_prop (p);
>                     if (prop == NULL)
>                       return 0;
>                     if (!strcmp (prop, "any"))
>                       continue;

[Cf. also comment to 3/8] As OpenMP states:

"If trait-property 'any' is specified in the 'kind' trait-selector of 
the device selector set or the target_device selector sets, no other 
trait-property may be specified in the same selector set."

[From "Restrictions to context selectors are as follows:", here quoting 
TR12]

It seems as if we can avoid run-time evaluation for 'device' if there is 
a kind(any) - and likewise for 'target_device' if there is 'kind(any)', 
but we want to have an error in that case if any other trait has been 
specified, I guess.

* * *

> Sandra Loosemore wrote:
>> @@ -2194,12 +2308,21 @@ omp_context_compute_score (tree ctx, score_wide_int *score, bool declare_simd)
...
>>       int *scores
>>         = (int *) alloca ((2 * nconstructs + 2) * sizeof (int));
> 
> That's not new but I have the feeling it should be '+ 3' and not '+ 2'
> for device or target_device + and having both device and target device,
> it might even need to be + 6.

> I also wonder whether 'alloca' will really work - or only when inlined 
> at all call sites.

Ignore the last sentence. ['scores' is used locally, while 'score' is 
passed by the caller.] Still, I wonder about the + 2 vs. +3 or +6.

Otherwise, I have not spotted anything.

Tobias



  reply	other threads:[~2024-01-07 12:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-06 18:52 [PATCH 0/8] OpenMP: Implement metadirective support Sandra Loosemore
2024-01-06 18:52 ` [PATCH 1/8] OpenMP: metadirective tree data structures and front-end interfaces Sandra Loosemore
2024-01-06 19:45   ` Tobias Burnus
2024-01-07 12:18     ` Tobias Burnus [this message]
2024-01-06 18:52 ` [PATCH 2/8] OpenMP: middle-end support for metadirectives Sandra Loosemore
2024-01-06 18:52 ` [PATCH 3/8] libgomp: runtime support for target_device selector Sandra Loosemore
2024-01-06 22:44   ` Tobias Burnus
2024-01-07 11:48     ` Tobias Burnus
2024-01-06 18:52 ` [PATCH 4/8] OpenMP: C front end support for metadirectives Sandra Loosemore
2024-01-06 18:52 ` [PATCH 5/8] OpenMP: C++ front-end " Sandra Loosemore
2024-01-06 18:52 ` [PATCH 6/8] OpenMP: common c/c++ testcases " Sandra Loosemore
2024-01-06 18:52 ` [PATCH 7/8] OpenMP: Fortran front-end support " Sandra Loosemore
2024-01-06 18:52 ` [PATCH 8/8] OpenMP: Update documentation of metadirective implementation status Sandra Loosemore

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=ee62f4be-89f1-4101-8e6b-7226508068f5@net-b.de \
    --to=burnus@net-b.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=kcy@codesourcery.com \
    --cc=sandra@codesourcery.com \
    --cc=tobias@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).