This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 7/10] OpenACC 2.0 support for libgomp - OpenACC runtime, NVidia PTX/CUDA plugin


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: signature.asc
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]