From patchwork Mon Aug 3 11:15:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 503115 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 80974140E1E for ; Mon, 3 Aug 2015 21:16:22 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=KJJ6Pjxz; dkim-atps=neutral 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=skYderWuLrjCmc0K Gnrwi69pU8guPFN6lg3/A6GIWHUX+lFm4c5anxTJ8qnCmD7QR0goJ2xIlWArmzv4 wK4V5s+Jz8Fhlv+llIPTYnnuNIt9X0ba/sMytWPMHjERwQinpUTfQzB/wO4xdWeX 7zyGi9P5LSs8h5EAwSRZ3rhwidE= 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=o7hbRyWj0jkzTpzCIMq1JE GFmBE=; b=KJJ6PjxznaEyBGBgjMvgt1HykdY1/j/65lwfRyscBmVTGGbVhd6gSS oYl4lZ3hOdcAlu3HV2wwYoguJVapjB0wqE3jMJtSotz0IK+f1mkX38Bz8W0NJFwN 9FbEMBnfjYeufWINYGkcK3zAHDI6h+AytGxO0EFivyJQwXgcBfBek= Received: (qmail 73193 invoked by alias); 3 Aug 2015 11:16:14 -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 73184 invoked by uid 89); 3 Aug 2015 11:16:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL, BAYES_05, RCVD_IN_DNSWL_LOW, 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, 03 Aug 2015 11:16:03 +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 1ZMDio-0001Lc-Ov from Thomas_Schwinge@mentor.com ; Mon, 03 Aug 2015 04:15:59 -0700 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, 3 Aug 2015 12:15:57 +0100 From: Thomas Schwinge To: Nathan Sidwell , GCC Patches CC: , Jakub Jelinek Subject: Re: offload data version number In-Reply-To: <55BD6261.9040008@acm.org> References: <55AE483D.9050702@acm.org> <55AE637A.8040504@acm.org> <55B23E54.4070504@acm.org> <20150724163016.GT1780@tucnak.redhat.com> <55B26ABE.5000804@acm.org> <55B2916E.5040705@acm.org> <55BB6728.7030607@acm.org> <55BB6BD9.7050305@acm.org> <20150731161011.GE1780@tucnak.redhat.com> <55BD5F0F.6040801@acm.org> <55BD6261.9040008@acm.org> User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) Date: Mon, 3 Aug 2015 13:15:51 +0200 Message-ID: <878u9soc60.fsf@kepler.schwinge.homeip.net> MIME-Version: 1.0 Hi! On Sat, 1 Aug 2015 20:20:49 -0400, Nathan Sidwell wrote: > this is the gomp4 committed version. > --- liboffloadmic/plugin/libgomp-plugin-intelmic.cpp (revision 226462) > +++ liboffloadmic/plugin/libgomp-plugin-intelmic.cpp (working copy) > @@ -327,12 +327,26 @@ offload_image (const void *target_image) > free (image); > } > > +/* Return the libgomp version number we're compatible with. There is > + no requirement for cross-version compatibility. */ > + > +extern "C" unsigned > +GOMP_OFFLOAD_version (void) > +{ > + return GOMP_VERSION; > +} > + > extern "C" int > -GOMP_OFFLOAD_load_image (int device, const void *target_image, > - addr_pair **result) > +GOMP_OFFLOAD_load_image (int device, const unsigned version, > + void *target_image, addr_pair **result) > { > TRACE ("(device = %d, target_image = %p)", device, target_image); > > + if (GOMP_VERSION_DEV (version) > GOMP_VERSION_INTEL_MIC) > + GOMP_PLUGIN_fatal ("Offload data incompatible with intelmic plugin" > + " (expected %u, received %u)", > + GOMP_VERSION_INTEL_MIC, GOMP_VERSION_DEV (version)); > + > /* If target_image is already present in address_table, then there is no need > to offload it. */ > if (address_table->count (target_image) == 0) > @@ -353,8 +367,12 @@ GOMP_OFFLOAD_load_image (int device, con > } > > extern "C" void > -GOMP_OFFLOAD_unload_image (int device, const void *target_image) > +GOMP_OFFLOAD_unload_image (int device, unsigned version, > + const void *target_image) > { > + if (GOMP_VERSION_DEV (version) > GOMP_VERSION_INTEL_MIC) > + return; > + > TRACE ("(device = %d, target_image = %p)", device, target_image); > > /* TODO: Currently liboffloadmic doesn't support __offload_unregister_image Committed to gomp-4_0-branch in r226497: commit 4e0158f41a00d6c4d09ca8a48eb63832abdd2f84 Author: tschwinge Date: Mon Aug 3 11:14:24 2015 +0000 Fix intelmic libgomp plugin build ... which got broken in r226469: [...]/source-gcc/liboffloadmic/plugin/libgomp-plugin-intelmic.cpp: In function 'unsigned int GOMP_OFFLOAD_version()': [...]/source-gcc/liboffloadmic/plugin/libgomp-plugin-intelmic.cpp:336:10: error: 'GOMP_VERSION' was not declared in this scope return GOMP_VERSION; ^ [...]/source-gcc/liboffloadmic/plugin/libgomp-plugin-intelmic.cpp: In function 'int GOMP_OFFLOAD_load_image(int, unsigned int, void*, addr_pair**)': [...]/source-gcc/liboffloadmic/plugin/libgomp-plugin-intelmic.cpp:345:32: error: 'GOMP_VERSION_DEV' was not declared in this scope if (GOMP_VERSION_DEV (version) > GOMP_VERSION_INTEL_MIC) ^ [...]/source-gcc/liboffloadmic/plugin/libgomp-plugin-intelmic.cpp:345:36: error: 'GOMP_VERSION_INTEL_MIC' was not declared in this scope if (GOMP_VERSION_DEV (version) > GOMP_VERSION_INTEL_MIC) ^ [...]/source-gcc/liboffloadmic/plugin/libgomp-plugin-intelmic.cpp: In function 'void GOMP_OFFLOAD_unload_image(int, unsigned int, const void*)': [...]/source-gcc/liboffloadmic/plugin/libgomp-plugin-intelmic.cpp:373:32: error: 'GOMP_VERSION_DEV' was not declared in this scope if (GOMP_VERSION_DEV (version) > GOMP_VERSION_INTEL_MIC) ^ [...]/source-gcc/liboffloadmic/plugin/libgomp-plugin-intelmic.cpp:373:36: error: 'GOMP_VERSION_INTEL_MIC' was not declared in this scope if (GOMP_VERSION_DEV (version) > GOMP_VERSION_INTEL_MIC) ^ make[6]: *** [libgomp_plugin_intelmic_la-libgomp-plugin-intelmic.lo] Error 1 liboffloadmic/ * plugin/Makefile.am (include_src_dir): Set. [PLUGIN_HOST] (libgomp_plugin_intelmic_la_CPPFLAGS): Use it. * plugin/Makefile.in: Regenerate. * plugin/libgomp-plugin-intelmic.cpp: Include "gomp-constants.h". git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@226497 138bc75d-0d04-0410-961f-82ee72b054a4 --- liboffloadmic/ChangeLog.gomp | 7 +++++++ liboffloadmic/plugin/Makefile.am | 3 ++- liboffloadmic/plugin/Makefile.in | 3 ++- liboffloadmic/plugin/libgomp-plugin-intelmic.cpp | 3 ++- 4 files changed, 13 insertions(+), 3 deletions(-) Grüße, Thomas diff --git liboffloadmic/ChangeLog.gomp liboffloadmic/ChangeLog.gomp index 93d1e02..adb9e05 100644 --- liboffloadmic/ChangeLog.gomp +++ liboffloadmic/ChangeLog.gomp @@ -1,3 +1,10 @@ +2015-08-03 Thomas Schwinge + + * plugin/Makefile.am (include_src_dir): Set. + [PLUGIN_HOST] (libgomp_plugin_intelmic_la_CPPFLAGS): Use it. + * plugin/Makefile.in: Regenerate. + * plugin/libgomp-plugin-intelmic.cpp: Include "gomp-constants.h". + 2015-08-01 Nathan Sidwell * plugin/libgomp-plugin-intelmic.cpp (GOMP_OFFLOAD_version): New. diff --git liboffloadmic/plugin/Makefile.am liboffloadmic/plugin/Makefile.am index 19d69ab..6ec444c 100644 --- liboffloadmic/plugin/Makefile.am +++ liboffloadmic/plugin/Makefile.am @@ -36,6 +36,7 @@ build_dir = $(top_builddir) source_dir = $(top_srcdir) coi_inc_dir = $(top_srcdir)/../include/coi myo_inc_dir = $(top_srcdir)/../include/myo +include_src_dir = $(top_srcdir)/../../include libgomp_src_dir = $(top_srcdir)/../../libgomp libgomp_dir = $(build_dir)/../../libgomp liboffload_src_dir = $(top_srcdir)/../runtime @@ -52,7 +53,7 @@ target_install_dir = $(accel_search_dir)/lib/gcc/$(accel_target)/$(gcc_version)$ if PLUGIN_HOST toolexeclib_LTLIBRARIES = libgomp-plugin-intelmic.la libgomp_plugin_intelmic_la_SOURCES = libgomp-plugin-intelmic.cpp - libgomp_plugin_intelmic_la_CPPFLAGS = $(CPPFLAGS) -DLINUX -DCOI_LIBRARY_VERSION=2 -DMYO_SUPPORT -DOFFLOAD_DEBUG=1 -DSEP_SUPPORT -DTIMING_SUPPORT -DHOST_LIBRARY=1 -I$(coi_inc_dir) -I$(myo_inc_dir) -I$(liboffload_src_dir) -I$(libgomp_src_dir) -I$(libgomp_dir) -I$(target_prefix_dir)/include -I$(target_build_dir) -I$(target_install_dir)/include + libgomp_plugin_intelmic_la_CPPFLAGS = $(CPPFLAGS) -DLINUX -DCOI_LIBRARY_VERSION=2 -DMYO_SUPPORT -DOFFLOAD_DEBUG=1 -DSEP_SUPPORT -DTIMING_SUPPORT -DHOST_LIBRARY=1 -I$(coi_inc_dir) -I$(myo_inc_dir) -I$(liboffload_src_dir) -I$(libgomp_src_dir) -I$(libgomp_dir) -I$(include_src_dir) -I$(target_prefix_dir)/include -I$(target_build_dir) -I$(target_install_dir)/include libgomp_plugin_intelmic_la_LDFLAGS = -L$(liboffload_dir)/.libs -loffloadmic_host -version-info 1:0:0 else # PLUGIN_TARGET plugin_includedir = $(libsubincludedir) diff --git liboffloadmic/plugin/Makefile.in liboffloadmic/plugin/Makefile.in index 19a1a96..458c9b2 100644 --- liboffloadmic/plugin/Makefile.in +++ liboffloadmic/plugin/Makefile.in @@ -306,6 +306,7 @@ build_dir = $(top_builddir) source_dir = $(top_srcdir) coi_inc_dir = $(top_srcdir)/../include/coi myo_inc_dir = $(top_srcdir)/../include/myo +include_src_dir = $(top_srcdir)/../../include libgomp_src_dir = $(top_srcdir)/../../libgomp libgomp_dir = $(build_dir)/../../libgomp liboffload_src_dir = $(top_srcdir)/../runtime @@ -320,7 +321,7 @@ target_build_dir = $(accel_search_dir)/$(accel_target)$(MULTISUBDIR)/liboffloadm target_install_dir = $(accel_search_dir)/lib/gcc/$(accel_target)/$(gcc_version)$(MULTISUBDIR) @PLUGIN_HOST_TRUE@toolexeclib_LTLIBRARIES = libgomp-plugin-intelmic.la @PLUGIN_HOST_TRUE@libgomp_plugin_intelmic_la_SOURCES = libgomp-plugin-intelmic.cpp -@PLUGIN_HOST_TRUE@libgomp_plugin_intelmic_la_CPPFLAGS = $(CPPFLAGS) -DLINUX -DCOI_LIBRARY_VERSION=2 -DMYO_SUPPORT -DOFFLOAD_DEBUG=1 -DSEP_SUPPORT -DTIMING_SUPPORT -DHOST_LIBRARY=1 -I$(coi_inc_dir) -I$(myo_inc_dir) -I$(liboffload_src_dir) -I$(libgomp_src_dir) -I$(libgomp_dir) -I$(target_prefix_dir)/include -I$(target_build_dir) -I$(target_install_dir)/include +@PLUGIN_HOST_TRUE@libgomp_plugin_intelmic_la_CPPFLAGS = $(CPPFLAGS) -DLINUX -DCOI_LIBRARY_VERSION=2 -DMYO_SUPPORT -DOFFLOAD_DEBUG=1 -DSEP_SUPPORT -DTIMING_SUPPORT -DHOST_LIBRARY=1 -I$(coi_inc_dir) -I$(myo_inc_dir) -I$(liboffload_src_dir) -I$(libgomp_src_dir) -I$(libgomp_dir) -I$(include_src_dir) -I$(target_prefix_dir)/include -I$(target_build_dir) -I$(target_install_dir)/include @PLUGIN_HOST_TRUE@libgomp_plugin_intelmic_la_LDFLAGS = -L$(liboffload_dir)/.libs -loffloadmic_host -version-info 1:0:0 @PLUGIN_HOST_FALSE@plugin_includedir = $(libsubincludedir) @PLUGIN_HOST_FALSE@plugin_include_HEADERS = main_target_image.h diff --git liboffloadmic/plugin/libgomp-plugin-intelmic.cpp liboffloadmic/plugin/libgomp-plugin-intelmic.cpp index b852b42..fde7d9e 100644 --- liboffloadmic/plugin/libgomp-plugin-intelmic.cpp +++ liboffloadmic/plugin/libgomp-plugin-intelmic.cpp @@ -1,6 +1,6 @@ /* Plugin for offload execution on Intel MIC devices. - Copyright (C) 2014 Free Software Foundation, Inc. + Copyright (C) 2014-2015 Free Software Foundation, Inc. Contributed by Ilya Verbin . @@ -38,6 +38,7 @@ #include "libgomp-plugin.h" #include "compiler_if_host.h" #include "main_target_image.h" +#include "gomp-constants.h" #define LD_LIBRARY_PATH_ENV "LD_LIBRARY_PATH" #define MIC_LD_LIBRARY_PATH_ENV "MIC_LD_LIBRARY_PATH"