public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Thomas Schwinge <thomas@codesourcery.com>
To: <gcc-patches@gcc.gnu.org>
Cc: Julian Brown <julian@codesourcery.com>
Subject: Re: [PATCH 7/10] OpenACC 2.0 support for libgomp - OpenACC runtime, NVidia PTX/CUDA plugin
Date: Mon, 12 Jan 2015 15:07:00 -0000	[thread overview]
Message-ID: <87twzw120p.fsf@kepler.schwinge.homeip.net> (raw)
In-Reply-To: <874mrw2hfp.fsf@kepler.schwinge.homeip.net>

[-- Attachment #1: Type: text/plain, Size: 6847 bytes --]

Hi!

On Mon, 12 Jan 2015 15:37:46 +0100, I wrote:
> On Tue, 23 Sep 2014 19:19:31 +0100, Julian Brown <julian@codesourcery.com> 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 <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
> 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 <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
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 <stdbool.h>.
    	* 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(-)

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  <thomas@codesourcery.com>
 
+	* plugin/plugin-host.c [HOST_NONSHM_PLUGIN]: Don't include "libgomp.h".
+	* plugin/plugin-nvptx.c: Likewise.  Include <stdbool.h>.
+	* 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 <pthread.h>
 #include <cuda.h>
+#include <stdbool.h>
 #include <stdint.h>
 #include <string.h>
 #include <stdio.h>


Grüße,
 Thomas

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

  reply	other threads:[~2015-01-12 14:56 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-23 18:20 Julian Brown
2014-11-11 13:54 ` [PATCH 1/5] OpenACC 2.0 support for libgomp - OpenACC runtime, NVidia PTX/CUDA plugin (repost) Julian Brown
2014-11-12 10:10   ` Jakub Jelinek
2014-11-12 10:59     ` Thomas Schwinge
2014-11-12 21:11       ` Mike Stump
2014-11-12 11:06     ` Julian Brown
2014-11-12 11:15       ` Jakub Jelinek
2014-11-12 11:33     ` libgomp: "GNU OpenMP Runtime Library" (was: [PATCH 1/5] OpenACC 2.0 support for libgomp - OpenACC runtime, NVidia PTX/CUDA plugin (repost)) Thomas Schwinge
2014-11-12 11:49       ` Jakub Jelinek
2014-11-12 13:40         ` David Malcolm
2014-11-12 13:49           ` Jakub Jelinek
2014-11-12 20:30             ` David Malcolm
2014-11-12 20:41               ` Jakub Jelinek
2014-11-12 20:50                 ` David Malcolm
2015-01-11  2:18                   ` libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library (was: libgomp: "GNU OpenMP Runtime Library") Thomas Schwinge
2015-01-29 10:25                     ` Thomas Schwinge
2019-05-28 21:27                       ` libgomp: long known as the GNU Offloading and Multi Processing Runtime Library (was: libgomp: Now known as the GNU Offloading and Multi Processing Runtime Library (was: libgomp: "GNU OpenMP Runtime Library")) Thomas Schwinge
     [not found]     ` <20141113232615.4ff373bf@octopus>
2014-11-14 16:07       ` Fortran/C interfacing (was: [PATCH 1/5] OpenACC 2.0 support for libgomp - OpenACC runtime, NVidia PTX/CUDA plugin (repost)) Thomas Schwinge
2014-11-14 21:01         ` Fortran/C interfacing Tobias Burnus
2014-11-14 21:24           ` Jakub Jelinek
2014-11-14 16:38     ` GOMP_DEBUG environment variable? (was: [PATCH 1/5] OpenACC 2.0 support for libgomp - OpenACC runtime, NVidia PTX/CUDA plugin (repost)) Thomas Schwinge
2014-11-15  1:04     ` [PATCH 1/5] OpenACC 2.0 support for libgomp - OpenACC runtime, NVidia PTX/CUDA plugin (repost) Julian Brown
2014-11-19 19:58       ` Bernd Schmidt
2014-11-19 20:39         ` Cesar Philippidis
2014-12-22 17:55   ` Thomas Schwinge
2014-12-22 18:05   ` Thomas Schwinge
2014-12-22 18:12   ` Thomas Schwinge
2014-12-22 18:16   ` Thomas Schwinge
2014-12-22 18:55   ` Thomas Schwinge
2014-12-23  0:57   ` Thomas Schwinge
2014-12-22 16:41 ` [PATCH 7/10] OpenACC 2.0 support for libgomp - OpenACC runtime, NVidia PTX/CUDA plugin Thomas Schwinge
2015-01-12 14:49 ` Thomas Schwinge
2015-01-12 15:07   ` Thomas Schwinge [this message]
2015-01-12 15:00 ` Thomas Schwinge
2017-02-02 14:38 ` libgomp, nvptx plugin: Make "nvptx_exec" static (was: [PATCH 7/10] OpenACC 2.0 support for libgomp - OpenACC runtime, NVidia PTX/CUDA plugin) Thomas Schwinge
2022-05-12 11:32 ` libgomp plugins: Don't 'AC_SUBST' and 'AC_DEFINE_UNQUOTED' for 'PLUGIN_GCN', 'PLUGIN_NVPTX' " Thomas Schwinge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87twzw120p.fsf@kepler.schwinge.homeip.net \
    --to=thomas@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=julian@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).