From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 43646 invoked by alias); 17 Apr 2015 09:54:53 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 43593 invoked by uid 89); 17 Apr 2015 09:54:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 17 Apr 2015 09:54:50 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-02.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1Yj2yy-0004uw-Sx from Julian_Brown@mentor.com ; Fri, 17 Apr 2015 02:54:45 -0700 Received: from octopus (137.202.0.76) by SVR-IES-FEM-02.mgc.mentorg.com (137.202.0.106) with Microsoft SMTP Server id 14.3.224.2; Fri, 17 Apr 2015 10:54:43 +0100 Date: Fri, 17 Apr 2015 09:54:00 -0000 From: Julian Brown To: Ilya Verbin CC: Jakub Jelinek , Thomas Schwinge , , Kirill Yukhin Subject: 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) Message-ID: <20150417105435.0ed76cad@octopus> In-Reply-To: <20150414151502.5ca882a4@octopus> References: <20150331125206.GC64930@msticlxl57.ims.intel.com> <20150331130758.GA19273@tucnak.redhat.com> <20150331161036.GA623@msticlxl57.ims.intel.com> <20150331235328.GC623@msticlxl57.ims.intel.com> <20150401052147.GG19273@tucnak.redhat.com> <20150401131405.GD623@msticlxl57.ims.intel.com> <20150401132025.GM19273@tucnak.redhat.com> <20150406124557.GA5541@msticlxl57.ims.intel.com> <20150407152645.GJ19273@tucnak.redhat.com> <20150408153142.128b97b9@octopus> <20150408145856.GA19410@msticlxl57.ims.intel.com> <20150414151502.5ca882a4@octopus> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-04/txt/msg00860.txt.bz2 On Tue, 14 Apr 2015 15:15:02 +0100 Julian Brown wrote: > On Wed, 8 Apr 2015 17:58:56 +0300 > Ilya Verbin 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.