From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31987 invoked by alias); 22 Dec 2014 16:38:55 -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 31975 invoked by uid 89); 22 Dec 2014 16:38:54 -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 16:38:53 +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 1Y360P-0004FW-OQ from Thomas_Schwinge@mentor.com for gcc-patches@gcc.gnu.org; Mon, 22 Dec 2014 08:38:50 -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 16:38:47 +0000 From: Thomas Schwinge To: CC: Julian Brown Subject: Re: [PATCH 7/10] OpenACC 2.0 support for libgomp - OpenACC runtime, NVidia PTX/CUDA plugin In-Reply-To: <20140923191931.2177e60f@octopus> References: <20140923191931.2177e60f@octopus> User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) Date: Mon, 22 Dec 2014 16:41:00 -0000 Message-ID: <87d27bzlkh.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/msg01780.txt.bz2 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-length: 3157 Hi! On Tue, 23 Sep 2014 19:19:31 +0100, Julian Brown = wrote: > This patch contains the bulk of the OpenACC 2.0 runtime support, > --- /dev/null > +++ b/libgomp/plugin-nvptx.c > @@ -0,0 +1,1854 @@ > +/* Plugin for NVPTX execution. > +const char * > +get_name (void) > +{ > + return "nvidia"; > +} Committed to gomp-4_0-branch in r219018: commit 56e092991a343484fe3d26b4506587d9bb99c1a9 Author: tschwinge Date: Mon Dec 22 16:37:48 2014 +0000 libgomp: Fix nvptx plugin's GOMP_OFFLOAD_get_name. =20=20=20=20 This is a function in the "generic" interface, so it should return the "generic" name instead of the OpenACC one. =20=20=20=20 libgomp/ * plugin/plugin-nvptx.c (GOMP_OFFLOAD_get_name): Return "nvptx". * oacc-init.c (resolve_device): Update for that using... (get_openacc_name): ... this new function. =20=20=20=20 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@2190= 18 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgomp/ChangeLog.gomp | 4 ++++ libgomp/oacc-init.c | 15 ++++++++++++++- libgomp/plugin/plugin-nvptx.c | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git libgomp/ChangeLog.gomp libgomp/ChangeLog.gomp index 6653e58..a36ec1f 100644 --- libgomp/ChangeLog.gomp +++ libgomp/ChangeLog.gomp @@ -1,5 +1,9 @@ 2014-12-22 Thomas Schwinge =20 + * plugin/plugin-nvptx.c (GOMP_OFFLOAD_get_name): Return "nvptx". + * oacc-init.c (resolve_device): Update for that using... + (get_openacc_name): ... this new function. + * testsuite/libgomp-test-support.exp.in (offload_additional_options, offload_additional_lib_paths): Don't set. diff --git libgomp/oacc-init.c libgomp/oacc-init.c index 7298d9a..ff51856 100644 --- libgomp/oacc-init.c +++ libgomp/oacc-init.c @@ -35,6 +35,7 @@ #include #include #include +#include =20 static gomp_mutex_t acc_device_lock; =20 @@ -84,6 +85,17 @@ goacc_register (struct gomp_device_descr const *disp) gomp_mutex_unlock (&acc_device_lock); } =20 +/* OpenACC names some things a little differently. */ + +static const char * +get_openacc_name (const char *name) +{ + if (strcmp (name, "nvptx") =3D=3D 0) + return "nvidia"; + else + return name; +} + static struct gomp_device_descr const * resolve_device (acc_device_t d) { @@ -98,7 +110,8 @@ resolve_device (acc_device_t d) /* Lookup the named device. */ while (++d !=3D _ACC_device_hwm) if (dispatchers[d] - && !strcasecmp (goacc_device_type, dispatchers[d]->name) + && !strcasecmp (goacc_device_type, + get_openacc_name (dispatchers[d]->name)) && dispatchers[d]->get_num_devices_func () > 0) goto found; =20 diff --git libgomp/plugin/plugin-nvptx.c libgomp/plugin/plugin-nvptx.c index bc5739a..d423d3a 100644 --- libgomp/plugin/plugin-nvptx.c +++ libgomp/plugin/plugin-nvptx.c @@ -1499,7 +1499,7 @@ GOMP_OFFLOAD_get_caps (void) const char * GOMP_OFFLOAD_get_name (void) { - return "nvidia"; + return "nvptx"; } =20 int Gr=C3=BC=C3=9Fe, Thomas --=-=-= Content-Type: application/pgp-signature; name="signature.asc" Content-length: 472 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEbBAEBAgAGBQJUmEkOAAoJEK3/DN1sMFFt4VAH9jzR8HN81ftW0gOidBo7UO2q 3Al/Q5tIiweSIzqV+PThzIL1WOzAH59P3DQi4gbpVbKZ7xzGYa9PG05DcFCK7YOu fCh9KtfRocM8mvY/MrnoF3xwA/8YngOJuvUbTHi2OZG7pqMzCK56XBDfLPzYMJiP dU8LcP/SLmCVzxh+EuHiEpROBIWDbymrnb2SEP14ddDJR1EPekeH4oQi1eA412yb BUJiHuZjSrdPKMdaVWdS6r45vF/O6jxAIK98t50En6EGl39VoSOmJWvCk3KRhWE2 sUDYiUCN5voY8+fNeSqE8LHLmGV563Ol9WOMBSmb8hTXH1y5BF1Dv9hDO5F4Mg== =SDvP -----END PGP SIGNATURE----- --=-=-=--