| 1 |
! Test valid usages of the if_present clause. |
| 2 |
|
| 3 |
! { dg-additional-options "-fdump-tree-omplower" } |
| 4 |
|
| 5 |
subroutine t |
| 6 |
implicit none |
| 7 |
integer a, b, c(10) |
| 8 |
real, allocatable :: x, y, z(:) |
| 9 |
|
| 10 |
a = 5 |
| 11 |
b = 10 |
| 12 |
c(:) = -1 |
| 13 |
|
| 14 |
allocate (x, y, z(100)) |
| 15 |
|
| 16 |
!$acc update self(a) if_present |
| 17 |
!$acc update device(b) if_present async |
| 18 |
!$acc update host(c(1:3)) wait(4) if_present |
| 19 |
!$acc update self(c) device(a) host(b) if_present async(10) if(a == 10) |
| 20 |
|
| 21 |
!$acc update self(x) if_present |
| 22 |
!$acc update device(y) if_present async |
| 23 |
!$acc update host(z(1:3)) wait(3) if_present |
| 24 |
!$acc update self(z) device(y) host(x) if_present async(4) if(a == 1) |
| 25 |
end subroutine t |
| 26 |
|
| 27 |
! { dg-final { scan-tree-dump-times " if_present" 8 "omplower" } } |