From patchwork Thu Mar 10 11:10:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 51838 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E50DD3857C68 for ; Thu, 10 Mar 2022 11:10:44 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id 4E4DB3858410 for ; Thu, 10 Mar 2022 11:10:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4E4DB3858410 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.90,170,1643702400"; d="scan'208,223";a="72815499" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 10 Mar 2022 03:10:24 -0800 IronPort-SDR: 7uAdsTfLigMlFAd0MVLpgXDzjpaP18CkTfZ6jhL12ovykfrWYECRvpDdHfEBi+A/UkU4awZdLJ s+DcnFaovtMrHbGQr0UMulBKbOu+TTrlYZ8qY8IrvLDA+OXLUz8ap9HpsXok8J12xUDXqVCDkh CUsQiDsMjvDXQUYupwaeWJ4abyjtHnel1NEYz4a4Qo00VZKQPCq5IpYDrYI9vB9SEA2c60COiV 9J1+7If9phBpBjPjY198FBjznZ31Y1hBeT3XR81vDMMh2aL1QDdQ523dPSzdXrSWJvbKmzvIVn 8ek= From: Thomas Schwinge To: Subject: Enhance further testcases to verify handling of OpenACC privatization level [PR90115] In-Reply-To: <87wnrryjg0.fsf@euler.schwinge.homeip.net> References: <87fszrv4pt.fsf@euler.schwinge.homeip.net> <20210419122356.386d25b1@squid.athome> <87wnrryjg0.fsf@euler.schwinge.homeip.net> User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/27.1 (x86_64-pc-linux-gnu) Date: Thu, 10 Mar 2022 12:10:04 +0100 Message-ID: <87wnh2m5bn.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-11.mgc.mentorg.com (139.181.222.11) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SCC_5_SHORT_WORD_LINES, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Julian Brown , Jakub Jelinek Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Hi! On 2021-05-21T21:29:19+0200, I wrote: > I've pushed "[OpenACC privatization] Largely extend diagnostics and > corresponding testsuite coverage [PR90115]" to master branch in commit > 11b8286a83289f5b54e813f14ff56d730c3f3185 To demonstrate that later changes don't vs. how they do change things, pushed to master branch commit 1d9dc3dd74eddd192bec1ac6f4d6548a81deb9a5 "Enhance further testcases to verify handling of OpenACC privatization level [PR90115]", see attached. Grüße Thomas ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955 From 1d9dc3dd74eddd192bec1ac6f4d6548a81deb9a5 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Tue, 8 Mar 2022 11:51:55 +0100 Subject: [PATCH] Enhance further testcases to verify handling of OpenACC privatization level [PR90115] As originally introduced in commit 11b8286a83289f5b54e813f14ff56d730c3f3185 "[OpenACC privatization] Largely extend diagnostics and corresponding testsuite coverage [PR90115]". PR middle-end/90115 gcc/testsuite/ * c-c++-common/goacc/nesting-1.c: Enhance. * gcc.dg/goacc/nested-function-1.c: Likewise. * gcc.dg/goacc/nested-function-2.c: Likewise. * gfortran.dg/goacc/nested-function-1.f90: Likewise. libgomp/ * testsuite/libgomp.oacc-fortran/routine-1.f90: Enhance. * testsuite/libgomp.oacc-fortran/routine-2.f90: Likewise. * testsuite/libgomp.oacc-fortran/routine-3.f90: Likewise. * testsuite/libgomp.oacc-fortran/routine-9.f90: Likewise. --- gcc/testsuite/c-c++-common/goacc/nesting-1.c | 57 +++++++++++++---- .../gcc.dg/goacc/nested-function-1.c | 54 ++++++++++++---- .../gcc.dg/goacc/nested-function-2.c | 28 ++++++++- .../gfortran.dg/goacc/nested-function-1.f90 | 62 +++++++++++++++---- .../libgomp.oacc-fortran/routine-1.f90 | 19 +++++- .../libgomp.oacc-fortran/routine-2.f90 | 19 +++++- .../libgomp.oacc-fortran/routine-3.f90 | 19 +++++- .../libgomp.oacc-fortran/routine-9.f90 | 19 +++++- 8 files changed, 227 insertions(+), 50 deletions(-) diff --git a/gcc/testsuite/c-c++-common/goacc/nesting-1.c b/gcc/testsuite/c-c++-common/goacc/nesting-1.c index cab4f98950d..83cbff767a4 100644 --- a/gcc/testsuite/c-c++-common/goacc/nesting-1.c +++ b/gcc/testsuite/c-c++-common/goacc/nesting-1.c @@ -1,3 +1,15 @@ +/* { dg-additional-options "-fopt-info-all-omp" } */ + +/* { dg-additional-options "--param=openacc-privatization=noisy" } */ + +/* It's only with Tcl 8.5 (released in 2007) that "the variable 'varName' + passed to 'incr' may be unset, and in that case, it will be set to [...]", + so to maintain compatibility with earlier Tcl releases, we manually + initialize counter variables: + { dg-line l_dummy[variable c_compute 0 c_loop_i 0] } + { dg-message dummy {} { target iN-VAl-Id } l_dummy } to avoid + "WARNING: dg-line var l_dummy defined, but not used". */ + extern int i; void @@ -5,7 +17,11 @@ f_acc_parallel (void) { #pragma acc parallel { -#pragma acc loop +#pragma acc loop /* { dg-line l_loop_i[incr c_loop_i] } */ + /* { dg-note {variable 'i\.[0-9]+' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_i$c_loop_i } */ + /* { dg-note {variable 'i' in 'private' clause is candidate for adjusting OpenACC privatization level} {} { target *-*-* } l_loop_i$c_loop_i } + { dg-note {variable 'i' ought to be adjusted for OpenACC privatization level: 'vector'} {} { target *-*-* } l_loop_i$c_loop_i } */ + /* { dg-optimized {assigned OpenACC gang vector loop parallelism} {} { target *-*-* } l_loop_i$c_loop_i } */ for (i = 0; i < 2; ++i) ; } @@ -15,9 +31,12 @@ f_acc_parallel (void) void f_acc_kernels (void) { -#pragma acc kernels +#pragma acc kernels /* { dg-line l_compute[incr c_compute] } */ + /* { dg-optimized {assigned OpenACC seq loop parallelism} {} { target *-*-* } l_compute$c_compute } */ { -#pragma acc loop +#pragma acc loop /* { dg-line l_loop_i[incr c_loop_i] } */ + /* { dg-note {variable 'i\.[0-9]+' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_i$c_loop_i } */ + /* { dg-note {variable 'i' in 'private' clause is candidate for adjusting OpenACC privatization level} {} { target *-*-* } l_loop_i$c_loop_i } */ for (i = 0; i < 2; ++i) ; } @@ -34,17 +53,25 @@ f_acc_data (void) #pragma acc parallel { -#pragma acc loop +#pragma acc loop /* { dg-line l_loop_i[incr c_loop_i] } */ + /* { dg-note {variable 'i\.[0-9]+' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_i$c_loop_i } */ + /* { dg-note {variable 'i' in 'private' clause is candidate for adjusting OpenACC privatization level} {} { target *-*-* } l_loop_i$c_loop_i } + { dg-note {variable 'i' ought to be adjusted for OpenACC privatization level: 'vector'} {} { target *-*-* } l_loop_i$c_loop_i } */ + /* { dg-optimized {assigned OpenACC gang vector loop parallelism} {} { target *-*-* } l_loop_i$c_loop_i } */ for (i = 0; i < 2; ++i) ; } -#pragma acc kernels +#pragma acc kernels /* { dg-line l_compute[incr c_compute] } */ + /* { dg-optimized {assigned OpenACC seq loop parallelism} {} { target *-*-* } l_compute$c_compute } */ ; -#pragma acc kernels +#pragma acc kernels /* { dg-line l_compute[incr c_compute] } */ + /* { dg-optimized {assigned OpenACC seq loop parallelism} {} { target *-*-* } l_compute$c_compute } */ { -#pragma acc loop +#pragma acc loop /* { dg-line l_loop_i[incr c_loop_i] } */ + /* { dg-note {variable 'i\.[0-9]+' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_i$c_loop_i } */ + /* { dg-note {variable 'i' in 'private' clause is candidate for adjusting OpenACC privatization level} {} { target *-*-* } l_loop_i$c_loop_i } */ for (i = 0; i < 2; ++i) ; } @@ -65,17 +92,25 @@ f_acc_data (void) #pragma acc parallel { -#pragma acc loop +#pragma acc loop /* { dg-line l_loop_i[incr c_loop_i] } */ + /* { dg-note {variable 'i\.[0-9]+' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_i$c_loop_i } */ + /* { dg-note {variable 'i' in 'private' clause is candidate for adjusting OpenACC privatization level} {} { target *-*-* } l_loop_i$c_loop_i } + { dg-note {variable 'i' ought to be adjusted for OpenACC privatization level: 'vector'} {} { target *-*-* } l_loop_i$c_loop_i } */ + /* { dg-optimized {assigned OpenACC gang vector loop parallelism} {} { target *-*-* } l_loop_i$c_loop_i } */ for (i = 0; i < 2; ++i) ; } -#pragma acc kernels +#pragma acc kernels /* { dg-line l_compute[incr c_compute] } */ + /* { dg-optimized {assigned OpenACC seq loop parallelism} {} { target *-*-* } l_compute$c_compute } */ ; -#pragma acc kernels +#pragma acc kernels /* { dg-line l_compute[incr c_compute] } */ + /* { dg-optimized {assigned OpenACC seq loop parallelism} {} { target *-*-* } l_compute$c_compute } */ { -#pragma acc loop +#pragma acc loop /* { dg-line l_loop_i[incr c_loop_i] } */ + /* { dg-note {variable 'i\.[0-9]+' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_i$c_loop_i } */ + /* { dg-note {variable 'i' in 'private' clause is candidate for adjusting OpenACC privatization level} {} { target *-*-* } l_loop_i$c_loop_i } */ for (i = 0; i < 2; ++i) ; } diff --git a/gcc/testsuite/gcc.dg/goacc/nested-function-1.c b/gcc/testsuite/gcc.dg/goacc/nested-function-1.c index e17c0e2227f..c34bcb0d601 100644 --- a/gcc/testsuite/gcc.dg/goacc/nested-function-1.c +++ b/gcc/testsuite/gcc.dg/goacc/nested-function-1.c @@ -2,6 +2,20 @@ /* See gcc/testsuite/gfortran.dg/goacc/nested-function-1.f90 for the Fortran version. */ +/* { dg-additional-options "-fopt-info-all-omp" } */ + +/* { dg-additional-options "--param=openacc-privatization=noisy" } + Prune a few: uninteresting, and potentially varying depending on GCC configuration (data types): + { dg-prune-output {note: variable 'D\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} } */ + +/* It's only with Tcl 8.5 (released in 2007) that "the variable 'varName' + passed to 'incr' may be unset, and in that case, it will be set to [...]", + so to maintain compatibility with earlier Tcl releases, we manually + initialize counter variables: + { dg-line l_dummy[variable c_compute_loop 0 c_loop 0] } + { dg-message dummy {} { target iN-VAl-Id } l_dummy } to avoid + "WARNING: dg-line var l_dummy defined, but not used". */ + int main () { #define N 100 @@ -25,32 +39,40 @@ int main () local_a[i] = 5; local_arg = 5; -#pragma acc kernels loop \ +#pragma acc kernels loop /* { dg-line l_compute_loop[incr c_compute_loop] } */ \ gang(num:local_arg) worker(local_arg) vector(local_arg) \ wait async(local_arg) + /* { dg-note {variable 'local_i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_compute_loop$c_compute_loop } */ + /* { dg-optimized {assigned OpenACC seq loop parallelism} {} { target *-*-* } l_compute_loop$c_compute_loop } */ for (local_i = 0; local_i < N; ++local_i) { #pragma acc cache (local_a[local_i:5]) local_a[local_i] = 100; -#pragma acc loop seq tile(*) +#pragma acc loop seq tile(*) /* { dg-line l_loop[incr c_loop] } */ + /* { dg-note {variable 'local_j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop } */ for (local_j = 0; local_j < N; ++local_j) ; -#pragma acc loop auto independent tile(1) +#pragma acc loop auto independent tile(1) /* { dg-line l_loop[incr c_loop] } */ + /* { dg-note {variable 'local_j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop } */ for (local_j = 0; local_j < N; ++local_j) ; } -#pragma acc kernels loop \ +#pragma acc kernels loop /* { dg-line l_compute_loop[incr c_compute_loop] } */ \ gang(static:local_arg) worker(local_arg) vector(local_arg) \ wait(local_arg, local_arg + 1, local_arg + 2) async + /* { dg-note {variable 'local_i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_compute_loop$c_compute_loop } */ + /* { dg-optimized {assigned OpenACC seq loop parallelism} {} { target *-*-* } l_compute_loop$c_compute_loop } */ for (local_i = 0; local_i < N; ++local_i) { #pragma acc cache (local_a[local_i:4]) local_a[local_i] = 100; -#pragma acc loop seq tile(1) +#pragma acc loop seq tile(1) /* { dg-line l_loop[incr c_loop] } */ + /* { dg-note {variable 'local_j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop } */ for (local_j = 0; local_j < N; ++local_j) ; -#pragma acc loop auto independent tile(*) +#pragma acc loop auto independent tile(*) /* { dg-line l_loop[incr c_loop] } */ + /* { dg-note {variable 'local_j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop } */ for (local_j = 0; local_j < N; ++local_j) ; } @@ -62,32 +84,40 @@ int main () nonlocal_a[i] = 5; nonlocal_arg = 5; -#pragma acc kernels loop \ +#pragma acc kernels loop /* { dg-line l_compute_loop[incr c_compute_loop] } */ \ gang(num:nonlocal_arg) worker(nonlocal_arg) vector(nonlocal_arg) \ wait async(nonlocal_arg) + /* { dg-note {variable 'nonlocal_i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_compute_loop$c_compute_loop } */ + /* { dg-optimized {assigned OpenACC seq loop parallelism} {} { target *-*-* } l_compute_loop$c_compute_loop } */ for (nonlocal_i = 0; nonlocal_i < N; ++nonlocal_i) { #pragma acc cache (nonlocal_a[nonlocal_i:3]) nonlocal_a[nonlocal_i] = 100; -#pragma acc loop seq tile(2) +#pragma acc loop seq tile(2) /* { dg-line l_loop[incr c_loop] } */ + /* { dg-note {variable 'nonlocal_j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop } */ for (nonlocal_j = 0; nonlocal_j < N; ++nonlocal_j) ; -#pragma acc loop auto independent tile(3) +#pragma acc loop auto independent tile(3) /* { dg-line l_loop[incr c_loop] } */ + /* { dg-note {variable 'nonlocal_j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop } */ for (nonlocal_j = 0; nonlocal_j < N; ++nonlocal_j) ; } -#pragma acc kernels loop \ +#pragma acc kernels loop /* { dg-line l_compute_loop[incr c_compute_loop] } */ \ gang(static:nonlocal_arg) worker(nonlocal_arg) vector(nonlocal_arg) \ wait(nonlocal_arg, nonlocal_arg + 1, nonlocal_arg + 2) async + /* { dg-note {variable 'nonlocal_i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_compute_loop$c_compute_loop } */ + /* { dg-optimized {assigned OpenACC seq loop parallelism} {} { target *-*-* } l_compute_loop$c_compute_loop } */ for (nonlocal_i = 0; nonlocal_i < N; ++nonlocal_i) { #pragma acc cache (nonlocal_a[nonlocal_i:2]) nonlocal_a[nonlocal_i] = 100; -#pragma acc loop seq tile(*) +#pragma acc loop seq tile(*) /* { dg-line l_loop[incr c_loop] } */ + /* { dg-note {variable 'nonlocal_j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop } */ for (nonlocal_j = 0; nonlocal_j < N; ++nonlocal_j) ; -#pragma acc loop auto independent tile(*) +#pragma acc loop auto independent tile(*) /* { dg-line l_loop[incr c_loop] } */ + /* { dg-note {variable 'nonlocal_j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop } */ for (nonlocal_j = 0; nonlocal_j < N; ++nonlocal_j) ; } diff --git a/gcc/testsuite/gcc.dg/goacc/nested-function-2.c b/gcc/testsuite/gcc.dg/goacc/nested-function-2.c index 70c9ec8ebfa..407006948da 100644 --- a/gcc/testsuite/gcc.dg/goacc/nested-function-2.c +++ b/gcc/testsuite/gcc.dg/goacc/nested-function-2.c @@ -1,5 +1,17 @@ /* Exercise nested function decomposition, gcc/tree-nested.c. */ +/* { dg-additional-options "-fopt-info-all-omp" } */ + +/* { dg-additional-options "--param=openacc-privatization=noisy" } */ + +/* It's only with Tcl 8.5 (released in 2007) that "the variable 'varName' + passed to 'incr' may be unset, and in that case, it will be set to [...]", + so to maintain compatibility with earlier Tcl releases, we manually + initialize counter variables: + { dg-line l_dummy[variable c_loop 0] } + { dg-message dummy {} { target iN-VAl-Id } l_dummy } to avoid + "WARNING: dg-line var l_dummy defined, but not used". */ + int main (void) { @@ -9,7 +21,9 @@ main (void) int i; #pragma acc parallel { -#pragma acc loop +#pragma acc loop /* { dg-line l_loop[incr c_loop] } */ + /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop } */ + /* { dg-optimized {assigned OpenACC gang vector loop parallelism} {} { target *-*-* } l_loop$c_loop } */ for (i = 0; i < m; i+= k) j = (m + i - j) * l; } @@ -19,7 +33,11 @@ main (void) int x, y, z; #pragma acc parallel { -#pragma acc loop collapse (3) +#pragma acc loop collapse (3) /* { dg-line l_loop[incr c_loop] } */ + /* { dg-note {variable 'z' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop } */ + /* { dg-note {variable 'y' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop } */ + /* { dg-note {variable 'x' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop } */ + /* { dg-optimized {assigned OpenACC gang vector loop parallelism} {} { target *-*-* } l_loop$c_loop } */ for (x = 0; x < k; x++) for (y = -5; y < l; y++) for (z = 0; z < m; z++) @@ -31,7 +49,11 @@ main (void) int x, y, z; #pragma acc parallel reduction (+:j) { -#pragma acc loop reduction (+:j) collapse (3) +#pragma acc loop reduction (+:j) collapse (3) /* { dg-line l_loop[incr c_loop] } */ + /* { dg-note {variable 'z' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop } */ + /* { dg-note {variable 'y' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop } */ + /* { dg-note {variable 'x' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop } */ + /* { dg-optimized {assigned OpenACC gang vector loop parallelism} {} { target *-*-* } l_loop$c_loop } */ for (x = 0; x < k; x++) for (y = -5; y < l; y++) for (z = 0; z < m; z++) diff --git a/gcc/testsuite/gfortran.dg/goacc/nested-function-1.f90 b/gcc/testsuite/gfortran.dg/goacc/nested-function-1.f90 index 005193f30a7..50fd0c82e14 100644 --- a/gcc/testsuite/gfortran.dg/goacc/nested-function-1.f90 +++ b/gcc/testsuite/gfortran.dg/goacc/nested-function-1.f90 @@ -1,6 +1,20 @@ ! Exercise nested function decomposition, gcc/tree-nested.c. ! See gcc/testsuite/gcc.dg/goacc/nested-function-1.c for the C version. +! { dg-additional-options "-fopt-info-all-omp" } + +! { dg-additional-options "--param=openacc-privatization=noisy" } +! Prune a few: uninteresting, and potentially varying depending on GCC configuration (data types): +! { dg-prune-output {note: variable 'D\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} } + +! It's only with Tcl 8.5 (released in 2007) that "the variable 'varName' +! passed to 'incr' may be unset, and in that case, it will be set to [...]", +! so to maintain compatibility with earlier Tcl releases, we manually +! initialize counter variables: +! { dg-line l_dummy[variable c_compute_loop 0 c_loop 0] } +! { dg-message dummy {} { target iN-VAl-Id } l_dummy } to avoid +! "WARNING: dg-line var l_dummy defined, but not used". + program main integer, parameter :: N = 100 integer :: nonlocal_arg @@ -29,14 +43,20 @@ contains !$acc kernels loop & !$acc gang(num:local_arg) worker(local_arg) vector(local_arg) & - !$acc wait async(local_arg) + !$acc wait async(local_arg) ! { dg-line l_compute_loop[incr c_compute_loop] } + ! { dg-note {variable 'local_i' in 'private' clause is candidate for adjusting OpenACC privatization level} {} { target *-*-* } l_compute_loop$c_compute_loop } + ! { dg-note {variable 'local_i\.[0-9]+' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_compute_loop$c_compute_loop } + ! { dg-note {variable 'parm\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_compute_loop$c_compute_loop } + ! { dg-optimized {assigned OpenACC seq loop parallelism} {} { target *-*-* } l_compute_loop$c_compute_loop } do local_i = 1, N !$acc cache (local_a(local_i:local_i + 5)) local_a(local_i) = 100 - !$acc loop seq tile(*) + !$acc loop seq tile(*) ! { dg-line l_loop[incr c_loop] } + ! { dg-note {variable 'local_j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop } do local_j = 1, N enddo - !$acc loop auto independent tile(1) + !$acc loop auto independent tile(1) ! { dg-line l_loop[incr c_loop] } + ! { dg-note {variable 'local_j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop } do local_j = 1, N enddo enddo @@ -44,14 +64,20 @@ contains !$acc kernels loop & !$acc gang(static:local_arg) worker(local_arg) vector(local_arg) & - !$acc wait(local_arg, local_arg + 1, local_arg + 2) async + !$acc wait(local_arg, local_arg + 1, local_arg + 2) async ! { dg-line l_compute_loop[incr c_compute_loop] } + ! { dg-note {variable 'local_i' in 'private' clause is candidate for adjusting OpenACC privatization level} {} { target *-*-* } l_compute_loop$c_compute_loop } + ! { dg-note {variable 'local_i\.[0-9]+' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_compute_loop$c_compute_loop } + ! { dg-note {variable 'parm\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_compute_loop$c_compute_loop } + ! { dg-optimized {assigned OpenACC seq loop parallelism} {} { target *-*-* } l_compute_loop$c_compute_loop } do local_i = 1, N !$acc cache (local_a(local_i:local_i + 4)) local_a(local_i) = 100 - !$acc loop seq tile(1) + !$acc loop seq tile(1) ! { dg-line l_loop[incr c_loop] } + ! { dg-note {variable 'local_j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop } do local_j = 1, N enddo - !$acc loop auto independent tile(*) + !$acc loop auto independent tile(*) ! { dg-line l_loop[incr c_loop] } + ! { dg-note {variable 'local_j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop } do local_j = 1, N enddo enddo @@ -68,14 +94,20 @@ contains !$acc kernels loop & !$acc gang(num:nonlocal_arg) worker(nonlocal_arg) vector(nonlocal_arg) & - !$acc wait async(nonlocal_arg) + !$acc wait async(nonlocal_arg) ! { dg-line l_compute_loop[incr c_compute_loop] } + ! { dg-note {variable 'nonlocal_i' in 'private' clause is candidate for adjusting OpenACC privatization level} {} { target *-*-* } l_compute_loop$c_compute_loop } + ! { dg-note {variable 'nonlocal_i\.[0-9]+' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_compute_loop$c_compute_loop } + ! { dg-note {variable 'parm\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_compute_loop$c_compute_loop } + ! { dg-optimized {assigned OpenACC seq loop parallelism} {} { target *-*-* } l_compute_loop$c_compute_loop } do nonlocal_i = 1, N !$acc cache (nonlocal_a(nonlocal_i:nonlocal_i + 3)) nonlocal_a(nonlocal_i) = 100 - !$acc loop seq tile(2) + !$acc loop seq tile(2) ! { dg-line l_loop[incr c_loop] } + ! { dg-note {variable 'nonlocal_j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop } do nonlocal_j = 1, N enddo - !$acc loop auto independent tile(3) + !$acc loop auto independent tile(3) ! { dg-line l_loop[incr c_loop] } + ! { dg-note {variable 'nonlocal_j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop } do nonlocal_j = 1, N enddo enddo @@ -83,14 +115,20 @@ contains !$acc kernels loop & !$acc gang(static:nonlocal_arg) worker(nonlocal_arg) vector(nonlocal_arg) & - !$acc wait(nonlocal_arg, nonlocal_arg + 1, nonlocal_arg + 2) async + !$acc wait(nonlocal_arg, nonlocal_arg + 1, nonlocal_arg + 2) async ! { dg-line l_compute_loop[incr c_compute_loop] } + ! { dg-note {variable 'nonlocal_i' in 'private' clause is candidate for adjusting OpenACC privatization level} {} { target *-*-* } l_compute_loop$c_compute_loop } + ! { dg-note {variable 'nonlocal_i\.[0-9]+' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_compute_loop$c_compute_loop } + ! { dg-note {variable 'parm\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_compute_loop$c_compute_loop } + ! { dg-optimized {assigned OpenACC seq loop parallelism} {} { target *-*-* } l_compute_loop$c_compute_loop } do nonlocal_i = 1, N !$acc cache (nonlocal_a(nonlocal_i:nonlocal_i + 2)) nonlocal_a(nonlocal_i) = 100 - !$acc loop seq tile(*) + !$acc loop seq tile(*) ! { dg-line l_loop[incr c_loop] } + ! { dg-note {variable 'nonlocal_j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop } do nonlocal_j = 1, N enddo - !$acc loop auto independent tile(*) + !$acc loop auto independent tile(*) ! { dg-line l_loop[incr c_loop] } + ! { dg-note {variable 'nonlocal_j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop } do nonlocal_j = 1, N enddo enddo diff --git a/libgomp/testsuite/libgomp.oacc-fortran/routine-1.f90 b/libgomp/testsuite/libgomp.oacc-fortran/routine-1.f90 index 6a573218b7a..95d8752f8a0 100644 --- a/libgomp/testsuite/libgomp.oacc-fortran/routine-1.f90 +++ b/libgomp/testsuite/libgomp.oacc-fortran/routine-1.f90 @@ -1,6 +1,14 @@ ! { dg-do run } ! { dg-options "-fno-inline" } +! { dg-additional-options "-fopt-info-all-omp" } +! { dg-additional-options "-foffload=-fopt-info-all-omp" } + +! { dg-additional-options "--param=openacc-privatization=noisy" } +! { dg-additional-options "-foffload=--param=openacc-privatization=noisy" } +! Prune a few: uninteresting, and potentially varying depending on GCC configuration (data types): +! { dg-prune-output {note: variable 'D\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} } + interface recursive function fact (x) !$acc routine @@ -11,9 +19,14 @@ integer, parameter :: n = 10 integer :: a(n), i !$acc parallel - !$acc loop + !$acc loop ! { dg-line l_loop1 } + ! { dg-note {variable 'i' in 'private' clause is candidate for adjusting OpenACC privatization level} {} { target *-*-* } l_loop1 } + ! { dg-note {variable 'i' ought to be adjusted for OpenACC privatization level: 'vector'} {} { target *-*-* } l_loop1 } + ! { dg-note {variable 'i' adjusted for OpenACC privatization level: 'vector'} {} { target { ! openacc_host_selected } } l_loop1 } + ! { dg-note {variable 'i\.[0-9]+' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop1 } + ! { dg-optimized {assigned OpenACC gang vector loop parallelism} {} { target *-*-* } l_loop1 } do i = 1, n - a(i) = fact (i) + a(i) = fact (i) ! { dg-optimized {assigned OpenACC seq loop parallelism} } end do !$acc end parallel do i = 1, n @@ -27,6 +40,6 @@ recursive function fact (x) result (res) if (x < 1) then res = 1 else - res = x * fact (x - 1) + res = x * fact (x - 1) ! { dg-optimized {assigned OpenACC seq loop parallelism} } end if end function fact diff --git a/libgomp/testsuite/libgomp.oacc-fortran/routine-2.f90 b/libgomp/testsuite/libgomp.oacc-fortran/routine-2.f90 index b6979747902..9e8eb96dbf2 100644 --- a/libgomp/testsuite/libgomp.oacc-fortran/routine-2.f90 +++ b/libgomp/testsuite/libgomp.oacc-fortran/routine-2.f90 @@ -1,6 +1,14 @@ ! { dg-do run } ! { dg-options "-fno-inline" } +! { dg-additional-options "-fopt-info-all-omp" } +! { dg-additional-options "-foffload=-fopt-info-all-omp" } + +! { dg-additional-options "--param=openacc-privatization=noisy" } +! { dg-additional-options "-foffload=--param=openacc-privatization=noisy" } +! Prune a few: uninteresting, and potentially varying depending on GCC configuration (data types): +! { dg-prune-output {note: variable 'D\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} } + module m1 contains recursive function fact (x) result (res) @@ -10,7 +18,7 @@ if (x < 1) then res = 1 else - res = x * fact (x - 1) + res = x * fact (x - 1) ! { dg-optimized {assigned OpenACC seq loop parallelism} } end if end function fact end module m1 @@ -18,9 +26,14 @@ integer, parameter :: n = 10 integer :: a(n), i !$acc parallel - !$acc loop + !$acc loop ! { dg-line l_loop1 } + ! { dg-note {variable 'i' in 'private' clause is candidate for adjusting OpenACC privatization level} {} { target *-*-* } l_loop1 } + ! { dg-note {variable 'i' ought to be adjusted for OpenACC privatization level: 'vector'} {} { target *-*-* } l_loop1 } + ! { dg-note {variable 'i' adjusted for OpenACC privatization level: 'vector'} {} { target { ! openacc_host_selected } } l_loop1 } + ! { dg-note {variable 'i\.[0-9]+' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop1 } + ! { dg-optimized {assigned OpenACC gang vector loop parallelism} {} { target *-*-* } l_loop1 } do i = 1, n - a(i) = fact (i) + a(i) = fact (i) ! { dg-optimized {assigned OpenACC seq loop parallelism} } end do !$acc end parallel do i = 1, n diff --git a/libgomp/testsuite/libgomp.oacc-fortran/routine-3.f90 b/libgomp/testsuite/libgomp.oacc-fortran/routine-3.f90 index e7b9d8ab364..38218263851 100644 --- a/libgomp/testsuite/libgomp.oacc-fortran/routine-3.f90 +++ b/libgomp/testsuite/libgomp.oacc-fortran/routine-3.f90 @@ -1,14 +1,27 @@ ! { dg-do run } ! { dg-options "-fno-inline" } +! { dg-additional-options "-fopt-info-all-omp" } +! { dg-additional-options "-foffload=-fopt-info-all-omp" } + +! { dg-additional-options "--param=openacc-privatization=noisy" } +! { dg-additional-options "-foffload=--param=openacc-privatization=noisy" } +! Prune a few: uninteresting, and potentially varying depending on GCC configuration (data types): +! { dg-prune-output {note: variable 'D\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} } + integer, parameter :: n = 10 integer :: a(n), i integer, external :: fact !$acc routine (fact) !$acc parallel - !$acc loop + !$acc loop ! { dg-line l_loop1 } + ! { dg-note {variable 'i' in 'private' clause is candidate for adjusting OpenACC privatization level} {} { target *-*-* } l_loop1 } + ! { dg-note {variable 'i' ought to be adjusted for OpenACC privatization level: 'vector'} {} { target *-*-* } l_loop1 } + ! { dg-note {variable 'i' adjusted for OpenACC privatization level: 'vector'} {} { target { ! openacc_host_selected } } l_loop1 } + ! { dg-note {variable 'i\.[0-9]+' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop1 } + ! { dg-optimized {assigned OpenACC gang vector loop parallelism} {} { target *-*-* } l_loop1 } do i = 1, n - a(i) = fact (i) + a(i) = fact (i) ! { dg-optimized {assigned OpenACC seq loop parallelism} } end do !$acc end parallel do i = 1, n @@ -22,6 +35,6 @@ recursive function fact (x) result (res) if (x < 1) then res = 1 else - res = x * fact (x - 1) + res = x * fact (x - 1) ! { dg-optimized {assigned OpenACC seq loop parallelism} } end if end function fact diff --git a/libgomp/testsuite/libgomp.oacc-fortran/routine-9.f90 b/libgomp/testsuite/libgomp.oacc-fortran/routine-9.f90 index b1a1338dd8c..dbd2e4de743 100644 --- a/libgomp/testsuite/libgomp.oacc-fortran/routine-9.f90 +++ b/libgomp/testsuite/libgomp.oacc-fortran/routine-9.f90 @@ -1,6 +1,14 @@ ! { dg-do run } ! { dg-options "-fno-inline" } +! { dg-additional-options "-fopt-info-all-omp" } +! { dg-additional-options "-foffload=-fopt-info-all-omp" } + +! { dg-additional-options "--param=openacc-privatization=noisy" } +! { dg-additional-options "-foffload=--param=openacc-privatization=noisy" } +! Prune a few: uninteresting, and potentially varying depending on GCC configuration (data types): +! { dg-prune-output {note: variable 'D\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} } + program main implicit none integer, parameter :: n = 10 @@ -8,9 +16,14 @@ program main integer, external :: fact !$acc routine (fact) !$acc parallel - !$acc loop + !$acc loop ! { dg-line l_loop1 } + ! { dg-note {variable 'i' in 'private' clause is candidate for adjusting OpenACC privatization level} {} { target *-*-* } l_loop1 } + ! { dg-note {variable 'i' ought to be adjusted for OpenACC privatization level: 'vector'} {} { target *-*-* } l_loop1 } + ! { dg-note {variable 'i' adjusted for OpenACC privatization level: 'vector'} {} { target { ! openacc_host_selected } } l_loop1 } + ! { dg-note {variable 'i\.[0-9]+' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop1 } + ! { dg-optimized {assigned OpenACC gang vector loop parallelism} {} { target *-*-* } l_loop1 } do i = 1, n - a(i) = fact (i) + a(i) = fact (i) ! { dg-optimized {assigned OpenACC seq loop parallelism} } end do !$acc end parallel do i = 1, n @@ -26,6 +39,6 @@ recursive function fact (x) result (res) if (x < 1) then res = 1 else - res = x * fact(x - 1) + res = x * fact(x - 1) ! { dg-optimized {assigned OpenACC seq loop parallelism} } end if end function fact -- 2.34.1