From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12773 invoked by alias); 11 Feb 2015 14:20:23 -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 12761 invoked by uid 89); 11 Feb 2015 14:20:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 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; Wed, 11 Feb 2015 14:20:22 +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 1YLY9K-0003JB-JI from Thomas_Schwinge@mentor.com ; Wed, 11 Feb 2015 06:20:18 -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.224.2; Wed, 11 Feb 2015 14:18:33 +0000 From: Thomas Schwinge To: Ilya Verbin CC: GCC Patches , Bernd Schmidt Subject: Re: nvptx offloading patches [4/n] In-Reply-To: <20150128175945.GD12176@msticlxl57.ims.intel.com> References: <5454CDF1.3070307@codesourcery.com> <87zj92vnsa.fsf@kepler.schwinge.homeip.net> <20150128175945.GD12176@msticlxl57.ims.intel.com> User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu) Date: Wed, 11 Feb 2015 14:20:00 -0000 Message-ID: <87siech6q8.fsf@schwinge.name> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-SW-Source: 2015-02/txt/msg00707.txt.bz2 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-length: 2688 Hi! On Wed, 28 Jan 2015 20:59:45 +0300, Ilya Verbin wrote: > On 28 Jan 18:05, Thomas Schwinge wrote: > > + fprintf (out, "#define PTX_ID 1\n"); > > + fprintf (out, "static __attribute__((constructor)) void init (void)\= n{\n"); > > + fprintf (out, " GOMP_offload_register (__OPENMP_TARGET__, PTX_ID,\n= "); >=20 > The file include/gomp-constants.h already contains: > #define GOMP_DEVICE_NVIDIA_PTX 5 >=20 > I guess it would be better to include gomp-constants.h into mkoffload and= to use > this define. Thanks! You're right indeed -- I mistakenly committed an older version of this file. Committed to trunk in r220619: commit ab0e6fbc36cacaa619dfacec41e17a681a28562a Author: tschwinge Date: Wed Feb 11 14:15:28 2015 +0000 nvptx mkoffload: Don't hard-code GOMP_DEVICE_NVIDIA_PTX. =20=20=20=20 gcc/ * config/nvptx/mkoffload.c: Include "gomp-constants.h". (process): Use its GOMP_DEVICE_NVIDIA_PTX instead of (wrongly) hard-coding PTX_ID. =20=20=20=20 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220619 138bc75d-0d04-04= 10-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/config/nvptx/mkoffload.c | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git gcc/ChangeLog gcc/ChangeLog index 2fa7ff2..1479dcb 100644 --- gcc/ChangeLog +++ gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-02-11 Thomas Schwinge + + * config/nvptx/mkoffload.c: Include "gomp-constants.h". + (process): Use its GOMP_DEVICE_NVIDIA_PTX instead of (wrongly) + hard-coding PTX_ID. + 2015-02-11 H.J. Lu =20 * doc/sourcebuild.texi (pie_enabled): Document. diff --git gcc/config/nvptx/mkoffload.c gcc/config/nvptx/mkoffload.c index 38ccdba..8f359cf 100644 --- gcc/config/nvptx/mkoffload.c +++ gcc/config/nvptx/mkoffload.c @@ -35,6 +35,7 @@ #include "obstack.h" #include "diagnostic-core.h" #include "collect-utils.h" +#include "gomp-constants.h" =20 const char tool_name[] =3D "nvptx mkoffload"; =20 @@ -791,9 +792,9 @@ process (FILE *in, FILE *out) fprintf (out, "extern void GOMP_offload_register (const void *, int, voi= d *);\n"); =20 fprintf (out, "extern void *__OPENMP_TARGET__[];\n\n"); - fprintf (out, "#define PTX_ID 1\n"); fprintf (out, "static __attribute__((constructor)) void init (void)\n{\n= "); - fprintf (out, " GOMP_offload_register (__OPENMP_TARGET__, PTX_ID,\n"); + fprintf (out, " GOMP_offload_register (__OPENMP_TARGET__, %d,\n", + GOMP_DEVICE_NVIDIA_PTX); fprintf (out, " &target_data);\n"); fprintf (out, "};\n"); } Gr=C3=BC=C3=9Fe, Thomas --=-=-= Content-Type: application/pgp-signature Content-length: 472 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJU22SvAAoJEPoxNhtoi6COrHEH/3nM+cgvr1GnGvMnoe5Z6gs0 hdEqJu2KvC2eyzgzySKdJ3j/uvrsUYh4oM6i2lqcIHgOkHY3x7G2MJyw/acy3d8D vaWTK+bgi/1bJ0Yk90bDCFrN8bn5IUTwsyVuE4KQcUbzMCLZJf/Hdd5E82KucuTs T0rWCF7ph8Os3efbD/vyfIpdVQRGIOmG6+WKasWJXJe1zvf84YgY5K/VXpeoe0Zt TDh9nNpZHZ+5pjzaUxZ1AVfDe7WmQndPLTafNcJKIYEKXvhEWPXkvwumqDtseIpv MRxWjC4BeHM65pSObrFYEUFKndHr+bmfItdW74Zxmy9YEBw3Q2jkF5CP2/cYoWg= =IaEi -----END PGP SIGNATURE----- --=-=-=--