This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: For OpenACC libgomp entry points, redefine the "int device" argument to "unsigned int flags"
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Thomas Schwinge <thomas at codesourcery dot com>
- Cc: gcc at gcc dot gnu dot org, Gergö Barany <gergo_barany at mentor dot com>
- Date: Wed, 19 Dec 2018 15:18:12 +0100
- Subject: Re: For OpenACC libgomp entry points, redefine the "int device" argument to "unsigned int flags"
- References: <0fe4cc25-8ed3-831f-337f-c61fd54eb7f0@mentor.com> <6a1ccffb-b139-3bde-6e3d-198464051cbf@mentor.com> <yxfpefaesaov.fsf@hertz.schwinge.homeip.net> <yxfpbm5is9kf.fsf@hertz.schwinge.homeip.net> <yxfp1s6dsn01.fsf@hertz.schwinge.homeip.net> <20181219133838.GA23305@tucnak> <yxfpy38lr50l.fsf@hertz.schwinge.homeip.net> <20181219140342.GB23305@tucnak>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Dec 19, 2018 at 03:03:42PM +0100, Jakub Jelinek wrote:
> On Wed, Dec 19, 2018 at 02:59:54PM +0100, Thomas Schwinge wrote:
> > Right. For OpenACC, there's no "device" clause, so we only ever passed
> > in "GOMP_DEVICE_ICV" (default), or "GOMP_DEVICE_HOST_FALLBACK" ("if
> > (false)" clause). Therefore, the libgomp "resolve_legacy_flags" function
> > added to make sure that these two values (as used by old executables)
> > continue to work as before (with new libgomp). (And, we have to make
> > sure that no (new) "GOACC_FLAG_*" combination ever results in these
> > values; will document that.)
> >
> > I'm currently doing a verification run of the libgomp testsuite (had one
> > detail botched up in the patch that I sent).
> >
> > And just to make sure: as recently discussed in a different thread, we
> > don't have to support the case of new executables built that are
> > dynamically linking against old libgomp versions (where the latter won't
> > understand the new "flags" value "GOACC_FLAG_HOST_FALLBACK", would ignore
> > that flag).
>
> LGTM then in principle.
Or keep it int and use inverted bitmask, thus when bit is 1, it represents
the default state and when bit is 0, it is something different from it.
If you passed before just -1 and -2 and because we are only supporting two's
complement, the host fallback test would be (flags & 1) == 0.
Then you don't need to at runtime transform from legacy to non-legacy.
Jakub