Re: [gomp4] Move libgomp plugins into subdirectory

2014-11-11 Thread Thomas Schwinge
Hi!

On Wed, 5 Nov 2014 17:57:10 +, Julian Brown jul...@codesourcery.com wrote:
 This patch moves plugin-nvptx.c [...]
 into a new plugin subdirectory, [...]

The move aspect got lost in the commit; now made up for in r217371 on
gomp-4_0-branch:

commit 5296af1a8fa4a53505a74260397cd71ef4cfa45b
Author: tschwinge tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4
Date:   Tue Nov 11 21:22:15 2014 +

libgomp: Really remove file.

libgomp/
* plugin-nvptx.c: Remove.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@217371 
138bc75d-0d04-0410-961f-82ee72b054a4
---
 libgomp/ChangeLog.gomp |6 +-
 libgomp/plugin-nvptx.c | 1889 
 2 files changed, 5 insertions(+), 1890 deletions(-)

diff --git libgomp/ChangeLog.gomp libgomp/ChangeLog.gomp
index 7b91889..9f562d5 100644
--- libgomp/ChangeLog.gomp
+++ libgomp/ChangeLog.gomp
@@ -1,3 +1,7 @@
+2014-11-07  Thomas Schwinge  tho...@codesourcery.com
+
+   * plugin-nvptx.c: Remove.
+
 2014-11-07  Tom de Vries  t...@codesourcery.com
 
* testsuite/libgomp.oacc-c-c++-common/lib-66.c: Skip for shared memory
@@ -35,7 +39,7 @@
* oacc-host.c: Replace with #include of plugin/plugin-host.c code,
move implementation to the latter.
* plugin/plugin-host.c: New file.
-   * plugin-nvptx.c: Move to...
+   * plugin-nvptx.c: Copy to...
* plugin/plugin-nvptx.c: New file.
* plugin/Makefile.am: New.
* plugin/Makefile.in: Regenerate.
diff --git libgomp/plugin-nvptx.c libgomp/plugin-nvptx.c
deleted file mode 100644
index 828eefe..000
--- libgomp/plugin-nvptx.c
+++ /dev/null
@@ -1,1889 +0,0 @@
-/* Plugin for NVPTX execution.
-
-   Copyright (C) 2013-2014 Free Software Foundation, Inc.
-
-   Contributed by Mentor Embedded.
-
-   This file is part of the GNU OpenMP Library (libgomp).
-
-   Libgomp is free software; you can redistribute it and/or modify it
-   under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3, or (at your option)
-   any later version.
-
-   Libgomp is distributed in the hope that it will be useful, but WITHOUT ANY
-   WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-   FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
-   more details.
-
-   Under Section 7 of GPL version 3, you are granted additional
-   permissions described in the GCC Runtime Library Exception, version
-   3.1, as published by the Free Software Foundation.
-
-   You should have received a copy of the GNU General Public License and
-   a copy of the GCC Runtime Library Exception along with this program;
-   see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
-   http://www.gnu.org/licenses/.  */
-
-/* Nvidia PTX-specific parts of OpenACC support.  The cuda driver
-   library appears to hold some implicit state, but the documentation
-   is not clear as to what that state might be.  Or how one might
-   propagate it from one thread to another.  */
-
-#include openacc.h
-#include config.h
-#include libgomp.h
-#include target.h
-#include libgomp-plugin.h
-#include oacc-ptx.h
-#include oacc-plugin.h
-
-#include cuda.h
-#include stdint.h
-#include string.h
-#include stdio.h
-#include dlfcn.h
-#include unistd.h
-#include assert.h
-
-#defineARRAYSIZE(X) (sizeof (X) / sizeof ((X)[0]))
-
-static struct _errlist
-{
-  CUresult r;
-  char *m;
-} cuErrorList[] = {
-{ CUDA_ERROR_INVALID_VALUE, invalid value },
-{ CUDA_ERROR_OUT_OF_MEMORY, out of memory },
-{ CUDA_ERROR_NOT_INITIALIZED, not initialized },
-{ CUDA_ERROR_DEINITIALIZED, deinitialized },
-{ CUDA_ERROR_PROFILER_DISABLED, profiler disabled },
-{ CUDA_ERROR_PROFILER_NOT_INITIALIZED, profiler not initialized },
-{ CUDA_ERROR_PROFILER_ALREADY_STARTED, already started },
-{ CUDA_ERROR_PROFILER_ALREADY_STOPPED, already stopped },
-{ CUDA_ERROR_NO_DEVICE, no device },
-{ CUDA_ERROR_INVALID_DEVICE, invalid device },
-{ CUDA_ERROR_INVALID_IMAGE, invalid image },
-{ CUDA_ERROR_INVALID_CONTEXT, invalid context },
-{ CUDA_ERROR_CONTEXT_ALREADY_CURRENT, context already current },
-{ CUDA_ERROR_MAP_FAILED, map error },
-{ CUDA_ERROR_UNMAP_FAILED, unmap error },
-{ CUDA_ERROR_ARRAY_IS_MAPPED, array is mapped },
-{ CUDA_ERROR_ALREADY_MAPPED, already mapped },
-{ CUDA_ERROR_NO_BINARY_FOR_GPU, no binary for gpu },
-{ CUDA_ERROR_ALREADY_ACQUIRED, already acquired },
-{ CUDA_ERROR_NOT_MAPPED, not mapped },
-{ CUDA_ERROR_NOT_MAPPED_AS_ARRAY, not mapped as array },
-{ CUDA_ERROR_NOT_MAPPED_AS_POINTER, not mapped as pointer },
-{ CUDA_ERROR_ECC_UNCORRECTABLE, ecc uncorrectable },
-{ CUDA_ERROR_UNSUPPORTED_LIMIT, unsupported limit },
-{ CUDA_ERROR_CONTEXT_ALREADY_IN_USE, context already in use },
-{ CUDA_ERROR_PEER_ACCESS_UNSUPPORTED, peer access unsupported },
-{ 

Re: [gomp4] Move libgomp plugins into subdirectory

2014-11-06 Thread Thomas Schwinge
Hi Julian!

On Wed, 5 Nov 2014 17:57:10 +, Julian Brown jul...@codesourcery.com wrote:
 This patch moves plugin-nvptx.c and plugin-host.c (from oacc-host.c)
 into a new plugin subdirectory, as requested by Jakub, and to match
 more closely the layout of the Intel MIC pieces. This also moves the
 autotools bits to enable the NVPTX plugin and locate CUDA libraries
 into the plugin directory's (new) configury bits.

Hmm.  And then we cross-include files in libgomp/ from libgomp/plugin/
as well as the other way round (libgomp/oacc-host.c including
libgomp/plugin/plugin-host.c, for example) -- whilst these two regimes
are configured by two separate Autoconf instances?  Is this really the
intended scheme, or should we maybe rather have a top-level libgomp
Autoconf/Automake system (as before), which is amended by
libgomp/plugin/configfrag.ac and libgomp/plugin/Makefrag.am files that
are included from libgomp/configure.ac and libgomp/Makefile.am?

 Test results look reasonable with my (patched for PTX support) version
 of the gomp4 branch. I'll apply it there shortly.

Mid-air collision with my yesterday's libgomp changes -- with your patch
in (r217162), gomp-4_0-branch doesn't even build; the files added/moved
to libgomp/plugins/ are missing some of my changes.  (I didn't
look/compare in more detail.)

 libgomp/
 * Makefile.am (SUBDIRS): Add plugin.
 (DIST_SUBDIRS): Define.
 (libgomp_plugin_nvptx_*): Remove nvptx support from here.
 (libgomp_plugin_host_nonshm_*): Likewise.
 * Makefile.in: Regenerate.
 * configure: Regenerate.
 * oacc-host.c: Replace with #include of plugin/plugin-host.c code,
 move implementation to the latter.
 * plugin/plugin-host.c: New file.
 * plugin-nvptx.c: Move to...
 * plugin/plugin-nvptx.c: New file.
 * plugin/Makefile.am: New.
 * plugin/Makefile.in: Regenerate.
 * plugin/aclocal.m4: Regenerate.
 * plugin/configure: Regenerate.

Please check in the regenerated libgomp/config.h.in, update
contrib/gcc_update, and make generation of
libgomp/testsuite/libgomp-test-support.exp work again, that is,
substitution of @CUDA_DRIVER_INCLUDE@ and @CUDA_DRIVER_LIB@ (perhaps move
instantiation from libgomp/configure.ac to libgomp/plugin/configure.ac).


Grüße,
 Thomas


signature.asc
Description: PGP signature


Re: [gomp4] Move libgomp plugins into subdirectory

2014-11-06 Thread Julian Brown
On Thu, 6 Nov 2014 10:06:00 +0100
Thomas Schwinge tho...@codesourcery.com wrote:

 Hi Julian!
 
 On Wed, 5 Nov 2014 17:57:10 +, Julian Brown
 jul...@codesourcery.com wrote:
  This patch moves plugin-nvptx.c and plugin-host.c (from oacc-host.c)
  into a new plugin subdirectory, as requested by Jakub, and to
  match more closely the layout of the Intel MIC pieces. This also
  moves the autotools bits to enable the NVPTX plugin and locate CUDA
  libraries into the plugin directory's (new) configury bits.
 
 Hmm.  And then we cross-include files in libgomp/ from
 libgomp/plugin/ as well as the other way round (libgomp/oacc-host.c
 including libgomp/plugin/plugin-host.c, for example) -- whilst these
 two regimes are configured by two separate Autoconf instances?  Is
 this really the intended scheme, or should we maybe rather have a
 top-level libgomp Autoconf/Automake system (as before), which is
 amended by libgomp/plugin/configfrag.ac and
 libgomp/plugin/Makefrag.am files that are included from
 libgomp/configure.ac and libgomp/Makefile.am?

I don't know -- I was trying to follow existing practice (or how I
imagine that to be) with regard to recursive autotools invocations
(e.g. libjava/libltdl), and I have some FUD, probably misplaced, about
how well non-recursive autotools works.

A couple of the header files (oacc-plugin.h, libgomp-plugin.h) might be
better placed within the plugin directory, but plugins will generally
still need to include some headers direct from libgomp/. Maybe this
reorg is just a bad idea?

  Test results look reasonable with my (patched for PTX support)
  version of the gomp4 branch. I'll apply it there shortly.
 
 Mid-air collision with my yesterday's libgomp changes -- with your
 patch in (r217162), gomp-4_0-branch doesn't even build; the files
 added/moved to libgomp/plugins/ are missing some of my changes.  (I
 didn't look/compare in more detail.)

Apologies, I thought I'd fixed those up, but it looks like I missed a
bit.

  libgomp/
  * Makefile.am (SUBDIRS): Add plugin.
  (DIST_SUBDIRS): Define.
  (libgomp_plugin_nvptx_*): Remove nvptx support from here.
  (libgomp_plugin_host_nonshm_*): Likewise.
  * Makefile.in: Regenerate.
  * configure: Regenerate.
  * oacc-host.c: Replace with #include of plugin/plugin-host.c
  code, move implementation to the latter.
  * plugin/plugin-host.c: New file.
  * plugin-nvptx.c: Move to...
  * plugin/plugin-nvptx.c: New file.
  * plugin/Makefile.am: New.
  * plugin/Makefile.in: Regenerate.
  * plugin/aclocal.m4: Regenerate.
  * plugin/configure: Regenerate.
 
 Please check in the regenerated libgomp/config.h.in, update
 contrib/gcc_update, and make generation of
 libgomp/testsuite/libgomp-test-support.exp work again, that is,
 substitution of @CUDA_DRIVER_INCLUDE@ and @CUDA_DRIVER_LIB@ (perhaps
 move instantiation from libgomp/configure.ac to
 libgomp/plugin/configure.ac).

I'll fix this.

Thanks,

Julian


Re: [gomp4] Move libgomp plugins into subdirectory

2014-11-06 Thread Jakub Jelinek
On Thu, Nov 06, 2014 at 10:06:00AM +0100, Thomas Schwinge wrote:
 Hi Julian!
 
 On Wed, 5 Nov 2014 17:57:10 +, Julian Brown jul...@codesourcery.com 
 wrote:
  This patch moves plugin-nvptx.c and plugin-host.c (from oacc-host.c)
  into a new plugin subdirectory, as requested by Jakub, and to match
  more closely the layout of the Intel MIC pieces. This also moves the
  autotools bits to enable the NVPTX plugin and locate CUDA libraries
  into the plugin directory's (new) configury bits.
 
 Hmm.  And then we cross-include files in libgomp/ from libgomp/plugin/
 as well as the other way round (libgomp/oacc-host.c including
 libgomp/plugin/plugin-host.c, for example) -- whilst these two regimes
 are configured by two separate Autoconf instances?  Is this really the
 intended scheme, or should we maybe rather have a top-level libgomp
 Autoconf/Automake system (as before), which is amended by
 libgomp/plugin/configfrag.ac and libgomp/plugin/Makefrag.am files that
 are included from libgomp/configure.ac and libgomp/Makefile.am?

I agree a plugin fragment into libgomp/configure.ac and/or
libgomp/Makefile* is better.

Jakub


Re: [gomp4] Move libgomp plugins into subdirectory

2014-11-06 Thread Julian Brown
On Thu, 6 Nov 2014 11:11:42 +0100
Jakub Jelinek ja...@redhat.com wrote:

 On Thu, Nov 06, 2014 at 10:06:00AM +0100, Thomas Schwinge wrote:
  Hi Julian!
  
  On Wed, 5 Nov 2014 17:57:10 +, Julian Brown
  jul...@codesourcery.com wrote:
   This patch moves plugin-nvptx.c and plugin-host.c (from
   oacc-host.c) into a new plugin subdirectory, as requested by
   Jakub, and to match more closely the layout of the Intel MIC
   pieces. This also moves the autotools bits to enable the NVPTX
   plugin and locate CUDA libraries into the plugin directory's
   (new) configury bits.
  
  Hmm.  And then we cross-include files in libgomp/ from
  libgomp/plugin/ as well as the other way round (libgomp/oacc-host.c
  including libgomp/plugin/plugin-host.c, for example) -- whilst
  these two regimes are configured by two separate Autoconf
  instances?  Is this really the intended scheme, or should we maybe
  rather have a top-level libgomp Autoconf/Automake system (as
  before), which is amended by libgomp/plugin/configfrag.ac and
  libgomp/plugin/Makefrag.am files that are included from
  libgomp/configure.ac and libgomp/Makefile.am?

I'll apply the attached fixes for now in case anyone's blocked on the
broken libgomp build, and then...

 I agree a plugin fragment into libgomp/configure.ac and/or
 libgomp/Makefile* is better.

work on refactoring those configury bits (which will revert some of the
attached, including moving libgomp-test-support.exp.in back to its
previous location, but never mind).

Thanks,

Julian

ChangeLog

* contrib/gcc_update (libgomp/plugin/aclocal.m4)
(libgomp/plugin/Makefile.in, libgomp/plugin/configure)
(libgomp/plugin/config.h.in): Add.

libgomp/
* oacc-init.c (resolve_device, _acc_init): Fix init_device_func
hook naming.
* plugin/plugin-host.c (GOMP_OFFLOAD_openacc_avail): Remove.
(host_dispatch): Don't set avail_func hook.
* plugin/configure.ac (libgomp-test-support.exp): Add to
AC_CONFIG_FILES.
* plugin/configure: Regenerate.
* testsuite/libgomp-test-support.exp.in: Move from here...
* plugin/libgomp-test-support.exp.in: ...to here.
* plugin/Makefile.in: Regenerate.
* testsuite/lib/libgomp.exp (libgomp-test-support.exp): Find in
plugin dir, for now.
* testsuite/Makefile.in: Regenerate.
* configure.ac (testsuite/libgomp-test-support.exp): Remove from
AC_CONFIG_FILES.
* config.h.in: Regenerate.
* configure: Regenerate.
Index: libgomp/oacc-init.c
===
--- libgomp/oacc-init.c	(revision 217192)
+++ libgomp/oacc-init.c	(working copy)
@@ -97,7 +97,7 @@ resolve_device (acc_device_t d)
 	while (++d != _ACC_device_hwm)
 	  if (dispatchers[d]
 		   !strcasecmp (goacc_device_type, dispatchers[d]-name)
-		   dispatchers[d]-device_init_func ()  0)
+		   dispatchers[d]-init_device_func ()  0)
 		goto found;
 
 	gomp_fatal (device type %s not supported, goacc_device_type);
@@ -112,7 +112,7 @@ resolve_device (acc_device_t d)
 case acc_device_not_host:
   /* Find the first available device after acc_device_not_host.  */
   while (++d != _ACC_device_hwm)
-	if (dispatchers[d]  dispatchers[d]-device_init_func ()  0)
+	if (dispatchers[d]  dispatchers[d]-init_device_func ()  0)
 	  goto found;
   if (d_arg == acc_device_default)
 	{	  
@@ -140,7 +140,7 @@ resolve_device (acc_device_t d)
 }
 
 /* This is called when plugins have been initialized, and serves to call
-   (indirectly) the target's device_init hook.  Calling multiple times without
+   (indirectly) the target's init_device hook.  Calling multiple times without
an intervening _acc_shutdown call is an error.  */
 
 static struct gomp_device_descr const *
@@ -150,7 +150,7 @@ _acc_init (acc_device_t d)
 
   acc_dev = resolve_device (d);
 
-  if (!acc_dev || acc_dev-device_init_func () = 0)
+  if (!acc_dev || acc_dev-init_device_func () = 0)
 gomp_fatal (device %u not supported, (unsigned)d);
 
   if (acc_dev-is_initialized)
Index: libgomp/plugin/plugin-host.c
===
--- libgomp/plugin/plugin-host.c	(revision 217192)
+++ libgomp/plugin/plugin-host.c	(working copy)
@@ -153,16 +153,6 @@ GOMP_OFFLOAD_get_table (struct mapping_t
   return 0;
 }
 
-STATIC bool
-GOMP_OFFLOAD_openacc_avail (void)
-{
-#ifdef DEBUG
-  fprintf (stderr, SELF %s:%s\n, __FILE__, __FUNCTION__);
-#endif
-
-  return 1;
-}
-
 STATIC void *
 GOMP_OFFLOAD_openacc_open_device (int n)
 {
@@ -415,9 +405,6 @@ static struct gomp_device_descr host_dis
   .get_device_num_func = GOMP_OFFLOAD_openacc_get_device_num,
   .set_device_num_func = GOMP_OFFLOAD_openacc_set_device_num,
 
-  /* Device available.  */
-  .avail_func = GOMP_OFFLOAD_openacc_avail,
-
   .exec_func = GOMP_OFFLOAD_openacc_parallel,
 
   .register_async_cleanup_func
Index: libgomp/plugin/configure.ac
===
--- 

Re: [gomp4] Move libgomp plugins into subdirectory

2014-11-06 Thread Julian Brown
On Thu, 6 Nov 2014 15:37:42 +
Julian Brown jul...@codesourcery.com wrote:

 On Thu, 6 Nov 2014 11:11:42 +0100
 Jakub Jelinek ja...@redhat.com wrote:
 
  On Thu, Nov 06, 2014 at 10:06:00AM +0100, Thomas Schwinge wrote:
   Hmm.  And then we cross-include files in libgomp/ from
   libgomp/plugin/ as well as the other way round
   (libgomp/oacc-host.c including libgomp/plugin/plugin-host.c, for
   example) -- whilst these two regimes are configured by two
   separate Autoconf instances?  Is this really the intended scheme,
   or should we maybe rather have a top-level libgomp
   Autoconf/Automake system (as before), which is amended by
   libgomp/plugin/configfrag.ac and libgomp/plugin/Makefrag.am files
   that are included from libgomp/configure.ac and
   libgomp/Makefile.am?

  I agree a plugin fragment into libgomp/configure.ac and/or
  libgomp/Makefile* is better.
 
 [...] work on refactoring those configury bits (which will revert some
 of the attached, including moving libgomp-test-support.exp.in back to
 its previous location, but never mind).

Does this look like what you had in mind? (I think liboffloadmic uses a
similar recursive autotools invocation for its libgomp plugin -- maybe
that wants refactoring too?).

Thanks,

Julian

ChangeLog

* contrib/gcc_update (libgomp/aclocal.m4, libgomp/Makefile.in)
(libgomp/configure, libgomp/config.h.in): Add depends for plugin
config fragments.
(libgomp/plugin/aclocal.m4, libgomp/plugin/Makefile.in)
(libgomp/plugin/configure, libgomp/plugin/config.h.in): Remove.

libgomp/
* Makefile.am (SUBDIRS): Remove plugin subdir.
(DIST_SUBDIRS): Delete.
(search_path): Add ($top_srcdir)/../include.
(AM_CPPFLAGS): Remove -I$(top_srcdir)/../include.
(plugin/Makefrag.in): Include.
* Makefile.in: Regenerate.
* configure.ac (plugin): Remove from AC_CONFIG_SUBDIRS.
(plugin/configfrag.ac): Include.
(testsuite/libgomp-test-support.exp): Add to AC_CONFIG_FILES.
* configure: Regenerate.
* plugin/Makefile.am: Remove, refactor into...
* plugin/Makefrag.am: ...this. New.
* plugin/aclocal.m4: Remove.
* plugin/config.h.in: Remove.
* plugin/configure: Remove.
* plugin/configure.ac: Remove, refactor into...
* plugin/configfrag.ac: ...this. New.
* plugin/libgomp-test-support-exp.in: Move back to...
* testsuite/libgomp-test-support-exp.in: Here.
* testsuite/lib/libgomp.exp (libgomp-test-support.exp): Include
from current directory, not plugin dir.commit ea1335fc5a4aed75ad0f299969520f10e2f27435
Author: Julian Brown jul...@codesourcery.com
Date:   Thu Nov 6 11:54:25 2014 -0800

Don't use recursive autoconf/automake for libgomp plugins

diff --git a/contrib/gcc_update b/contrib/gcc_update
index a50dc8c..2903d7a 100755
--- a/contrib/gcc_update
+++ b/contrib/gcc_update
@@ -138,15 +138,11 @@ libjava/libltdl/config-h.in: libjava/libltdl/configure.ac libjava/libltdl/acloca
 libcpp/aclocal.m4: libcpp/configure.ac
 libcpp/Makefile.in: libcpp/configure.ac libcpp/aclocal.m4
 libcpp/configure: libcpp/configure.ac libcpp/aclocal.m4
-libgomp/aclocal.m4: libgomp/configure.ac libgomp/acinclude.m4
-libgomp/Makefile.in: libgomp/Makefile.am libgomp/aclocal.m4
+libgomp/aclocal.m4: libgomp/configure.ac libgomp/acinclude.m4 libgomp/plugin/configfrag.ac
+libgomp/Makefile.in: libgomp/Makefile.am libgomp/aclocal.m4 libgomp/plugin/Makefrag.am
 libgomp/testsuite/Makefile.in: libgomp/testsuite/Makefile.am libgomp/aclocal.m4
-libgomp/configure: libgomp/configure.ac libgomp/aclocal.m4
-libgomp/config.h.in: libgomp/configure.ac libgomp/aclocal.m4
-libgomp/plugin/aclocal.m4: libgomp/plugin/configure.ac
-libgomp/plugin/Makefile.in: libgomp/plugin/Makefile.am libgomp/plugin/aclocal.m4
-libgomp/plugin/configure: libgomp/plugin/configure.ac libgomp/plugin/aclocal.m4
-libgomp/plugin/config.h.in: libgomp/plugin/configure.ac libgomp/plugin/aclocal.m4
+libgomp/configure: libgomp/configure.ac libgomp/aclocal.m4 libgomp/plugin/configfrag.ac
+libgomp/config.h.in: libgomp/configure.ac libgomp/aclocal.m4 libgomp/plugin/configfrag.ac
 libitm/aclocal.m4: libitm/configure.ac libitm/acinclude.m4
 libitm/Makefile.in: libitm/Makefile.am libitm/aclocal.m4
 libitm/testsuite/Makefile.in: libitm/testsuite/Makefile.am libitm/aclocal.m4
diff --git a/libgomp/Makefile.am b/libgomp/Makefile.am
index f265c5d..dc2f88a 100644
--- a/libgomp/Makefile.am
+++ b/libgomp/Makefile.am
@@ -1,21 +1,21 @@
 ## Process this file with automake to produce Makefile.in
 
 ACLOCAL_AMFLAGS = -I .. -I ../config
-SUBDIRS = testsuite plugin
-DIST_SUBDIRS = plugin
+SUBDIRS = testsuite
 
 ## May be used by toolexeclibdir.
 gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
 
 config_path = @config_path@
-search_path = $(addprefix $(top_srcdir)/config/, $(config_path)) $(top_srcdir)
+search_path = $(addprefix $(top_srcdir)/config/, $(config_path)) $(top_srcdir) \
+	  $(top_srcdir)/../include
 
 fincludedir = 

[gomp4] Move libgomp plugins into subdirectory

2014-11-05 Thread Julian Brown
Hi,

This patch moves plugin-nvptx.c and plugin-host.c (from oacc-host.c)
into a new plugin subdirectory, as requested by Jakub, and to match
more closely the layout of the Intel MIC pieces. This also moves the
autotools bits to enable the NVPTX plugin and locate CUDA libraries
into the plugin directory's (new) configury bits.

So far this only changes the location of the source files: the plugins
themselves are still installed to the same place as before (alongside
libgomp itself).

Test results look reasonable with my (patched for PTX support) version
of the gomp4 branch. I'll apply it there shortly.

Thanks,

Julian

ChangeLog

libgomp/
* Makefile.am (SUBDIRS): Add plugin.
(DIST_SUBDIRS): Define.
(libgomp_plugin_nvptx_*): Remove nvptx support from here.
(libgomp_plugin_host_nonshm_*): Likewise.
* Makefile.in: Regenerate.
* configure: Regenerate.
* oacc-host.c: Replace with #include of plugin/plugin-host.c code,
move implementation to the latter.
* plugin/plugin-host.c: New file.
* plugin-nvptx.c: Move to...
* plugin/plugin-nvptx.c: New file.
* plugin/Makefile.am: New.
* plugin/Makefile.in: Regenerate.
* plugin/aclocal.m4: Regenerate.
* plugin/configure: Regenerate.
commit 8994fb8c1b9d52cb9c82a61227a450df29e61806
Author: Julian Brown jul...@codesourcery.com
Date:   Wed Nov 5 02:54:30 2014 -0800

Move libgomp plugins into their own directory.

diff --git a/libgomp/Makefile.am b/libgomp/Makefile.am
index e0ab763..f265c5d 100644
--- a/libgomp/Makefile.am
+++ b/libgomp/Makefile.am
@@ -1,7 +1,8 @@
 ## Process this file with automake to produce Makefile.in
 
 ACLOCAL_AMFLAGS = -I .. -I ../config
-SUBDIRS = testsuite
+SUBDIRS = testsuite plugin
+DIST_SUBDIRS = plugin
 
 ## May be used by toolexeclibdir.
 gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
@@ -21,27 +22,6 @@ AM_LDFLAGS = $(XLDFLAGS) $(SECTION_LDFLAGS) $(OPT_LDFLAGS)
 toolexeclib_LTLIBRARIES = libgomp.la
 nodist_toolexeclib_HEADERS = libgomp.spec
 
-if PLUGIN_NVPTX
-# Nvidia PTX OpenACC plugin.
-libgomp_plugin_nvptx_version_info = -version-info $(libtool_VERSION)
-toolexeclib_LTLIBRARIES += libgomp-plugin-nvptx.la
-libgomp_plugin_nvptx_la_SOURCES = plugin-nvptx.c
-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_LIBTOOLFLAGS = --tag=disable-static
-endif
-
-libgomp_plugin_host_nonshm_version_info = -version-info $(libtool_VERSION)
-toolexeclib_LTLIBRARIES += libgomp-plugin-host_nonshm.la
-libgomp_plugin_host_nonshm_la_SOURCES = oacc-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_LIBTOOLFLAGS = --tag=disable-static
-
 if LIBGOMP_BUILD_VERSIONED_SHLIB
 # -Wc is only a libtool option.
 comma = ,
diff --git a/libgomp/Makefile.in b/libgomp/Makefile.in
index d12376e..ea3e1ca 100644
diff --git a/libgomp/configure b/libgomp/configure
index 7daccd9..11a7ae0 100755
diff --git a/libgomp/configure.ac b/libgomp/configure.ac
index 89c6b31..e883945 100644
--- a/libgomp/configure.ac
+++ b/libgomp/configure.ac
@@ -30,42 +30,6 @@ LIBGOMP_ENABLE(generated-files-in-srcdir, no, ,
 AC_MSG_RESULT($enable_generated_files_in_srcdir)
 AM_CONDITIONAL(GENINSRC, test $enable_generated_files_in_srcdir = yes)
 
-# Look for the CUDA driver package.
-CUDA_DRIVER_INCLUDE=
-CUDA_DRIVER_LIB=
-AC_SUBST(CUDA_DRIVER_INCLUDE)
-AC_SUBST(CUDA_DRIVER_LIB)
-CUDA_DRIVER_CPPFLAGS=
-CUDA_DRIVER_LDFLAGS=
-AC_ARG_WITH(cuda-driver,
-	[AS_HELP_STRING([--with-cuda-driver=PATH],
-		[specify prefix directory for installed CUDA driver package.
-		 Equivalent to --with-cuda-driver-include=PATH/include
-		 plus --with-cuda-driver-lib=PATH/lib])])
-AC_ARG_WITH(cuda-driver-include,
-	[AS_HELP_STRING([--with-cuda-driver-include=PATH],
-		[specify directory for installed CUDA driver include files])])
-AC_ARG_WITH(cuda-driver-lib,
-	[AS_HELP_STRING([--with-cuda-driver-lib=PATH],
-		[specify directory for the installed CUDA driver library])])
-if test x$with_cuda_driver != x; then
-  CUDA_DRIVER_INCLUDE=$with_cuda_driver/include
-  CUDA_DRIVER_LIB=$with_cuda_driver/lib
-fi
-if test x$with_cuda_driver_include != x; then
-  CUDA_DRIVER_INCLUDE=$with_cuda_driver_include
-fi
-if test x$with_cuda_driver_lib != x; then
-  CUDA_DRIVER_LIB=$with_cuda_driver_lib
-fi
-if test x$CUDA_DRIVER_INCLUDE != x; then
-  CUDA_DRIVER_CPPFLAGS=-I$CUDA_DRIVER_INCLUDE
-fi
-if test x$CUDA_DRIVER_LIB != x; then
-  CUDA_DRIVER_LDFLAGS=-L$CUDA_DRIVER_LIB
-fi
-
-
 # ---
 # ---
 
@@ -241,52 +205,7 @@ elif test x$enable_accelerator != xno; then
   AC_MSG_ERROR([Can't have support for accelerators without support for plugins])
 fi