From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7093 invoked by alias); 22 Dec 2014 17:59:08 -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 7082 invoked by uid 89); 22 Dec 2014 17:59:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,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; Mon, 22 Dec 2014 17:59:06 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1Y37G2-0003RH-QG from Thomas_Schwinge@mentor.com ; Mon, 22 Dec 2014 09:59:03 -0800 Received: from feldtkeller.schwinge.homeip.net (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.3.181.6; Mon, 22 Dec 2014 17:59:01 +0000 From: Thomas Schwinge To: , Jakub Jelinek CC: Julian Brown Subject: Re: [PATCH 1/5] OpenACC 2.0 support for libgomp - OpenACC runtime, NVidia PTX/CUDA plugin (repost) In-Reply-To: <20141111135323.29e0f27b@octopus> References: <20140923191931.2177e60f@octopus> <20141111135323.29e0f27b@octopus> User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) Date: Mon, 22 Dec 2014 18:05:00 -0000 Message-ID: <87wq5jy3a7.fsf@kepler.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-SW-Source: 2014-12/txt/msg01794.txt.bz2 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-length: 5158 Hi! On Tue, 11 Nov 2014 13:53:23 +0000, Julian Brown = wrote: > On Tue, 23 Sep 2014 19:19:31 +0100 > Julian Brown wrote: > > This patch contains the bulk of the OpenACC 2.0 runtime support, > > building around, or on top of, the OpenMP 4.0 support (as previously > > posted or already extant upstream) where we could. [...] >=20 > Here is a new version of the OpenACC support patch for libgomp, [...] > libgomp/ > * libgomp_target.h [...] > (struct gomp_device_descr): Move here. Add offload_regions_registered, > openacc dispatch functions, target_data. > * target.c [...] > (splay_tree_key_s, gomp_device_descr): Don't declare here. > --- a/libgomp/libgomp_target.h > +++ b/libgomp/libgomp_target.h > +/* This structure describes accelerator device. > + It contains name of the corresponding libgomp plugin, function handle= rs for > + interaction with the device, ID-number of the device, and information= about > + mapped memory. */ > +struct gomp_device_descr > +{ > [...] > + /* Extra information required for a device instance by a given target.= */ > + void *target_data; > +}; Committed to gomp-4_0-branch in r219024: commit 095199060ff07ddfd0fb5d5c9fecabfe80ed8eed Author: tschwinge Date: Mon Dec 22 17:57:50 2014 +0000 libgomp: Move target_data member from struct gomp_device_descr into str= uct acc_dispatch_t. =20=20=20=20 It is only used with struct acc_dispatch_t's open_device_func and close_device_func, so specific to OpenACC support. =20=20=20=20 libgomp/ * libgomp.h (struct gomp_device_descr): Move target_data member... (struct acc_dispatch_t): ... into here. Change all users. =20=20=20=20 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@2190= 24 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgomp/ChangeLog.gomp | 3 +++ libgomp/libgomp.h | 6 +++--- libgomp/oacc-init.c | 11 ++++++----- libgomp/target.c | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git libgomp/ChangeLog.gomp libgomp/ChangeLog.gomp index 3aa9bf4..4eac98c 100644 --- libgomp/ChangeLog.gomp +++ libgomp/ChangeLog.gomp @@ -1,5 +1,8 @@ 2014-12-22 Thomas Schwinge =20 + * libgomp.h (struct gomp_device_descr): Move target_data member... + (struct acc_dispatch_t): ... into here. Change all users. + * target.c (GOMP_target_update): To initialize, call gomp_init_dev_tables instead of gomp_init_device. =20 diff --git libgomp/libgomp.h libgomp/libgomp.h index 866f6ca..ec3c52e 100644 --- libgomp/libgomp.h +++ libgomp/libgomp.h @@ -684,6 +684,9 @@ typedef struct acc_dispatch_t happen out-of-order with respect to mapping. */ struct target_mem_desc *data_environ; =20 + /* Extra information required for a device instance by a given target. = */ + void *target_data; + /* Open or close a device instance. */ void *(*open_device_func) (int n); int (*close_device_func) (void *h); @@ -769,9 +772,6 @@ struct gomp_device_descr =20 /* Memory-mapping info for this device instance. */ struct gomp_memory_mapping mem_map; - - /* Extra information required for a device instance by a given target. = */ - void *target_data; }; =20 extern void gomp_acc_insert_pointer (size_t, void **, size_t *, void *); diff --git libgomp/oacc-init.c libgomp/oacc-init.c index ff51856..06039b3 100644 --- libgomp/oacc-init.c +++ libgomp/oacc-init.c @@ -279,11 +279,11 @@ lazy_open (int ord) thr->saved_bound_dev =3D NULL; thr->mapped_data =3D NULL; =20 - if (!acc_dev->target_data) - acc_dev->target_data =3D acc_dev->openacc.open_device_func (ord); + if (!acc_dev->openacc.target_data) + acc_dev->openacc.target_data =3D acc_dev->openacc.open_device_func (or= d); =20 thr->target_tls - =3D acc_dev->openacc.create_thread_data_func (acc_dev->target_data); + =3D acc_dev->openacc.create_thread_data_func (acc_dev->openacc.target_= data); =20 acc_dev->openacc.async_set_async_func (acc_async_sync); =20 @@ -344,10 +344,11 @@ acc_shutdown_1 (acc_device_t d) =20 if (walk->dev) { - if (walk->dev->openacc.close_device_func (walk->dev->target_data= ) < 0) + void *target_data =3D walk->dev->openacc.target_data; + if (walk->dev->openacc.close_device_func (target_data) < 0) gomp_fatal ("failed to close device"); =20 - walk->dev->target_data =3D NULL; + walk->dev->openacc.target_data =3D target_data =3D NULL; =20 gomp_free_memmap (walk->dev); =20 diff --git libgomp/target.c libgomp/target.c index 8517a84..bf719f8 100644 --- libgomp/target.c +++ libgomp/target.c @@ -1106,8 +1106,8 @@ gomp_target_init (void) current_device.offload_regions_registered =3D false; current_device.mem_map.splay_tree.root =3D NULL; current_device.mem_map.is_initialized =3D false; - current_device.target_data =3D NULL; current_device.openacc.data_environ =3D NULL; + current_device.openacc.target_data =3D NULL; for (i =3D 0; i < new_num_devices; i++) { current_device.id =3D num_devices + 1; Gr=C3=BC=C3=9Fe, Thomas --=-=-= Content-Type: application/pgp-signature; name="signature.asc" Content-length: 472 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJUmFvgAAoJEK3/DN1sMFFtaKAH/A1l5t97x0g0hHU4mIXp9wUN 56Nm0iYAvSCPvQnpavIPNtMZTrc28cEQAOFRK2KLxHDJ7M0gBNeakD5T4de4bt22 nwsgQ8o4b5NOIJa6IrUK0VXlfKZ0sWnAU+Zhd5r2zAPAi6ZoFU9UIxP62dX8/Xt/ g89M0VVIhVYzoA6Fd975Fy5XFBGpmm4PAf7Uwe6LY/ocTYfHV3zcBHvShJ9YUSyh Sav0k+mNRnfYG2bRr7BvL79tQvHOKPFtzTxZdAmK7xZya/19F5iD4nqzkqGwleb6 JK4IiVewWdN+OiGmaGh6CGU9CkjXiNzvnv582Te8NaDJv5IRLLW5DS0xwdvccOE= =W/PQ -----END PGP SIGNATURE----- --=-=-=--