3 struct C
{ unsigned long long t
; };
6 add (struct B
*x
, struct B
*y
)
16 orit (struct C
*x
, struct C
*y
)
20 #pragma omp declare reduction(+:struct A:omp_out.t += omp_in.t)
21 #pragma omp declare reduction(+:struct B:add (&omp_out, &omp_in)) initializer(zero (&omp_priv))
22 #pragma omp declare reduction(*:struct A:omp_out.t *= omp_in.t) initializer(omp_priv = { 1 })
23 #pragma omp declare reduction(|:struct C:orit (&omp_in, &omp_out))
24 #pragma omp declare reduction(&:struct D:omp_out.t = omp_out.t & omp_in.t) initializer(omp_priv = { ~0L })
25 #pragma omp declare reduction(maxb:short:omp_out = omp_in > omp_out ? omp_in : omp_out) initializer(omp_priv = -6)
29 __attribute__((noinline
, noclone
)) void
30 foo (struct A (*x
)[3][2], struct A
*y
, struct D w
[1][2], int p1
, long p2
, long p3
, int p4
,
31 int p5
, long p6
, short p7
, int s
, int t
)
36 for (i
= 0; i
< p7
+ 4; i
++)
42 #pragma omp parallel for reduction(+:x[-1:p1 + 1][:p2], z[t + 2:p3]) \
43 reduction(*:y[-s:p4]) reduction(|:a[s + 3:p5]) \
44 reduction(&:w[s + 1:p6 - 1][t:p6]) reduction(maxb:b[2:])
45 for (i
= 0; i
< 128; i
++)
47 x
[i
/ 64 - 1][i
% 3][(i
/ 4) & 1].t
+= i
;
54 z
[i
/ 32 + 2].t
+= (i
& 3);
57 a
[i
/ 32 + 2].t
|= 1ULL << (i
& 30);
58 w
[0][i
& 1].t
&= ~(1L << (i
/ 17 * 3));
66 for (i
= 0; i
< 9; i
++)
67 if (a
[i
].t
!= ((i
< 6 && i
>= 2) ? 0x55555555ULL
: 0))
69 if (b
[0] != -6 || b
[1] != -6 || b
[2] != 22 || b
[3] != 84 || b
[4] != 127)
76 struct A a
[4][3][2] = {};
77 static int a2
[4][3][2] = {{{ 0, 0 }, { 0, 0 }, { 0, 0 }},
78 {{ 312, 381 }, { 295, 356 }, { 337, 335 }},
79 {{ 1041, 975 }, { 1016, 1085 }, { 935, 1060 }},
80 {{ 0, 0 }, { 0, 0 }, { 0, 0 }}};
81 struct A y
[5] = { { 0 }, { 1 }, { 1 }, { 1 }, { 0 } };
82 int y2
[5] = { 0, 6561, 2401, 289, 0 };
83 char z2
[10] = { 0, 0, 48, 49, 50, 51, 0, 0, 0, 0 };
84 struct D w
[1][2] = { { { ~0L }, { ~0L } } };
85 foo (&a
[2], y
, w
, 1, 3L, 4L, 3, 4, 2L, 5, -1, 0);
87 for (i
= 0; i
< 4; i
++)
88 for (j
= 0; j
< 3; j
++)
89 for (k
= 0; k
< 2; k
++)
90 if (a
[i
][j
][k
].t
!= a2
[i
][j
][k
])
92 for (i
= 0; i
< 5; i
++)
95 for (i
= 0; i
< 10; i
++)
98 if (w
[0][0].t
!= ~0x249249L
|| w
[0][1].t
!= ~0x249249L
)