From patchwork Fri Nov 30 20:47:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 1006184 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-491400-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="N8UY5zpO"; dkim-atps=neutral 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 4366076WgDz9s9G for ; Sat, 1 Dec 2018 07:47:35 +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:from :to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=CdaVBAQfmrtj+JUs vrJmMmdqrATteFY5RYtFlCau/bEAHPJHqFM/YQ/N7bSCX9K8hJoy+0UPpsQGRa8z zAAFuvsm/fphjJph/oMuGpUzDE11VCWCNmpb6EgNKQ2Bh+tCRBNv/5y7ht8YO20N 3RGOMLN7bGY8fOH8a+BrV6E965M= 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:date:message-id:mime-version:content-type :content-transfer-encoding; s=default; bh=kyO09psfbsk95jiqzUuzjf UinFg=; b=N8UY5zpOpxA2bVK4/z/V/wbLC7Xsd9HvTd0pyAAZUVaY+4IFp9/76D Fz2IzhC7nby/9q0Dr62GBZLivhup9LJIcps3Ousuhq6hemrlMwuYfiSBuzQN6qKR ZP+4MYG7wLvWfUvB8H/Y6NThmQJSH2qP0aJ7DCY3KzGcLgQdQGPm8= Received: (qmail 126068 invoked by alias); 30 Nov 2018 20:47:24 -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 126045 invoked by uid 89); 30 Nov 2018 20:47:24 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=sk:gfc_mat, **cp, U*bergner, openmp.c 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, 30 Nov 2018 20:47:22 +0000 Received: from svr-orw-mbx-06.mgc.mentorg.com ([147.34.90.206]) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1gSph2-0002KR-Hd from Thomas_Schwinge@mentor.com ; Fri, 30 Nov 2018 12:47:20 -0800 Received: from svr-orw-mbx-08.mgc.mentorg.com (147.34.90.208) by SVR-ORW-MBX-06.mgc.mentorg.com (147.34.90.206) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Fri, 30 Nov 2018 12:47:18 -0800 Received: from tftp-cs (147.34.91.1) by svr-orw-mbx-08.mgc.mentorg.com (147.34.90.208) with Microsoft SMTP Server id 15.0.1320.4 via Frontend Transport; Fri, 30 Nov 2018 12:47:17 -0800 Received: by tftp-cs (Postfix, from userid 49978) id 98E77C2222; Fri, 30 Nov 2018 12:47:17 -0800 (PST) From: Thomas Schwinge To: , CC: Chung-Lin Tang , Jakub Jelinek Subject: [committed] Support multiple OpenACC wait clauses User-Agent: Notmuch/0.9-125-g4686d11 (http://notmuchmail.org) Emacs/25.2.2 (x86_64-pc-linux-gnu) Date: Fri, 30 Nov 2018 21:47:10 +0100 Message-ID: <877eguthrl.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 Hi! I ran into this while working on something else, and it turned into a prerequisite. Committed to trunk in r266684: commit ba688147af7632d7e1c420c98f2d301f7b9e427c Author: tschwinge Date: Fri Nov 30 20:39:08 2018 +0000 Support multiple OpenACC wait clauses Support for this is not explicitly called for in OpenACC 2.6, but given that GCC internally decomposes "wait (1, 2)" into "wait (1) wait (2)" (similar for other clauses, too), it's reasonable to also support that syntax in the front ends -- which happens to already be the case for C, C++, and easy enough to do for Fortran. gcc/fortran/ * openmp.c (gfc_match_omp_clauses): Support multiple OpenACC wait clauses. gcc/testsuite/ * c-c++-common/goacc/asyncwait-5.c: New file. * gfortran.dg/goacc/asyncwait-5.f: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@266684 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/fortran/ChangeLog | 5 +++++ gcc/fortran/openmp.c | 1 - gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/c-c++-common/goacc/asyncwait-5.c | 14 ++++++++++++++ gcc/testsuite/gfortran.dg/goacc/asyncwait-5.f | 13 +++++++++++++ 5 files changed, 37 insertions(+), 1 deletion(-) Grüße Thomas diff --git gcc/fortran/ChangeLog gcc/fortran/ChangeLog index 06e7400eda7d..435ecf82f970 100644 --- gcc/fortran/ChangeLog +++ gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2018-11-30 Thomas Schwinge + + * openmp.c (gfc_match_omp_clauses): Support multiple OpenACC wait + clauses. + 2018-11-27 Martin Liska * decl.c (gfc_match_gcc_builtin): New function. diff --git gcc/fortran/openmp.c gcc/fortran/openmp.c index 6430e61ea7a6..e1560c1fe372 100644 --- gcc/fortran/openmp.c +++ gcc/fortran/openmp.c @@ -1876,7 +1876,6 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask, break; case 'w': if ((mask & OMP_CLAUSE_WAIT) - && !c->wait && gfc_match ("wait") == MATCH_YES) { c->wait = true; diff --git gcc/testsuite/ChangeLog gcc/testsuite/ChangeLog index 874c158f75dd..75ca70b4af28 100644 --- gcc/testsuite/ChangeLog +++ gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-11-30 Thomas Schwinge + + * c-c++-common/goacc/asyncwait-5.c: New file. + * gfortran.dg/goacc/asyncwait-5.f: Likewise. + 2018-11-30 Peter Bergner PR target/87496 diff --git gcc/testsuite/c-c++-common/goacc/asyncwait-5.c gcc/testsuite/c-c++-common/goacc/asyncwait-5.c new file mode 100644 index 000000000000..fe6f8a0cf2da --- /dev/null +++ gcc/testsuite/c-c++-common/goacc/asyncwait-5.c @@ -0,0 +1,14 @@ +/* Multiple OpenACC wait clauses. */ + +/* { dg-additional-options "-fdump-tree-original" } */ + +void f() +{ +#pragma acc parallel async (1) wait (14) + ; + /* { dg-final { scan-tree-dump-times "(?n)#pragma acc parallel wait\\(14\\) async\\(1\\)$" 1 "original" } } */ + +#pragma acc parallel async (2) wait (11, 12) wait (13) + ; + /* { dg-final { scan-tree-dump-times "(?n)#pragma acc parallel wait\\(13\\) wait\\(12\\) wait\\(11\\) async\\(2\\)\$" 1 "original" } } */ +} diff --git gcc/testsuite/gfortran.dg/goacc/asyncwait-5.f gcc/testsuite/gfortran.dg/goacc/asyncwait-5.f new file mode 100644 index 000000000000..59b886343af6 --- /dev/null +++ gcc/testsuite/gfortran.dg/goacc/asyncwait-5.f @@ -0,0 +1,13 @@ +! Multiple OpenACC wait clauses. + +! { dg-additional-options "-fdump-tree-original" } + +!$ACC PARALLEL ASYNC (1) WAIT (14) +!$ACC END PARALLEL +! { dg-final { scan-tree-dump-times "(?n)#pragma acc parallel async\\(1\\) wait\\(14\\)$" 1 "original" } } + +!$ACC PARALLEL ASYNC (2) WAIT (11, 12) WAIT(13) +!$ACC END PARALLEL +! { dg-final { scan-tree-dump-times "(?n)#pragma acc parallel async\\(2\\) wait\\(11\\) wait\\(12\\) wait\\(13\\)$" 1 "original" } } + + END