This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libgomp nvptx plugin: rework initialisation and support the proposed load/unload hooks (was: Merge current set of OpenACC changes from gomp-4_0-branch) (PR65742)


On Tue, 14 Apr 2015 15:15:02 +0100
Julian Brown <julian@codesourcery.com> wrote:

> On Wed, 8 Apr 2015 17:58:56 +0300
> Ilya Verbin <iverbin@gmail.com> wrote:
> 
> > On Wed, Apr 08, 2015 at 15:31:42 +0100, Julian Brown wrote:
> > > This version is mostly the same as the last posted version but
> > > has a tweak in GOACC_parallel to account for the new splay tree
> > > arrangement for target functions:
> > > 
> > > -      tgt_fn = (void (*)) tgt_fn_key->tgt->tgt_start;
> > > +      tgt_fn = (void (*)) tgt_fn_key->tgt_offset;
> > > 
> > > Have there been any other changes I might have missed?
> > 
> > No.
> > 
> > > It passes libgomp testing on NVPTX. OK?
> > 
> > Have you tested it with disabled offloading?
> > 
> > I see several regressions:
> > FAIL: libgomp.oacc-c/../libgomp.oacc-c-c++-common/acc_on_device-1.c
> > -DACC_DEVICE_TYPE_host_nonshm=1 -DACC_MEM_SHARED=0 execution test
> > FAIL: libgomp.oacc-c/../libgomp.oacc-c-c++-common/if-1.c
> > -DACC_DEVICE_TYPE_host_nonshm=1 -DACC_MEM_SHARED=0 execution test
> 
> I think there may be multiple issues here. The attached patch
> addresses one -- acc_device_type not distinguishing between
> "offloaded" and host code with the host_nonshm plugin.

The patch appears to fix the original issue after all: I've re-run
tests with host==target and the failures no longer appear. Also the
same has been noted by Dominique d'Humieres in PR65742.

> The other problem is that it appears that the ACC_DEVICE_TYPE
> environment variable is not getting set properly on the target for
> (any of) the OpenACC tests: this means a lot of the time the "wrong"
> plugin is being tested, and means that the above tests (and several
> others) still fail. That will apparently need some more engineering
> (on our part).

Fixing this turns out to require more DejaGNU-fu than I have: AFAICT,
setting a per-test environment variable from an .exp file can't easily
be done at present. The potentially useful-looking
{dg-}set-target-env-var doesn't look quite suitable for this purpose,
and besides which doesn't actually seem to be implemented for host !=
target anyway.

(At least, if this fragment of gcc-dg.exp is anything to go by:

   if { [info exists set_target_env_var] \
        && [llength $set_target_env_var] != 0 } {
     if { [is_remote target] } {
       return [list "unsupported" ""]
     } ...
).

So: OK for trunk?

Thanks,

Julian

> ChangeLog
> 
>     libgomp/
>     * oacc-init.c (acc_on_device): Check whether we're in an offloaded
>     region for host_nonshm plugin.
>     * plugin/plugin-host.c (GOMP_OFFLOAD_openacc_parallel): Set
>     nonshm_exec flag in thread-local data.
>     (GOMP_OFFLOAD_openacc_create_thread_data): Allocate thread-local
>     data for host_nonshm plugin.
>     (+GOMP_OFFLOAD_openacc_destroy_thread_data): Free thread-local
> data for host_nonshm plugin.
>     * plugin/plugin-host.h: New.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]