13 use iso_c_binding
, only
: c_ptr
, c_loc
, c_int
14 integer :: a
, b
, c
, d(2:3,4:5), q(19:), h
, k
, m
, n
, o
, p
15 integer(c_int
), target
:: e(64)
16 type (c_ptr
) :: f
, g(64)
27 use iso_c_binding
, only
: c_sizeof
28 !$omp simd linear(a:2) linear(b:1)
33 if (a
/= 21 .or
. b
/= 12) stop 1
34 !$omp simd aligned(f : c_sizeof (e(1)))
42 !$omp task depend(out : a, d(2:2,4:5))
44 d(2:2,4:5) = d(2:2,4:5) + 1
46 !$omp task depend(in : a, d(2:2,4:5))
48 if (any (d(2:2,4:5) /= 5)) stop 3
54 !$omp target data map (tofrom: a, d(2:3,4:4), q) map (from: l)
55 !$omp target map (tofrom: b, d(2:3,4:4)) map (alloc: a, l)
57 if (a
/= 22 .or
. any (q
/= 5)) l
= .true
.
58 if (lbound (q
, 1) /= 19 .or
. ubound (q
, 1) /= 27) l
= .true
.
59 if (d(2,4) /= 5 .or
. d(3,4) /= 4) l
= .true
.
66 !$omp target update from (a, q, d(2:3,4:4), l)
67 if (a
/= 6 .or
. l
.or
. b
/= 11 .or
. any (q
/= 8)) stop 4
68 if (any (d(2:3,4:4) /= 9) .or
. d(2,5) /= 5 .or
. d(3,5) /= 4) stop 5
73 !$omp target update to (a, q, d(2:3,4:4))
74 !$omp target map (tofrom: b, d(2:3,4:4)) map (alloc: a, l)
75 if (a
/= 12 .or
. b
/= 13 .or
. any (q
/= 14)) l
= .true
.
76 l
= l
.or
. any (d(2:3,4:4) /= 15)
86 !$omp target teams distribute parallel do simd if (.not.l) device(a) &
87 !$omp & num_teams(b) dist_schedule(static, c) num_threads (h) &
88 !$omp & reduction (+: m) safelen (n) schedule(static, o) &
89 !$omp & defaultmap(tofrom: scalar)
93 !$omp end target teams distribute parallel do simd