From patchwork Fri Oct 2 19:29:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 525741 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 F0D431402F0 for ; Sat, 3 Oct 2015 05:29:41 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=U0aCY/UI; 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=OR5qR0GjBqsE/PjT HBD7JD+dVe6f5mr6CySZdWjHjMynekbS62rs1HIaWwy+jM45tn75YPmNa7kKwi6/ Fd9C1bLJ/xGZOVUkreO0AlptpgUHtbkmjqGAytm5oYQCe/E1SDAswoU9XeXioseC tFTJ02W8YbQfG9O+w6/Broqa89Y= 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=8fYaMPaU9n5NFVLsg5fg4J h1aAE=; b=U0aCY/UIxD89SEdZD0+tr9nollqYaXKAnpI5y09kctFLUGxerUfN+C BXL6FplVH4Sypp5BnFKqcFOwqv2E589r+vSVY8Klwmg1J2t2A5XBpQeK08LcRoWu IgJS/VSksNzoQPejyHuMhrYYNqVQSqbHWZTLbzJF71vuaJiJlUldA= Received: (qmail 102432 invoked by alias); 2 Oct 2015 19:29:33 -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 102422 invoked by uid 89); 2 Oct 2015 19:29:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, 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; Fri, 02 Oct 2015 19:29:31 +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 1Zi61G-0007GW-5i from Thomas_Schwinge@mentor.com ; Fri, 02 Oct 2015 12:29:26 -0700 Received: from feldtkeller.schwinge.homeip.net (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.3.224.2; Fri, 2 Oct 2015 20:29:24 +0100 From: Thomas Schwinge To: , Jakub Jelinek , Alexander Monakov CC: Arutyun Avetisyan , Bernd Schmidt , Subject: [PR target/67822] OpenMP offloading to nvptx fails (was: [gomp4 2/8] nvptx mkoffload: do not restrict to OpenACC) In-Reply-To: <20150924072554.GV1847@tucnak.redhat.com> References: <1443028942-4081-1-git-send-email-amonakov@ispras.ru> <1443028942-4081-3-git-send-email-amonakov@ispras.ru> <20150924072554.GV1847@tucnak.redhat.com> User-Agent: Notmuch/0.9-125-g4686d11 (http://notmuchmail.org) Emacs/24.5.1 (i586-pc-linux-gnu) Date: Fri, 2 Oct 2015 21:29:14 +0200 Message-ID: <87pp0xqdbp.fsf@kepler.schwinge.homeip.net> MIME-Version: 1.0 Hi! On Thu, 24 Sep 2015 09:25:54 +0200, Jakub Jelinek wrote: > On Wed, Sep 23, 2015 at 08:22:16PM +0300, Alexander Monakov wrote: > > This patch allows to meaningfully invoke mkoffload with -fopenmp. The check > > for -fopenacc flag is specific to gomp4 branch: trunk does not have it. > > > > * config/nvptx/mkoffload.c (main): Do not check for -fopenacc. > > LGTM. No; see . I installed the following on trunk in r228414 (as obvious), "inverting" the -fopenacc check that we currently have on gomp-4_0-branch to instead skip generating an offloading image if -fopenmp is specified. You're welcome to work on the PR, of course. commit cba229716b3a369e96c71189d98a46ca3ada2717 Author: tschwinge Date: Fri Oct 2 19:27:30 2015 +0000 [PR target/67822] OpenMP offloading to nvptx fails gcc/ PR target/67822 * config/nvptx/mkoffload.c (main): Scan the argument vector for -fopenmp, and skip generating an offloading image if specified. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@228414 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/config/nvptx/mkoffload.c | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) Grüße, Thomas diff --git gcc/ChangeLog gcc/ChangeLog index 3f7561a..1317a2d 100644 --- gcc/ChangeLog +++ gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-10-02 Thomas Schwinge + + PR target/67822 + * config/nvptx/mkoffload.c (main): Scan the argument vector for + -fopenmp, and skip generating an offloading image if specified. + 2015-10-02 Uros Bizjak * system.h (ROUND_UP): New macro definition. diff --git gcc/config/nvptx/mkoffload.c gcc/config/nvptx/mkoffload.c index 926c82b..69eb4ea 100644 --- gcc/config/nvptx/mkoffload.c +++ gcc/config/nvptx/mkoffload.c @@ -1030,6 +1030,7 @@ main (int argc, char **argv) expandargv (&argc, &argv); /* Scan the argument vector. */ + bool fopenmp = false; for (int i = 1; i < argc; i++) { #define STR "-foffload-abi=" @@ -1044,6 +1045,8 @@ main (int argc, char **argv) "unrecognizable argument of option " STR); } #undef STR + else if (strcmp (argv[i], "-fopenmp") == 0) + fopenmp = true; else if (strcmp (argv[i], "-v") == 0) verbose = true; } @@ -1082,8 +1085,8 @@ main (int argc, char **argv) fatal_error (input_location, "cannot open '%s'", ptx_cfile_name); /* PR libgomp/65099: Currently, we only support offloading in 64-bit - configurations. */ - if (offload_abi == OFFLOAD_ABI_LP64) + configurations. PR target/67822: OpenMP offloading to nvptx fails. */ + if (offload_abi == OFFLOAD_ABI_LP64 && !fopenmp) { ptx_name = make_temp_file (".mkoffload"); obstack_ptr_grow (&argv_obstack, "-o");