From patchwork Thu Nov 6 15:37:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julian Brown X-Patchwork-Id: 407589 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 BBDA614008C for ; Fri, 7 Nov 2014 02:38:06 +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:date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type; q=dns; s=default; b=KUgq36E/ZAJU1LSn 4yXS/WmprncFJLUtiHPIXw8LO7QASnCf6K6Cb0pjvsBa4bsnxwIuZsrk61NvdH5o wmOuGsF5vWr9vgmRUT4bzYrXfNgzvYjhmHRR046l3wY1UUBhRV9uTpnpME/UlerA ohc4BCBPZjRmKoLdskzX1wAh0UE= 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:date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type; s=default; bh=5pmfFcDb32rvV8eg1LRgkc 0Iqfs=; b=osxEEgCSqwTWtJ17RSAfcLjjGbBIEANDA1JSE4ItFTAqgr1sRevmq8 d/FSc0sbuyTnwbC2rYIFecdySN7j+xA9iVaBXeYKHyvAQYyOmzkd1+dL/EzXnPzv YDkv0iZI5kB1AS69cWfGhrkfkHdxcpIsB68BYzol8X7XKCTz6Yzeo= Received: (qmail 26919 invoked by alias); 6 Nov 2014 15:37:59 -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 26904 invoked by uid 89); 6 Nov 2014 15:37:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE 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; Thu, 06 Nov 2014 15:37:56 +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 1XmP8C-0006k4-6V from Julian_Brown@mentor.com ; Thu, 06 Nov 2014 07:37:52 -0800 Received: from octopus (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.3.181.6; Thu, 6 Nov 2014 15:37:50 +0000 Date: Thu, 6 Nov 2014 15:37:42 +0000 From: Julian Brown To: Jakub Jelinek CC: Thomas Schwinge , Ilya Verbin , Subject: Re: [gomp4] Move libgomp plugins into subdirectory Message-ID: <20141106153742.5c4c6c09@octopus> In-Reply-To: <20141106101142.GL5026@tucnak.redhat.com> References: <20141105175710.41c2f552@octopus> <87ioishf5z.fsf@kepler.schwinge.homeip.net> <20141106101142.GL5026@tucnak.redhat.com> MIME-Version: 1.0 X-IsSubscribed: yes On Thu, 6 Nov 2014 11:11:42 +0100 Jakub Jelinek wrote: > On Thu, Nov 06, 2014 at 10:06:00AM +0100, Thomas Schwinge wrote: > > Hi Julian! > > > > On Wed, 5 Nov 2014 17:57:10 +0000, Julian Brown > > 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 =================================================================== --- libgomp/plugin/configure.ac (revision 217192) +++ libgomp/plugin/configure.ac (working copy) @@ -175,4 +175,5 @@ AC_DEFINE_UNQUOTED([PLUGIN_NVPTX], [$PLU AC_SUBST(config_path) AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([libgomp-test-support.exp]) AC_OUTPUT Index: libgomp/plugin/libgomp-test-support.exp.in =================================================================== --- libgomp/plugin/libgomp-test-support.exp.in (revision 0) +++ libgomp/plugin/libgomp-test-support.exp.in (working copy) @@ -0,0 +1,2 @@ +set cuda_driver_include "@CUDA_DRIVER_INCLUDE@" +set cuda_driver_lib "@CUDA_DRIVER_LIB@" Index: libgomp/plugin/configure =================================================================== --- libgomp/plugin/configure (revision 217192) +++ libgomp/plugin/configure (working copy) @@ -14221,6 +14221,8 @@ _ACEOF ac_config_files="$ac_config_files Makefile" +ac_config_files="$ac_config_files libgomp-test-support.exp" + cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -15303,6 +15305,7 @@ do "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "libgomp-test-support.exp") CONFIG_FILES="$CONFIG_FILES libgomp-test-support.exp" ;; *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac Index: libgomp/plugin/Makefile.in =================================================================== --- libgomp/plugin/Makefile.in (revision 217192) +++ libgomp/plugin/Makefile.in (working copy) @@ -67,7 +67,7 @@ subdir = . DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/configure $(am__configure_deps) \ $(srcdir)/config.h.in $(srcdir)/../../mkinstalldirs \ - $(srcdir)/../../depcomp + $(srcdir)/libgomp-test-support.exp.in $(srcdir)/../../depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \ $(top_srcdir)/../../config/lead-dot.m4 \ @@ -83,7 +83,7 @@ am__CONFIG_DISTCLEAN_FILES = config.stat configure.lineno config.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = +CONFIG_CLEAN_FILES = libgomp-test-support.exp CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ @@ -360,6 +360,8 @@ $(srcdir)/config.h.in: @MAINTAINER_MODE_ distclean-hdr: -rm -f config.h stamp-h1 +libgomp-test-support.exp: $(top_builddir)/config.status $(srcdir)/libgomp-test-support.exp.in + cd $(top_builddir) && $(SHELL) ./config.status $@ install-toolexeclibLTLIBRARIES: $(toolexeclib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(toolexeclibdir)" || $(MKDIR_P) "$(DESTDIR)$(toolexeclibdir)" Index: libgomp/testsuite/lib/libgomp.exp =================================================================== --- libgomp/testsuite/lib/libgomp.exp (revision 217192) +++ libgomp/testsuite/lib/libgomp.exp (working copy) @@ -32,7 +32,7 @@ load_gcc_lib torture-options.exp load_gcc_lib fortran-modules.exp # Try to load a test support file, built during libgomp configuration. -load_file libgomp-test-support.exp +load_file ../plugin/libgomp-test-support.exp set dg-do-what-default run Index: libgomp/testsuite/libgomp-test-support.exp.in =================================================================== --- libgomp/testsuite/libgomp-test-support.exp.in (revision 217192) +++ libgomp/testsuite/libgomp-test-support.exp.in (working copy) @@ -1,2 +0,0 @@ -set cuda_driver_include "@CUDA_DRIVER_INCLUDE@" -set cuda_driver_lib "@CUDA_DRIVER_LIB@" Index: libgomp/testsuite/Makefile.in =================================================================== --- libgomp/testsuite/Makefile.in (revision 217192) +++ libgomp/testsuite/Makefile.in (working copy) @@ -35,8 +35,7 @@ build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = testsuite -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(srcdir)/libgomp-test-support.exp.in +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../config/depstand.m4 \ @@ -55,7 +54,7 @@ am__configure_deps = $(am__aclocal_m4_de $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = libgomp-test-support.exp +CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DEJATOOL = $(PACKAGE) @@ -249,8 +248,6 @@ $(top_srcdir)/configure: @MAINTAINER_MOD $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): -libgomp-test-support.exp: $(top_builddir)/config.status $(srcdir)/libgomp-test-support.exp.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo Index: libgomp/config.h.in =================================================================== --- libgomp/config.h.in (revision 217192) +++ libgomp/config.h.in (working copy) @@ -110,9 +110,6 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION -/* Define to 1 if the NVIDIA plugin is built, 0 if not. */ -#undef PLUGIN_NVPTX - /* Define if all infrastructure, needed for plugins, is supported. */ #undef PLUGIN_SUPPORT Index: libgomp/configure =================================================================== --- libgomp/configure (revision 217192) +++ libgomp/configure (working copy) @@ -16341,8 +16341,6 @@ ac_config_files="$ac_config_files omp.h ac_config_files="$ac_config_files Makefile testsuite/Makefile" -ac_config_files="$ac_config_files testsuite/libgomp-test-support.exp" - ac_config_files="$ac_config_files libgomp.spec" cat >confcache <<\_ACEOF @@ -17484,7 +17482,6 @@ do "libgomp_f.h") CONFIG_FILES="$CONFIG_FILES libgomp_f.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "testsuite/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;; - "testsuite/libgomp-test-support.exp") CONFIG_FILES="$CONFIG_FILES testsuite/libgomp-test-support.exp" ;; "libgomp.spec") CONFIG_FILES="$CONFIG_FILES libgomp.spec" ;; *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; Index: libgomp/configure.ac =================================================================== --- libgomp/configure.ac (revision 217192) +++ libgomp/configure.ac (working copy) @@ -361,6 +361,5 @@ CFLAGS="$save_CFLAGS" AC_CONFIG_FILES(omp.h omp_lib.h omp_lib.f90 libgomp_f.h) AC_CONFIG_FILES(Makefile testsuite/Makefile) -AC_CONFIG_FILES(testsuite/libgomp-test-support.exp) AC_CONFIG_FILES(libgomp.spec) AC_OUTPUT Index: contrib/gcc_update =================================================================== --- contrib/gcc_update (revision 217192) +++ contrib/gcc_update (working copy) @@ -143,6 +143,10 @@ libgomp/Makefile.in: libgomp/Makefile.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 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