From patchwork Wed Oct 28 08:26:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 537249 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 476CF1402B7 for ; Wed, 28 Oct 2015 19:27:35 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=gD++bAsO; 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 :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=jnkeZ5yM795JML3XF AE9G4XYDj01yCIQNuQkSChejxEYKYddslBsL3Ukv5fh42SCBJa+797ip9GY3wO17 l4jb7SQYO4AiCcaxI2GmaNYqzEskijSEpkVFxZhukUC+FIaCiarBZrlkqf8Lu9vY DGEUra4o1sgJssUuXOzbB34w8I= 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 :subject:to:references:cc:from:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=DGh4omG8cGeOOQdm3j16Efh POLI=; b=gD++bAsOmts2Fz4eHr2be93qdy7J4FfLjgWXU9NtOFeuCXFUqhHKPpf xXduoQYkkunqEMWWaJuVJ4W2XaFMDLnEzV2HAcZzC6Jxm9XHyJO5haacPZ898RnM nVlvSRa5vmIgUbf6qm1sTj10QvQWjr7k91Sy21tXobIL/LjCsbSY= Received: (qmail 10523 invoked by alias); 28 Oct 2015 08:27:27 -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 10511 invoked by uid 89); 28 Oct 2015 08:27:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 X-HELO: fencepost.gnu.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (208.118.235.10) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 28 Oct 2015 08:27:24 +0000 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51930) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ZrM4o-0004bc-21 for gcc-patches@gnu.org; Wed, 28 Oct 2015 04:27:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZrM4j-0002S8-8H for gcc-patches@gnu.org; Wed, 28 Oct 2015 04:27:21 -0400 Received: from relay1.mentorg.com ([192.94.38.131]:61971) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZrM4i-0002Rl-VR for gcc-patches@gnu.org; Wed, 28 Oct 2015 04:27:17 -0400 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-03.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1ZrM4e-0003CI-QL from Tom_deVries@mentor.com ; Wed, 28 Oct 2015 01:27:13 -0700 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-03.mgc.mentorg.com (137.202.0.108) with Microsoft SMTP Server id 14.3.224.2; Wed, 28 Oct 2015 08:27:11 +0000 Subject: Re: OpenACC constructs nesting checks To: Thomas Schwinge References: <56192805.6090200@acm.org> <5620C0A5.20506@mentor.com> <878u6v9ski.fsf@kepler.schwinge.homeip.net> CC: Jakub Jelinek , "gcc-patches@gnu.org" , From: Tom de Vries Message-ID: <563086CC.8000705@mentor.com> Date: Wed, 28 Oct 2015 09:26:52 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <878u6v9ski.fsf@kepler.schwinge.homeip.net> X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic] [fuzzy] X-Received-From: 192.94.38.131 On 22/10/15 11:10, Thomas Schwinge wrote: > Hi Tom! > > On Fri, 16 Oct 2015 11:17:25 +0200, Tom de Vries wrote: >> this patch checks for occurance of oacc offload regions in oacc routines >> (which means nested parallelism, which is currently not supported) and >> gives an appropriate error message. > >> --- /dev/null >> +++ b/gcc/testsuite/c-c++-common/goacc/parallel-in-routine.c >> @@ -0,0 +1,8 @@ >> +#pragma acc routine >> +void >> +foo (void) >> +{ >> +#pragma acc parallel /* { dg-error "OpenACC region inside of OpenACC routine, nested parallelism not supported yet" } */ >> + ; >> +} > > Please move such tests into > gcc/testsuite/c-c++-common/goacc/nesting-fail-1.c and/or > gcc/testsuite/c-c++-common/goacc-gomp/nesting-fail-1.c, and nesting tests > that are expected to succeed into > gcc/testsuite/c-c++-common/goacc/nesting-1.c and/or > gcc/testsuite/c-c++-common/goacc-gomp/nesting-1.c. (I have not looked up > the corresponding Fortran testsuite files.) > > > When fixing that, please also add back (checking for appropriate > diagnostics) the tests that Nathan apparently didn't know where to put, > and thus removed, in > > (gomp-4_0-branch r228678), and > > (gomp-4_0-branch r228694). > > Committed attached patches: 1 Move goacc/parallel-in-routine.c to goacc/nesting-fail-1.c 2 Test for acc loop in omp parallel 3 Move dg-error tests from goacc/nesting-1.c to goacc/nesting-fail-1.c Thanks, - Tom Move dg-error tests from goacc/nesting-1.c to goacc/nesting-fail-1.c 2015-10-28 Tom de Vries * c-c++-common/goacc/nesting-1.c (f_acc_data): Move dg-error tests to ... * c-c++-common/goacc/nesting-fail-1.c (f_acc_data): ... here. --- gcc/testsuite/c-c++-common/goacc/nesting-1.c | 8 -------- gcc/testsuite/c-c++-common/goacc/nesting-fail-1.c | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/gcc/testsuite/c-c++-common/goacc/nesting-1.c b/gcc/testsuite/c-c++-common/goacc/nesting-1.c index 3a8f838..cab4f98 100644 --- a/gcc/testsuite/c-c++-common/goacc/nesting-1.c +++ b/gcc/testsuite/c-c++-common/goacc/nesting-1.c @@ -58,10 +58,6 @@ f_acc_data (void) #pragma acc exit data delete(i) -#pragma acc loop /* { dg-error "loop directive must be associated with an OpenACC compute region" } */ - for (i = 0; i < 2; ++i) - ; - #pragma acc data { #pragma acc parallel @@ -92,10 +88,6 @@ f_acc_data (void) #pragma acc enter data copyin(i) #pragma acc exit data delete(i) - -#pragma acc loop /* { dg-error "loop directive must be associated with an OpenACC compute region" } */ - for (i = 0; i < 2; ++i) - ; } } } diff --git a/gcc/testsuite/c-c++-common/goacc/nesting-fail-1.c b/gcc/testsuite/c-c++-common/goacc/nesting-fail-1.c index 855444c..bced28a 100644 --- a/gcc/testsuite/c-c++-common/goacc/nesting-fail-1.c +++ b/gcc/testsuite/c-c++-common/goacc/nesting-fail-1.c @@ -45,3 +45,22 @@ f_acc_routine (void) #pragma acc parallel /* { dg-error "OpenACC region inside of OpenACC routine, nested parallelism not supported yet" } */ ; } + +void +f_acc_data (void) +{ + unsigned int i; +#pragma acc data + { +#pragma acc loop /* { dg-error "loop directive must be associated with an OpenACC compute region" } */ + for (i = 0; i < 2; ++i) + ; + +#pragma acc data + { +#pragma acc loop /* { dg-error "loop directive must be associated with an OpenACC compute region" } */ + for (i = 0; i < 2; ++i) + ; + } + } +} -- 1.9.1