1 ! Copy of data-4.f90 with self exchanged with host for !acc update, and with
2 ! default (present) clauses added.
7 real, allocatable :: a(:), b(:), c(:), d(:), e(:)
21 !$acc enter data copyin (a(1:N)) copyin (b(1:N)) copyin (N) async
23 !$acc parallel default (present) async wait
30 !$acc update self (a(1:N), b(1:N)) async wait
34 if (a(i) .ne. 3.0) call abort
35 if (b(i) .ne. 3.0) call abort
41 !$acc update device (a(1:N), b(1:N)) async (1)
43 !$acc parallel default (present) async (1) wait (1)
50 !$acc update host (a(1:N), b(1:N)) async (1) wait (1)
54 if (a(i) .ne. 2.0) call abort
55 if (b(i) .ne. 2.0) call abort
63 !$acc enter data copyin (c(1:N), d(1:N)) async (1)
64 !$acc update device (a(1:N), b(1:N)) async (1)
66 !$acc parallel default (present) async (1)
68 b(i) = (a(i) * a(i) * a(i)) / a(i)
72 !$acc parallel default (present) async (1)
74 c(i) = (a(i) * 4) / a(i)
78 !$acc parallel default (present) async (1)
80 d(i) = ((a(i) * a(i) + a(i)) / a(i)) - a(i)
84 !$acc update self (a(1:N), b(1:N), c(1:N), d(1:N)) async (1) wait (1)
89 if (a(i) .ne. 3.0) call abort
90 if (b(i) .ne. 9.0) call abort
91 if (c(i) .ne. 4.0) call abort
92 if (d(i) .ne. 1.0) call abort
101 !$acc enter data copyin (e(1:N)) async (1)
102 !$acc update device (a(1:N), b(1:N), c(1:N), d(1:N)) async (1)
104 !$acc parallel default (present) async (1)
106 b(i) = (a(i) * a(i) * a(i)) / a(i)
110 !$acc parallel default (present) async (1)
112 c(i) = (a(i) * 4) / a(i)
116 !$acc parallel default (present) async (1)
118 d(i) = ((a(i) * a(i) + a(i)) / a(i)) - a(i)
122 !$acc parallel default (present) wait (1) async (1)
124 e(i) = a(i) + b(i) + c(i) + d(i)
128 !$acc update self (a(1:N), b(1:N), c(1:N), d(1:N), e(1:N)) async (1) wait (1)
130 !$acc exit data delete (N, a(1:N), b(1:N), c(1:N), d(1:N), e(1:N))
133 if (a(i) .ne. 2.0) call abort
134 if (b(i) .ne. 4.0) call abort
135 if (c(i) .ne. 4.0) call abort
136 if (d(i) .ne. 1.0) call abort
137 if (e(i) .ne. 11.0) call abort
139 end program asyncwait