| 1 |
! Test a simple acc loop reduction inside a kernels region. |
| 2 |
|
| 3 |
! { dg-do run } |
| 4 |
|
| 5 |
! { dg-additional-options "--param=openacc-kernels=decompose" } |
| 6 |
|
| 7 |
! { dg-additional-options "-fopt-info-all-omp" } |
| 8 |
! { dg-additional-options "-foffload=-fopt-info-all-omp" } */ |
| 9 |
|
| 10 |
! { dg-additional-options "--param=openacc-privatization=noisy" } |
| 11 |
! { dg-additional-options "-foffload=--param=openacc-privatization=noisy" } |
| 12 |
! Prune a few: uninteresting, and potentially varying depending on GCC configuration (data types): |
| 13 |
! { dg-prune-output {note: variable 'D\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} } */ |
| 14 |
|
| 15 |
program reduction |
| 16 |
integer, parameter :: n = 20 |
| 17 |
integer :: i, red |
| 18 |
|
| 19 |
red = 0 |
| 20 |
|
| 21 |
!$acc kernels ! { dg-line l_compute1 } */ |
| 22 |
! { dg-note {OpenACC 'kernels' decomposition: variable 'red' in 'copy' clause requested to be made addressable} {} { target *-*-* } l_compute1 } |
| 23 |
! { dg-note {variable 'red' made addressable} {} { target *-*-* } l_compute1 } |
| 24 |
!$acc loop reduction (+:red) ! { dg-line l_loop_i1 } |
| 25 |
! { dg-note {forwarded loop nest in OpenACC 'kernels' region to 'parloops' for analysis} {} { target *-*-* } l_loop_i1 } |
| 26 |
! { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_i1 } |
| 27 |
! { dg-optimized {assigned OpenACC seq loop parallelism} {} { target *-*-* } l_loop_i1 } |
| 28 |
do i = 1, n |
| 29 |
red = red + 1 |
| 30 |
end do |
| 31 |
!$acc end kernels |
| 32 |
|
| 33 |
if (red .ne. n) stop 1 |
| 34 |
end program reduction |