diff options
author | Thomas Schwinge <thomas@codesourcery.com> | 2022-03-08 11:51:55 +0100 |
---|---|---|
committer | Thomas Schwinge <thomas@codesourcery.com> | 2022-03-10 11:24:07 +0100 |
commit | 1d9dc3dd74eddd192bec1ac6f4d6548a81deb9a5 (patch) | |
tree | 10e1e7bfb85a44b2c73e129ac4ff1b962895a883 /libgomp/testsuite | |
parent | 6f8abf2b9ff4f165a61295cdb3525ce1da2a77c6 (diff) | |
download | gcc-1d9dc3dd74eddd192bec1ac6f4d6548a81deb9a5.zip gcc-1d9dc3dd74eddd192bec1ac6f4d6548a81deb9a5.tar.gz gcc-1d9dc3dd74eddd192bec1ac6f4d6548a81deb9a5.tar.bz2 |
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.
Diffstat (limited to 'libgomp/testsuite')
4 files changed, 64 insertions, 12 deletions
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/routine-1.f90 b/libgomp/testsuite/libgomp.oacc-fortran/routine-1.f90 index 6a57321..95d8752 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 b697974..9e8eb96 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 e7b9d8a..3821826 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 b1a1338..dbd2e4de7 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 |