3 ! Like imperfect-transform.f90, but enables offloading.
6 integer, save :: f1count(3), f2count(3)
7 !$omp declare target enter (f1count, f2count)
18 ! All intervening code at the same depth must be executed the same
20 if (f1count(1) /= f2count(1)) error
stop 101
21 if (f1count(2) /= f2count(2)) error
stop 102
22 if (f1count(3) /= f2count(3)) error
stop 103
24 ! Intervening code must be executed at least as many times as the loop
26 if (f1count(1) < 3) error
stop 111
27 if (f1count(2) < 3 * 4) error
stop 112
29 ! Intervening code must not be executed more times than the number
30 ! of logical iterations.
31 if (f1count(1) > 3 * 4 * 5) error
stop 121
32 if (f1count(2) > 3 * 4 * 5) error
stop 122
34 ! Check that the innermost loop body is executed exactly the number
35 ! of logical iterations expected.
36 if (f1count(3) /= 3 * 4 * 5) error
stop 131
40 subroutine f1 (depth
, iter
)
41 integer :: depth
, iter
43 f1count(depth
) = f1count(depth
) + 1
46 subroutine f2 (depth
, iter
)
47 integer :: depth
, iter
49 f2count(depth
) = f2count(depth
) + 1
52 subroutine s1 (a1
, a2
, a3
)
56 !$omp target parallel do collapse(2) map(always, tofrom:f1count, f2count) &