public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: Richard Biener <rguenther@suse.de>,
	Uros Bizjak <ubizjak@gmail.com>,
	       Tom de Vries <tdevries@suse.de>,
	Martin Jambor <mjambor@suse.cz>,
	       gcc-patches@gcc.gnu.org,
	Richard Earnshaw <richard.earnshaw@arm.com>,
	       Andreas Krebbel <krebbel@linux.ibm.com>
Subject: Re: [RFC PATCH] targetm.omp.device_kind_arch_isa and OpenMP declare variant kind/arch/isa handling
Date: Wed, 30 Oct 2019 03:13:00 -0000	[thread overview]
Message-ID: <20191029225740.GN4650@tucnak> (raw)
In-Reply-To: <20191029224011.GH28442@gate.crashing.org>

On Tue, Oct 29, 2019 at 05:40:11PM -0500, Segher Boessenkool wrote:
> On Tue, Oct 29, 2019 at 06:15:31PM +0100, Jakub Jelinek wrote:
> > The standard makes it implementation defined what an arch is and what is
> > isa, but I think because there is no selector like target that arch should
> > mostly contain identifiers that match the ABI incompatible stuff (target,
> > perhaps whether it is 32-bit or 64-bit, plus endianity where needed etc.)
> > and keep isa to be identifiers for the ISAs, or perhaps where there are no
> > clear ISA names say architecture variants or revisions or similar.
> > 
> > I've only implemented i386 and nvptx so far, will leave the rest to
> > port maintainers; would be nice to coordinate what is added a little bit
> > with other implementations like LLVM, if they'd be willing to coordinate.
> 
> What would this be used for?  Can you give some more context?

https://www.openmp.org/spec-html/5.0/openmpse11.html#x41-480002.3
OpenMP 5.0 has two directives, declare variant which I'm implementing right
now and metadirective, which I'll be working on next stage1.
declare variant is a direct call redirection based on context, where one can
provide a specialized function implementation for a particular OpenMP
construct, compiler implementation, CPU architecture, etc.
The metadirective allows specialization of OpenMP pragmas, use this OpenMP pragma
only in some OpenMP context and not in another one, or only on certain
architecture, isa, whatever.
These actually don't query anything at runtime, it is purely compile time
specialization, based on what either the whole translation unit or a
particular function are compiled for.

> There already are a lot of different ways to get information about the
> execution environment you're running on; why is this any better?

There is no question of better or worse, it is simply a part of a standard
that GCC is trying to implement, like we try to implement all of C++20, we
also try to implement all of OpenMP or OpenACC etc.
The exact identifiers are implementation defined though, and that is why we
need to think of what is reasonable for each target (at least each target
where OpenMP is used often, powerpc is certainly one of those).

	Jakub

  reply	other threads:[~2019-10-29 22:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-29 17:44 Jakub Jelinek
2019-10-29 22:57 ` Segher Boessenkool
2019-10-30  3:13   ` Jakub Jelinek [this message]
2019-10-30 22:05     ` Segher Boessenkool
2019-10-30 14:20 ` Szabolcs Nagy
2019-10-30 14:51   ` Jakub Jelinek
2019-10-30 17:40     ` Szabolcs Nagy
2019-10-31  9:35     ` Richard Sandiford
2019-10-31  9:39       ` Jakub Jelinek
2019-10-31 10:55         ` Szabolcs Nagy
2019-11-01 17:15 ` Martin Jambor

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=20191029225740.GN4650@tucnak \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=krebbel@linux.ibm.com \
    --cc=mjambor@suse.cz \
    --cc=rguenther@suse.de \
    --cc=richard.earnshaw@arm.com \
    --cc=segher@kernel.crashing.org \
    --cc=tdevries@suse.de \
    --cc=ubizjak@gmail.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).