From patchwork Mon Jan 12 14:56:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 427771 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 9D18514016A for ; Tue, 13 Jan 2015 01:56:29 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; q=dns; s=default; b=Vp9FpjzgknsvIB3G qicfWzKZxnLBjJHsUqZvWsc8G4bkQc3pe5KOWPH0Xx/KYjkqIc+RjZVmUL5NTFcH gneZfRJXxaIIgeTKj0aduG8bemZH2tCIjEbc9XwZW1bm0ueH6EPcVGdJ9zlukjpc D/sZXtqlkURdcum3f3LX0IzXUBo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=default; bh=ewOqpDl4ryqBTcvRgBglbH iQX/w=; b=YHlxj+94yHxsQ3D2P3CCfaNg2z/oIlQU9siiam0/gJAs9MAx3k52U/ pNW2lFLyDl8g+meAU/ww2b7f3PNBeNJu5sDWIz7tgNoswTXAMCrDrudFy2gUBNvl aY5N74W+HcQDfWQrc9KJqVAKeR4csuJiCcxHKsD0LaJt0Q0nmRZZM= Received: (qmail 9027 invoked by alias); 12 Jan 2015 14:56:21 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 9012 invoked by uid 89); 12 Jan 2015 14:56:20 -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, 12 Jan 2015 14:56:17 +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 1YAgPd-0002EP-Tb from Thomas_Schwinge@mentor.com for gcc-patches@gcc.gnu.org; Mon, 12 Jan 2015 06:56:14 -0800 Received: from feldtkeller.schwinge.homeip.net (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; Mon, 12 Jan 2015 14:56:12 +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: <874mrw2hfp.fsf@kepler.schwinge.homeip.net> References: <20140923191931.2177e60f@octopus> <874mrw2hfp.fsf@kepler.schwinge.homeip.net> User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) Date: Mon, 12 Jan 2015 15:56:06 +0100 Message-ID: <87twzw120p.fsf@kepler.schwinge.homeip.net> MIME-Version: 1.0 Hi! On Mon, 12 Jan 2015 15:37:46 +0100, I 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, [...] > > --- /dev/null > > +++ b/libgomp/plugin-nvptx.c > > @@ -0,0 +1,1854 @@ > > +/* Plugin for NVPTX execution. > > > +#include "libgomp.h" > > Plugins in libgomp are not to depend on libgomp internals (libgomp.h), > ... it much more makes sense to just use pthread mutexes here. Committed > to gomp-4_0-branch in r219467: > > commit 4de7ea8222739fa60d6eb81284dac61dc2bae7b2 > Author: tschwinge > Date: Mon Jan 12 14:35:51 2015 +0000 > > libgomp: Use pthread mutexes in the nvptx plugin. > > ... instead of libgomp's internal mutex implementation. Plugins aren't to > depend on internal libgomp interfaces, and how would you instantiate a > gomp_mutex_t in a plugin without knowing what it is exactly? Given this, we can then tighten the libgomp plugins' include files; committed to gomp-4_0-branch in r219469: commit 7c011e60ec4e056e4c1b054966fd95fb2cb5e44a Author: tschwinge Date: Mon Jan 12 14:53:53 2015 +0000 libgomp: Don't use internal libgomp.h for plugins. ..., and explicitly link libgomp plugins against libgomp. libgomp/ * plugin/plugin-host.c [HOST_NONSHM_PLUGIN]: Don't include "libgomp.h". * plugin/plugin-nvptx.c: Likewise. Include . * plugin/Makefrag.am (libgomp_plugin_nvptx_la_LIBADD) (libgomp_plugin_host_nonshm_la_LIBADD): Append "libgomp.la". * Makefile.in: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@219469 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgomp/ChangeLog.gomp | 6 ++++++ libgomp/Makefile.in | 7 ++++--- libgomp/plugin/Makefrag.am | 3 ++- libgomp/plugin/plugin-host.c | 2 +- libgomp/plugin/plugin-nvptx.c | 2 +- 5 files changed, 14 insertions(+), 6 deletions(-) Grüße, Thomas diff --git libgomp/ChangeLog.gomp libgomp/ChangeLog.gomp index 76f21e6..c2566cf 100644 --- libgomp/ChangeLog.gomp +++ libgomp/ChangeLog.gomp @@ -1,5 +1,11 @@ 2015-01-12 Thomas Schwinge + * plugin/plugin-host.c [HOST_NONSHM_PLUGIN]: Don't include "libgomp.h". + * plugin/plugin-nvptx.c: Likewise. Include . + * plugin/Makefrag.am (libgomp_plugin_nvptx_la_LIBADD) + (libgomp_plugin_host_nonshm_la_LIBADD): Append "libgomp.la". + * Makefile.in: Regenerate. + * env.c: Don't include "libgomp_target.h". * libgomp-plugin.c: Likewise. * oacc-async.c: Likewise. diff --git libgomp/Makefile.in libgomp/Makefile.in index ac34b97..8758989 100644 --- libgomp/Makefile.in +++ libgomp/Makefile.in @@ -123,7 +123,7 @@ am__installdirs = "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(infodir)" \ "$(DESTDIR)$(fincludedir)" "$(DESTDIR)$(libsubincludedir)" \ "$(DESTDIR)$(toolexeclibdir)" LTLIBRARIES = $(toolexeclib_LTLIBRARIES) -libgomp_plugin_host_nonshm_la_LIBADD = +libgomp_plugin_host_nonshm_la_DEPENDENCIES = libgomp.la am_libgomp_plugin_host_nonshm_la_OBJECTS = \ libgomp_plugin_host_nonshm_la-plugin-host.lo libgomp_plugin_host_nonshm_la_OBJECTS = \ @@ -133,7 +133,7 @@ libgomp_plugin_host_nonshm_la_LINK = $(LIBTOOL) --tag=CC \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libgomp_plugin_host_nonshm_la_LDFLAGS) $(LDFLAGS) -o $@ am__DEPENDENCIES_1 = -@PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_la_DEPENDENCIES = \ +@PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_la_DEPENDENCIES = libgomp.la \ @PLUGIN_NVPTX_TRUE@ $(am__DEPENDENCIES_1) @PLUGIN_NVPTX_TRUE@am_libgomp_plugin_nvptx_la_OBJECTS = \ @PLUGIN_NVPTX_TRUE@ libgomp_plugin_nvptx_la-plugin-nvptx.lo @@ -407,7 +407,7 @@ libgomp_la_SOURCES = alloc.c barrier.c critical.c env.c error.c iter.c \ @PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_la_LDFLAGS = \ @PLUGIN_NVPTX_TRUE@ $(libgomp_plugin_nvptx_version_info) \ @PLUGIN_NVPTX_TRUE@ $(lt_host_flags) $(PLUGIN_NVPTX_LDFLAGS) -@PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_la_LIBADD = $(PLUGIN_NVPTX_LIBS) +@PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_la_LIBADD = libgomp.la $(PLUGIN_NVPTX_LIBS) @PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_la_LIBTOOLFLAGS = --tag=disable-static libgomp_plugin_host_nonshm_version_info = -version-info $(libtool_VERSION) libgomp_plugin_host_nonshm_la_SOURCES = plugin/plugin-host.c @@ -415,6 +415,7 @@ libgomp_plugin_host_nonshm_la_CPPFLAGS = $(AM_CPPFLAGS) -DHOST_NONSHM_PLUGIN libgomp_plugin_host_nonshm_la_LDFLAGS = \ $(libgomp_plugin_host_nonshm_version_info) $(lt_host_flags) +libgomp_plugin_host_nonshm_la_LIBADD = libgomp.la libgomp_plugin_host_nonshm_la_LIBTOOLFLAGS = --tag=disable-static nodist_noinst_HEADERS = libgomp_f.h nodist_libsubinclude_HEADERS = omp.h openacc.h diff --git libgomp/plugin/Makefrag.am libgomp/plugin/Makefrag.am index d2c5428..167485f 100644 --- libgomp/plugin/Makefrag.am +++ libgomp/plugin/Makefrag.am @@ -35,7 +35,7 @@ libgomp_plugin_nvptx_la_CPPFLAGS = $(AM_CPPFLAGS) $(PLUGIN_NVPTX_CPPFLAGS) libgomp_plugin_nvptx_la_LDFLAGS = $(libgomp_plugin_nvptx_version_info) \ $(lt_host_flags) libgomp_plugin_nvptx_la_LDFLAGS += $(PLUGIN_NVPTX_LDFLAGS) -libgomp_plugin_nvptx_la_LIBADD = $(PLUGIN_NVPTX_LIBS) +libgomp_plugin_nvptx_la_LIBADD = libgomp.la $(PLUGIN_NVPTX_LIBS) libgomp_plugin_nvptx_la_LIBTOOLFLAGS = --tag=disable-static endif @@ -45,4 +45,5 @@ libgomp_plugin_host_nonshm_la_SOURCES = plugin/plugin-host.c libgomp_plugin_host_nonshm_la_CPPFLAGS = $(AM_CPPFLAGS) -DHOST_NONSHM_PLUGIN libgomp_plugin_host_nonshm_la_LDFLAGS = \ $(libgomp_plugin_host_nonshm_version_info) $(lt_host_flags) +libgomp_plugin_host_nonshm_la_LIBADD = libgomp.la libgomp_plugin_host_nonshm_la_LIBTOOLFLAGS = --tag=disable-static diff --git libgomp/plugin/plugin-host.c libgomp/plugin/plugin-host.c index acf9efd..7437407 100644 --- libgomp/plugin/plugin-host.c +++ libgomp/plugin/plugin-host.c @@ -32,11 +32,11 @@ #include "openacc.h" #include "config.h" -#include "libgomp.h" #ifdef HOST_NONSHM_PLUGIN #include "libgomp-plugin.h" #include "oacc-plugin.h" #else +#include "libgomp.h" #include "oacc-int.h" #endif diff --git libgomp/plugin/plugin-nvptx.c libgomp/plugin/plugin-nvptx.c index 4f0dc9a..ee0c818 100644 --- libgomp/plugin/plugin-nvptx.c +++ libgomp/plugin/plugin-nvptx.c @@ -33,13 +33,13 @@ #include "openacc.h" #include "config.h" -#include "libgomp.h" #include "libgomp-plugin.h" #include "oacc-ptx.h" #include "oacc-plugin.h" #include #include +#include #include #include #include