4 struct S
{ unsigned long long int s
, t
; };
7 rbar (struct S
*p
, struct S
*o
)
16 rbaz (struct S
*o
, struct S
*i
)
18 if (o
->t
!= 5 || i
->t
!= 9)
23 #pragma omp declare reduction (+: struct S : omp_out.s += omp_in.s) \
24 initializer (omp_priv = { 0, 3 })
25 #pragma omp declare reduction (*: struct S : rbaz (&omp_out, &omp_in)) \
26 initializer (rbar (&omp_priv, &omp_orig))
28 struct S g
= { 0, 7 };
29 struct S h
= { 1, 5 };
32 foo (int z
, int *a
, int *b
)
35 #pragma omp taskloop reduction (+:x) in_reduction (+:b[0])
36 for (int i
= z
; i
< z
+ 8; i
++)
44 unsigned long long int
45 bar (int z
, int *a
, unsigned long long int *b
, int *s
)
47 unsigned long long int x
= 1;
48 #pragma omp taskloop reduction (*:x) in_reduction (*:b[0]) \
50 for (int i
= z
; i
< z
+ 8; i
++)
52 #pragma omp task in_reduction (*:x)
54 #pragma omp task in_reduction (*:b[0])
62 baz (int i
, int *a
, int *c
)
64 #pragma omp task in_reduction (*:h) in_reduction (+:g)
68 if ((g
.t
!= 7 && g
.t
!= 3) || (h
.t
!= 5 && h
.t
!= 9))
76 int i
, j
= 0, a
[64], b
= 0, c
[64], f
= 0;
77 unsigned long long int d
= 1, e
= 1;
80 struct S m
= { 0, 7 };
81 struct S n
= { 1, 5 };
82 for (i
= 0; i
< 64; i
++)
85 c
[i
] = 1 + ((i
% 3) != 1);
87 #pragma omp parallel reduction (task, +:b) shared(t) reduction(+:r, s)
91 t
= omp_get_num_threads ();
92 #pragma omp for schedule(static) reduction (task, +: f) reduction (+: j)
93 for (z
= 0; z
< 64; z
+= 8)
99 if (j
!= 63 * 64 * 2 || f
!= 63 * 64 * 2 + 8)
102 #pragma omp taskgroup task_reduction (+: s)
104 #pragma omp for schedule(static, 1) reduction(task, *: d) reduction (*: e)
105 for (z
= 0; z
< 64; z
+= 8)
106 e
*= bar (z
, c
, &d
, &s
);
108 if (e
!= (1ULL << 43) || d
!= (1ULL << 21))
110 #pragma omp for schedule(monotonic: dynamic, 1) reduction (task, +: g, m) \
111 reduction (task, *: h, n) collapse(3)
112 for (q1
= 0; q1
< one
; q1
++)
113 for (q2
= 0; q2
< 64; q2
+= 8)
114 for (q3
= 0; q3
< one
; ++q3
)
115 #pragma omp taskloop in_reduction (+: g, m) in_reduction (*: h, n) \
117 for (i
= q2
; i
< q2
+ 8; ++i
)
123 if ((g
.t
!= 7 && g
.t
!= 3) || (h
.t
!= 5 && h
.t
!= 9)
124 || (m
.t
!= 7 && m
.t
!= 3) || (n
.t
!= 5 && n
.t
!= 9))
128 if (n
.s
!= (1ULL << 43) || n
.t
!= 5)
130 if (g
.s
!= 63 * 64 * 10 || g
.t
!= 7)
132 if (h
.s
!= (1ULL << 42) || h
.t
!= 5)
134 if (m
.s
!= 63 * 64 * 4 || m
.t
!= 7)
137 if (b
!= 63 * 64 * 2)
139 if (r
!= t
|| s
!= 64)