4 integer, parameter :: N
= 64
5 real, allocatable
:: a(:), b(:), c(:), d(:), e(:)
17 !$acc data copy (a(1:N)) copy (b(1:N))
30 if (a(i
) .ne
. 3.0) call abort
31 if (b(i
) .ne
. 3.0) call abort
37 !$acc data copy (a(1:N)) copy (b(1:N))
39 !$acc parallel async (1)
50 if (a(i
) .ne
. 2.0) call abort
51 if (b(i
) .ne
. 2.0) call abort
59 !$acc data copy (a(1:N)) copy (b(1:N)) copy (c(1:N)) copy (d(1:N))
61 !$acc parallel async (1)
63 b(i
) = (a(i
) * a(i
) * a(i
)) / a(i
)
67 !$acc parallel async (1)
69 c(i
) = (a(i
) * 4) / a(i
)
73 !$acc parallel async (1)
76 d(i
) = ((a(i
) * a(i
) + a(i
)) / a(i
)) - a(i
)
84 if (a(i
) .ne
. 3.0) call abort
85 if (b(i
) .ne
. 9.0) call abort
86 if (c(i
) .ne
. 4.0) call abort
87 if (d(i
) .ne
. 1.0) call abort
96 !$acc data copy (a(1:N), b(1:N), c(1:N), d(1:N), e(1:N))
98 !$acc parallel async (1)
100 b(i
) = (a(i
) * a(i
) * a(i
)) / a(i
)
104 !$acc parallel async (1)
107 c(i
) = (a(i
) * 4) / a(i
)
111 !$acc parallel async (1)
114 d(i
) = ((a(i
) * a(i
) + a(i
)) / a(i
)) - a(i
)
118 !$acc parallel wait (1) async (1)
121 e(i
) = a(i
) + b(i
) + c(i
) + d(i
)
129 if (a(i
) .ne
. 2.0) call abort
130 if (b(i
) .ne
. 4.0) call abort
131 if (c(i
) .ne
. 4.0) call abort
132 if (d(i
) .ne
. 1.0) call abort
133 if (e(i
) .ne
. 11.0) call abort
139 !$acc data copy (a(1:N)) copy (b(1:N))
152 if (a(i
) .ne
. 3.0) call abort
153 if (b(i
) .ne
. 3.0) call abort
159 !$acc data copy (a(1:N)) copy (b(1:N))
161 !$acc kernels async (1)
172 if (a(i
) .ne
. 2.0) call abort
173 if (b(i
) .ne
. 2.0) call abort
181 !$acc data copy (a(1:N)) copy (b(1:N)) copy (c(1:N)) copy (d(1:N))
183 !$acc kernels async (1)
185 b(i
) = (a(i
) * a(i
) * a(i
)) / a(i
)
189 !$acc kernels async (1)
191 c(i
) = (a(i
) * 4) / a(i
)
195 !$acc kernels async (1)
198 d(i
) = ((a(i
) * a(i
) + a(i
)) / a(i
)) - a(i
)
206 if (a(i
) .ne
. 3.0) call abort
207 if (b(i
) .ne
. 9.0) call abort
208 if (c(i
) .ne
. 4.0) call abort
209 if (d(i
) .ne
. 1.0) call abort
218 !$acc data copy (a(1:N), b(1:N), c(1:N), d(1:N), e(1:N))
220 !$acc kernels async (1)
222 b(i
) = (a(i
) * a(i
) * a(i
)) / a(i
)
226 !$acc kernels async (1)
229 c(i
) = (a(i
) * 4) / a(i
)
233 !$acc kernels async (1)
236 d(i
) = ((a(i
) * a(i
) + a(i
)) / a(i
)) - a(i
)
240 !$acc kernels wait (1) async (1)
243 e(i
) = a(i
) + b(i
) + c(i
) + d(i
)
251 if (a(i
) .ne
. 2.0) call abort
252 if (b(i
) .ne
. 4.0) call abort
253 if (c(i
) .ne
. 4.0) call abort
254 if (d(i
) .ne
. 1.0) call abort
255 if (e(i
) .ne
. 11.0) call abort
257 end program asyncwait