public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Tobias Burnus <tburnus@baylibre.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>,
	Paul-Antoine Arras <parras@baylibre.com>
Subject: Re: [Patch] OpenMP: Reject non-const 'condition' trait in Fortran (was: [Patch] OpenMP: Handle DECL_ASSEMBLER_NAME with 'declare variant')
Date: Tue, 13 Feb 2024 18:48:30 +0100	[thread overview]
Message-ID: <ZcurbnvC3xO1rBaW@tucnak> (raw)
In-Reply-To: <06aeb43f-f767-4302-b85e-dd956868e987@baylibre.com>

On Tue, Feb 13, 2024 at 06:31:02PM +0100, Tobias Burnus wrote:
> 	PR middle-end/113904
> 
> gcc/c/ChangeLog:
> 
> 	* c-parser.cc (c_parser_omp_context_selector): Handle splitting of
> 	OMP_TRAIT_PROPERTY_EXPR into OMP_TRAIT_PROPERTY_{DEV_NUM,BOOL}_EXPR.
> 
> gcc/cp/ChangeLog:
> 
> 	* parser.cc (cp_parser_omp_context_selector): Handle splitting of
> 	OMP_TRAIT_PROPERTY_EXPR into OMP_TRAIT_PROPERTY_{DEV_NUM,BOOL}_EXPR.
> 
> gcc/fortran/ChangeLog:
> 
> 	* openmp.cc (gfc_match_omp_context_selector):
> 	* trans-openmp.cc (gfc_trans_omp_declare_variant): Handle splitting of
> 	OMP_TRAIT_PROPERTY_EXPR into OMP_TRAIT_PROPERTY_{DEV_NUM,BOOL}_EXPR.
> 
> 
> gcc/ChangeLog:
> 
> 	* omp-general.cc (struct omp_ts_info): Update for splitting of
> 	OMP_TRAIT_PROPERTY_EXPR into OMP_TRAIT_PROPERTYDEV_NUM,BOOL}_EXPR.

_{ missing above before DEV_NUM

> 	* omp-selectors.h (enum omp_tp_type): Replace
> 	OMP_TRAIT_PROPERTY_EXPR by OMP_TRAIT_PROPERTY_{DEV_NUM,BOOL}_EXPR.
> 
> gcc/testsuite/ChangeLog:
> 
> 	* gfortran.dg/gomp/declare-variant-1.f90: Change 'condition' trait's
> 	argument from integer to a logical expression.
> 	* gfortran.dg/gomp/declare-variant-11.f90: Likewise.
> 	* gfortran.dg/gomp/declare-variant-12.f90: Likewise.
> 	* gfortran.dg/gomp/declare-variant-13.f90: Likewise.
> 	* gfortran.dg/gomp/declare-variant-2.f90: Likewise.
> 	* gfortran.dg/gomp/declare-variant-2a.f90: Likewise.
> 	* gfortran.dg/gomp/declare-variant-3.f90: Likewise.
> 	* gfortran.dg/gomp/declare-variant-4.f90: Likewise.
> 	* gfortran.dg/gomp/declare-variant-6.f90: Likewise.
> 	* gfortran.dg/gomp/declare-variant-8.f90: Likewise.
> 	* gfortran.dg/gomp/declare-variant-20.f90: New test.

Otherwise LGTM.

Of course it makes me wonder to what extent we actually do support the
OpenMP 5.1 target_device device_num trait with constant or non-constant
device num, because similarly to the user condition trait if it something
that can't be decided at compile time but needs to be checked at runtime,
we need to be able to compute scores of all the variants that could be
effective depending on the device_num comparison and/or condition
evaluation and turn that into set of runtime comparisons with choices of
the variants depending on the scores.
If one is lucky, it can be device == device_num ? fn1 : fn2, but it can
be more complex than that.

	Jakub


  reply	other threads:[~2024-02-13 17:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-13 14:54 [Patch] OpenMP: Handle DECL_ASSEMBLER_NAME with 'declare variant' Tobias Burnus
2024-02-13 15:08 ` Jakub Jelinek
2024-02-13 17:31   ` [Patch] OpenMP: Reject non-const 'condition' trait in Fortran (was: [Patch] OpenMP: Handle DECL_ASSEMBLER_NAME with 'declare variant') Tobias Burnus
2024-02-13 17:48     ` Jakub Jelinek [this message]
2024-02-13 20:03       ` [Patch] OpenMP: Reject non-const 'condition' trait in Fortran Tobias Burnus
2024-03-04 12:58     ` [Patch] OpenMP: Reject non-const 'condition' trait in Fortran (was: [Patch] OpenMP: Handle DECL_ASSEMBLER_NAME with 'declare variant') Thomas Schwinge

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=ZcurbnvC3xO1rBaW@tucnak \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=parras@baylibre.com \
    --cc=tburnus@baylibre.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).