| 1 |
! 'atomic' access of gang-private variable |
| 2 |
|
| 3 |
! { dg-do run } |
| 4 |
|
| 5 |
! { dg-additional-options "-fopt-info-note-omp" } |
| 6 |
! { dg-additional-options "--param=openacc-privatization=noisy" } |
| 7 |
! { dg-additional-options "-foffload=-fopt-info-note-omp" } |
| 8 |
! { dg-additional-options "-foffload=--param=openacc-privatization=noisy" } |
| 9 |
! for testing/documenting aspects of that functionality. |
| 10 |
|
| 11 |
|
| 12 |
program main |
| 13 |
integer :: w, arr(0:31) |
| 14 |
|
| 15 |
!$acc parallel num_gangs(32) num_workers(32) copyout(arr) |
| 16 |
!$acc loop gang private(w) |
| 17 |
! { dg-note {variable 'j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-1 } |
| 18 |
! { dg-note {variable 'w' in 'private' clause is candidate for adjusting OpenACC privatization level} "" { target *-*-* } .-2 } |
| 19 |
! { dg-note {variable 'w' ought to be adjusted for OpenACC privatization level: 'gang'} "" { target *-*-* } .-3 } |
| 20 |
! { dg-note {variable 'w' adjusted for OpenACC privatization level: 'gang'} "" { target { ! openacc_host_selected } } .-4 } |
| 21 |
do j = 0, 31 |
| 22 |
w = 0 |
| 23 |
!$acc loop seq |
| 24 |
! { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-1 } |
| 25 |
do i = 0, 31 |
| 26 |
!$acc atomic update |
| 27 |
w = w + 1 |
| 28 |
!$acc end atomic |
| 29 |
end do |
| 30 |
arr(j) = w |
| 31 |
end do |
| 32 |
!$acc end parallel |
| 33 |
|
| 34 |
if (any (arr .ne. 32)) stop 1 |
| 35 |
end program main |