public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tobias Burnus <tobias@codesourcery.com>
To: Sandra Loosemore <sandra@codesourcery.com>, <gcc-patches@gcc.gnu.org>
Cc: <jakub@redhat.com>, <julian@codesourcery.com>
Subject: Re: [PATCH V2 3/3] OpenMP: Use enumerators for names of trait-sets and traits
Date: Mon, 27 Nov 2023 18:19:26 +0100	[thread overview]
Message-ID: <7913e015-6eb6-44d5-bea1-39282c4039ed@codesourcery.com> (raw)
In-Reply-To: <20231122162233.1721224-1-sandra@codesourcery.com>

Hi Sandra,

{BTW: 1/3 needs to be eventually rebased as it no longer applies
cleanly; I have not checked 2/3 or 3/3 yet.]

1/3+2/3 look good to me, unless Jakub has some comments, I think they
can go it.

Regarding 3/3, some first comments. I still want to read it a bit more
careful and play with it.

On 22.11.23 17:22, Sandra Loosemore wrote:
> +static const char *const vendor_properties[] =
> +  { "amd", "arm", "bsc", "cray", "fujitsu", "gnu", "ibm", "intel",
> +    "llvm", "nvidia", "pgi", "ti", "unknown", NULL };

Can you add "hpe"? Cf. "OpenMP API 5.2 Supplementary Source Code" at
https://www.openmp.org/specifications/

> +static const char *const atomic_default_mem_order_properties[] =
> +  { "seq_cst", "relaxed", "acq_rel", NULL };

Can you add "acquire" and "release"? Those have been added in OpenMP 5.1
for 'omp atomic', supported since GCC 12; albeit, for requires, that's
new since 5.2.

> +   { "atomic_default_mem_order",
> +     (1 << OMP_TRAIT_SET_IMPLEMENTATION),
> +     OMP_TRAIT_PROPERTY_ID, true,
> +     atomic_default_mem_order_properties,
> +   },
> +   { "requires",
> +     (1 << OMP_TRAIT_SET_IMPLEMENTATION),
> +     OMP_TRAIT_PROPERTY_CLAUSE_LIST, true,
> +     NULL
> +   },
> +   { "unified_address",
> +     (1 << OMP_TRAIT_SET_IMPLEMENTATION),
> +     OMP_TRAIT_PROPERTY_NONE, true,
> +     NULL
> +   },

I don't understand this code. This looks as if "requires" and "unified_address"
are on the same level but in my understanding they have to be used as in:

  match(implementation = {requires(unified_address, atomic_default_mem_order_properties(release)})

while from the syntax, it looks as if this would permit:

  match(implementation = {unified_address, atomic_default_mem_order_properties(release))

Disclaimer: It might be that the code handles it correctly but I just misread it.
Or that I misread the spec.

  * * *

> +                   warning_at (loc, 0,
> +                               "unknown property %qE of %qs selector",

All '0' OpenMP warnings should now use 'OPT_Wopenmp' instead.

  * * *

> -       if (selectors[i] == NULL)
> +       /* Some trait sets permit extension traits which are supposed
> +          to be ignored if the implementation doesn't support them.
> +          GCC does not support any extension traits, and if it did, they
> +          would have their own identifiers.  */

I am not sure whether I get this correctly. In my understanding

   match(implementation = {extension(ompx_myCompiler_abcd)])

should parse without error - but evaluate as false / not matching. Thus, it is not really
ignored but parsed – but still causing a not-matched.

(We can argue whether that should be silently accepted or still show a warning.)


Likewise for:
   match (implementation = { ompx_myCompiler_abcd(1) } )

albeit here a warning could make more sense than for 'extension', especially if a
typo fix would be available.

 From the comment, it looks like as it is completely ignored - such that there could be still a match.

Disclaimer: I might have misunderstood the code - or might have missed something in the spec.

Tobias

-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955

  reply	other threads:[~2023-11-27 17:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-19  9:21 [PATCH 0/3] OpenMP: Improve data abstractions for context selectors Sandra Loosemore
2023-11-19  9:21 ` [PATCH 1/3] OpenMP: Introduce accessor macros and constructors " Sandra Loosemore
2023-11-19  9:21 ` [PATCH 2/3] OpenMP: Unify representation of name-list properties Sandra Loosemore
2023-11-19  9:21 ` [PATCH 3/3] OpenMP: Use enumerators for names of trait-sets and traits Sandra Loosemore
2023-11-21 20:48   ` Sandra Loosemore
2023-11-20 10:32 ` [PATCH 0/3] OpenMP: Improve data abstractions for context selectors Julian Brown
2023-11-22 16:22 ` [PATCH V2 3/3] OpenMP: Use enumerators for names of trait-sets and traits Sandra Loosemore
2023-11-27 17:19   ` Tobias Burnus [this message]
2023-11-27 18:18     ` Tobias Burnus

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=7913e015-6eb6-44d5-bea1-39282c4039ed@codesourcery.com \
    --to=tobias@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=julian@codesourcery.com \
    --cc=sandra@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).