| 1 |
! Test of worker-private variables declared on a loop directive. |
| 2 |
|
| 3 |
! { dg-do run } |
| 4 |
|
| 5 |
! { dg-additional-options "--param=openacc-kernels=decompose" } |
| 6 |
|
| 7 |
! { dg-additional-options "-fopt-info-omp-all" } |
| 8 |
! { dg-additional-options "-foffload=-fopt-info-omp-all" } |
| 9 |
|
| 10 |
! { dg-additional-options "--param=openacc-privatization=noisy" } |
| 11 |
! { dg-additional-options "-foffload=--param=openacc-privatization=noisy" } |
| 12 |
! Prune a few: uninteresting: |
| 13 |
! { dg-prune-output {note: variable 'D\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} } |
| 14 |
|
| 15 |
! It's only with Tcl 8.5 (released in 2007) that "the variable 'varName' |
| 16 |
! passed to 'incr' may be unset, and in that case, it will be set to [...]", |
| 17 |
! so to maintain compatibility with earlier Tcl releases, we manually |
| 18 |
! initialize counter variables: |
| 19 |
! { dg-line l_dummy[variable c_compute 0 c_loop_i 0 c_loop_j 0 c_loop_k 0] } |
| 20 |
! { dg-message "dummy" "" { target iN-VAl-Id } l_dummy } to avoid |
| 21 |
! "WARNING: dg-line var l_dummy defined, but not used". |
| 22 |
|
| 23 |
program main |
| 24 |
integer :: x, i, j, arr(0:32*32) |
| 25 |
common x |
| 26 |
|
| 27 |
do i = 0, 32*32-1 |
| 28 |
arr(i) = i |
| 29 |
end do |
| 30 |
|
| 31 |
!$acc kernels copy(arr) ! { dg-line l_compute[incr c_compute] } |
| 32 |
! { dg-note {variable 'x\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_compute$c_compute } |
| 33 |
! { dg-note {forwarded loop nest in OpenACC 'kernels' region to 'parloops' for analysis} {} { target *-*-* } .+1 } |
| 34 |
!$acc loop gang(num:32) private(x) ! { dg-line l_loop_i[incr c_loop_i] } |
| 35 |
! { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_i$c_loop_i } |
| 36 |
do i = 0, 31 |
| 37 |
!$acc loop worker(num:8) private(x) ! { dg-line l_loop_j[incr c_loop_j] } |
| 38 |
! { dg-note {variable 'j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_j$c_loop_j } |
| 39 |
! { dg-note {variable 'x' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_j$c_loop_j } |
| 40 |
do j = 0, 31 |
| 41 |
x = ieor(i, j * 3) |
| 42 |
arr(i * 32 + j) = arr(i * 32 + j) + x |
| 43 |
end do |
| 44 |
end do |
| 45 |
! { dg-optimized {assigned OpenACC seq loop parallelism} {} { target *-*-* } l_loop_i$c_loop_i } |
| 46 |
!$acc end kernels |
| 47 |
|
| 48 |
do i = 0, 32 * 32 - 1 |
| 49 |
if (arr(i) .ne. i + ieor(i / 32, mod(i, 32) * 3)) stop 1 |
| 50 |
end do |
| 51 |
end program main |