1 extern "C" void abort ();
3 struct S { S (); S (long int, long int); ~S (); static int cnt1, cnt2, cnt3; long int s, t; };
15 S::S (long int x, long int y) : s (x), t (y)
17 #pragma omp atomic update
25 if (t < 3 || t > 9 || (t & 1) == 0)
41 if (o->t != 5 || i->t != 9)
46 #pragma omp declare reduction (+: S : omp_out.s += omp_in.s) initializer (omp_priv (0, 3))
47 #pragma omp declare reduction (*: S : baz (&omp_out, &omp_in)) initializer (bar (&omp_priv, &omp_orig))
49 S a[2] = { { 0, 7 }, { 0, 7 } };
50 S b[7] = { { 9, 5 }, { 11, 5 }, { 1, 5 }, { 1, 5 }, { 1, 5 }, { 13, 5 }, { 15, 5 } };
51 S e[3] = { { 5, 7 }, { 0, 7 }, { 5, 7 } };
52 S f[5] = { { 6, 7 }, { 7, 7 }, { 0, 7 }, { 0, 7 }, { 9, 7 } };
53 S g[4] = { { 1, 7 }, { 0, 7 }, { 0, 7 }, { 2, 7 } };
54 S h[3] = { { 0, 7 }, { 1, 7 }, { 4, 7 } };
55 S k[4][2] = { { { 5, 7 }, { 6, 7 } }, { { 0, 7 }, { 0, 7 } }, { { 0, 7 }, { 0, 7 } }, { { 7, 7 }, { 8, 7 } } };
61 foo (int n, S *c, S *d, S m[3], S *r, S o[4], S *p, S q[4][2])
64 for (i = 0; i < 2; i++)
65 #pragma omp task in_reduction (+: a, c[:2]) in_reduction (*: b[2 * n:3 * n], d[0:2]) \
66 in_reduction (+: o[n:n*2], m[1], k[1:2][:], p[0], f[2:2]) \
67 in_reduction (+: q[1:2][:], g[n:n*2], e[1], h[0], r[2:2]) \
68 in_reduction (*: s[1:2], t[2:2][:])
95 if ((e[1].t != 7 && e[1].t != 3) || (h[0].t != 7 && h[0].t != 3)
96 || (m[1].t != 7 && m[1].t != 3) || (p[0].t != 7 && p[0].t != 3))
98 for (int z = 0; z < 2; z++)
99 if ((a[z].t != 7 && a[z].t != 3) || (c[z].t != 7 && c[z].t != 3)
100 || (d[z].t != 5 && d[z].t != 9) || (f[z + 2].t != 7 && f[z + 2].t != 3)
101 || (g[z + 1].t != 7 && g[z + 1].t != 3) || (r[z + 2].t != 7 && r[z + 2].t != 3)
102 || (s[z + 1].t != 5 && s[z + 1].t != 9) || (o[z + 1].t != 7 && o[z + 1].t != 3)
103 || (k[z + 1][0].t != 7 && k[z + 1][0].t != 3) || (k[z + 1][1].t != 7 && k[z + 1][1].t != 3)
104 || (q[z + 1][0].t != 7 && q[z + 1][0].t != 3) || (q[z + 1][1].t != 7 && q[z + 1][1].t != 3)
105 || (t[z + 2][0].t != 5 && t[z + 2][0].t != 9) || (t[z + 2][1].t != 5 && t[z + 2][1].t != 9))
107 for (int z = 0; z < 3; z++)
108 if (b[z + 2].t != 5 && b[z + 2].t != 9)
117 S c[2] = { { 0, 7 }, { 0, 7 } };
118 S p[3] = { { 0, 7 }, { 1, 7 }, { 4, 7 } };
119 S q[4][2] = { { { 5, 7 }, { 6, 7 } }, { { 0, 7 }, { 0, 7 } }, { { 0, 7 }, { 0, 7 } }, { { 7, 7 }, { 8, 7 } } };
120 S ss[4] = { { 5, 5 }, { 1, 5 }, { 1, 5 }, { 6, 5 } };
121 S tt[5][2] = { { { 9, 5 }, { 10, 5 } }, { { 11, 5 }, { 12, 5 } }, { { 1, 5 }, { 1, 5 } }, { { 1, 5 }, { 1, 5 } }, { { 13, 5 }, { 14, 5 } } };
124 #pragma omp parallel num_threads (1) if (0)
126 S d[] = { { 1, 5 }, { 1, 5 } };
127 S m[3] = { { 5, 7 }, { 0, 7 }, { 5, 7 } };
128 S r[5] = { { 6, 7 }, { 7, 7 }, { 0, 7 }, { 0, 7 }, { 9, 7 } };
129 S o[4] = { { 1, 7 }, { 0, 7 }, { 0, 7 }, { 2, 7 } };
130 volatile unsigned long long x = 0;
131 volatile unsigned long long y = 4;
132 volatile unsigned long long z = 1;
135 #pragma omp for reduction (task, +: a, c) reduction (task, *: b[2 * n:3 * n], d) \
136 reduction (task, +: e[1], f[2:2], g[n:n*2], h[0], k[1:2][0:2]) \
137 reduction (task, +: o[n:n*2], m[1], q[1:2][:], p[0], r[2:2]) \
138 reduction (task, *: t[2:2][:], s[1:n + 1]) \
139 schedule (nonmonotonic: guided, 1)
140 for (unsigned long long i = x; i < y; i += z)
141 #pragma omp task in_reduction (+: a, c) in_reduction (*: b[2 * n:3 * n], d) \
142 in_reduction (+: o[n:n*2], q[1:2][:], p[0], m[1], r[2:2]) \
143 in_reduction (+: g[n:n * 2], e[1], k[1:2][:], h[0], f[2:2]) \
144 in_reduction (*: s[1:2], t[2:2][:])
161 if ((e[1].t != 7 && e[1].t != 3) || (h[0].t != 7 && h[0].t != 3)
162 || (m[1].t != 7 && m[1].t != 3) || (p[0].t != 7 && p[0].t != 3))
164 for (int z = 0; z < 2; z++)
165 if ((a[z].t != 7 && a[z].t != 3) || (c[z].t != 7 && c[z].t != 3)
166 || (d[z].t != 5 && d[z].t != 9) || (f[z + 2].t != 7 && f[z + 2].t != 3)
167 || (g[z + 1].t != 7 && g[z + 1].t != 3) || (r[z + 2].t != 7 && r[z + 2].t != 3)
168 || (s[z + 1].t != 5 && s[z + 1].t != 9) || (o[z + 1].t != 7 && o[z + 1].t != 3)
169 || (k[z + 1][0].t != 7 && k[z + 1][0].t != 3) || (k[z + 1][1].t != 7 && k[z + 1][1].t != 3)
170 || (q[z + 1][0].t != 7 && q[z + 1][0].t != 3) || (q[z + 1][1].t != 7 && q[z + 1][1].t != 3)
171 || (t[z + 2][0].t != 5 && t[z + 2][0].t != 9) || (t[z + 2][1].t != 5 && t[z + 2][1].t != 9))
173 for (int z = 0; z < 3; z++)
174 if (b[z + 2].t != 5 && b[z + 2].t != 9)
176 for (j = 0; j < 2; j++)
177 #pragma omp task in_reduction (+: a, c[:2]) \
178 in_reduction (*: b[2 * n:3 * n], d[n - 1:n + 1]) \
179 in_reduction (+: e[1], f[2:2], g[n:n*2], h[0], k[1:2][:2]) \
180 in_reduction (+: m[1], r[2:2], o[n:n*2], p[0], q[1:2][:2]) \
181 in_reduction (*: s[n:2], t[2:2][:])
198 foo<N> (n, c, d, m, r, o, p, q);
199 if ((e[1].t != 7 && e[1].t != 3) || (h[0].t != 7 && h[0].t != 3)
200 || (m[1].t != 7 && m[1].t != 3) || (p[0].t != 7 && p[0].t != 3))
202 for (int z = 0; z < 2; z++)
203 if ((a[z].t != 7 && a[z].t != 3) || (c[z].t != 7 && c[z].t != 3)
204 || (d[z].t != 5 && d[z].t != 9) || (f[z + 2].t != 7 && f[z + 2].t != 3)
205 || (g[z + 1].t != 7 && g[z + 1].t != 3) || (r[z + 2].t != 7 && r[z + 2].t != 3)
206 || (s[z + 1].t != 5 && s[z + 1].t != 9) || (o[z + 1].t != 7 && o[z + 1].t != 3)
207 || (k[z + 1][0].t != 7 && k[z + 1][0].t != 3) || (k[z + 1][1].t != 7 && k[z + 1][1].t != 3)
208 || (q[z + 1][0].t != 7 && q[z + 1][0].t != 3) || (q[z + 1][1].t != 7 && q[z + 1][1].t != 3)
209 || (t[z + 2][0].t != 5 && t[z + 2][0].t != 9) || (t[z + 2][1].t != 5 && t[z + 2][1].t != 9))
211 for (int z = 0; z < 3; z++)
212 if (b[z + 2].t != 5 && b[z + 2].t != 9)
239 if (a[0].s != 7 * 16 + 4 * 8 + 2 * 4
240 || a[1].s != 17 * 16 + 5 * 8 + 3 * 4
241 || b[0].s != 9 || b[1].s != 11
242 || b[2].s != 1LL << (16 + 4)
243 || b[3].s != 1LL << (8 + 4)
244 || b[4].s != 1LL << (16 + 8)
245 || b[5].s != 13 || b[6].s != 15
246 || c[0].s != 6 * 16 + 4 * 8 + 4 * 4
247 || c[1].s != 5 * 8 + 9 * 4
249 || e[1].s != 19 * 16 + 6 * 8 + 16 * 4
253 || f[2].s != 21 * 16 + 7 * 8 + 8 * 4
254 || f[3].s != 23 * 16 + 18 * 8 + 8 * 4
257 || g[1].s != 25 * 16 + 29 * 8 + 9 * 4
258 || g[2].s != 27 * 16 + 18 * 8 + 10 * 4
260 || h[0].s != 29 * 16 + 19 * 8 + 11 * 4
261 || h[1].s != 1 || h[2].s != 4
262 || k[0][0].s != 5 || k[0][1].s != 6
263 || k[1][0].s != 31 * 16 + 17 * 8
264 || k[1][1].s != 13 * 4
265 || k[2][0].s != 19 * 8
266 || k[2][1].s != 33 * 16 + 15 * 4
267 || k[3][0].s != 7 || k[3][1].s != 8
268 || p[0].s != 29 * 16 + 19 * 8 + 11 * 4
269 || p[1].s != 1 || p[2].s != 4
270 || q[0][0].s != 5 || q[0][1].s != 6
271 || q[1][0].s != 31 * 16 + 17 * 8
272 || q[1][1].s != 13 * 4
273 || q[2][0].s != 19 * 8
274 || q[2][1].s != 33 * 16 + 15 * 4
275 || q[3][0].s != 7 || q[3][1].s != 8
277 || ss[1].s != 1LL << (16 + 4)
278 || ss[2].s != 1LL << 8
280 || tt[0][0].s != 9 || tt[0][1].s != 10 || tt[1][0].s != 11 || tt[1][1].s != 12
281 || tt[2][0].s != 1LL << (16 + 8)
282 || tt[2][1].s != 1LL << 4
283 || tt[3][0].s != 1LL << 8
284 || tt[3][1].s != 1LL << (16 + 4)
285 || tt[4][0].s != 13 || tt[4][1].s != 14)
288 if (d[0].s != 1LL << (8 + 4)
289 || d[1].s != 1LL << 16
291 || m[1].s != 19 * 16 + 6 * 8 + 16 * 4
295 || r[2].s != 21 * 16 + 7 * 8 + 8 * 4
296 || r[3].s != 23 * 16 + 18 * 8 + 8 * 4
299 || o[1].s != 25 * 16 + 29 * 8 + 9 * 4
300 || o[2].s != 27 * 16 + 18 * 8 + 10 * 4
303 if (e[1].t != 7 || h[0].t != 7 || m[1].t != 7 || p[0].t != 7)
305 for (int z = 0; z < 2; z++)
306 if (a[z].t != 7 || c[z].t != 7 || d[z].t != 5 || f[z + 2].t != 7
307 || g[z + 1].t != 7 || r[z + 2].t != 7 || s[z + 1].t != 5 || o[z + 1].t != 7
308 || k[z + 1][0].t != 7 || k[z + 1][1].t != 7 || q[z + 1][0].t != 7 || q[z + 1][1].t != 7
309 || t[z + 2][0].t != 5 || t[z + 2][1].t != 5)
311 for (int z = 0; z < 3; z++)
320 int c1 = S::cnt1, c2 = S::cnt2, c3 = S::cnt3;
322 if (S::cnt1 + S::cnt2 - c1 - c2 != S::cnt3 - c3)