8 A (const A &x) { t = x.t; }
17 M (const M &x) { t = x.t; }
26 B (const B &x) { t = x.t; }
49 #pragma omp declare reduction(+:A<int>:omp_out.t += omp_in.t)
50 #pragma omp declare reduction(+:A<char>:add (omp_out, omp_in)) initializer(zero (omp_priv))
51 #pragma omp declare reduction(*:M<int>:omp_out.t *= omp_in.t) initializer(omp_priv = 1)
52 #pragma omp declare reduction(|:A<unsigned long long>:orit (&omp_in, &omp_out))
53 #pragma omp declare reduction(&:B<long>:omp_out.t = omp_out.t & omp_in.t) initializer(orit (&omp_priv, &omp_orig))
54 #pragma omp declare reduction(maxb:short:omp_out = omp_in > omp_out ? omp_in : omp_out) initializer(omp_priv = -6)
59 __attribute__((noinline, noclone)) void
60 foo (A<int> (*&x)[3][N], M<int> *y, B<long> (&w)[1][N], int p1, long p2, long p3, int p4,
61 int p5, long p6, short p7, int s, int t)
63 A<unsigned long long> a[p7 + 4];
66 for (int i = 0; i < p7; i++)
68 #pragma omp parallel for reduction(+:x[-1:p1 + 1][:p2 + N - 2], z[t + N:p3]) \
69 reduction(*:y[-s:p4]) reduction(|:a[s + 3:p5 - N + 2]) \
70 reduction(&:w[s + 1:p6 - 3 + N][t:p6]) reduction(maxb:b[N:])
71 for (int i = 0; i < 128; i++)
73 x[i / 64 - 1][i % 3][(i / 4) & 1].t += i;
80 z[i / 32 + 2].t += (i & 3);
83 a[i / 32 + 2].t |= 1ULL << (i & 30);
84 w[0][i & 1].t &= ~(1L << (i / 17 * 3));
92 for (int i = 0; i < 9; i++)
93 if (a[i].t != ((i < 6 && i >= 2) ? 0x55555555ULL : 0))
95 if (bb[0] != -6 || bb[1] != -6 || bb[N] != 22 || bb[3] != 84 || bb[4] != 127)
100 A<int> (*p3)[3][2] = &a3[2];
101 M<int> y3[5] = { 0, 1, 1, 1, 0 };
112 A<unsigned long long> a[9];
113 S() : x(p3), y(y3), w(w3), z(), a(), b() {}
114 __attribute__((noinline, noclone)) void foo (int, long, long, int, int, long, short, int, int);
119 S<N>::foo (int p1, long p2, long p3, int p4, int p5, long p6, short p7, int s, int t)
121 #pragma omp parallel for reduction(+:x[-1:p1 + 1][:p2][0:N], z[t + N:p3 + N - 2]) \
122 reduction(*:y[-s:p4]) reduction(|:a[s + 3:p5]) \
123 reduction(&:w[s + 1:p6 - 3 + N][t:p6]) reduction(maxb:b[N:])
124 for (int i = 0; i < 128; i++)
126 x[i / 64 - 1][i % 3][(i / 4) & 1].t += i;
133 z[i / 32 + 2].t += (i & 3);
136 a[i / 32 + 2].t |= 1ULL << (i & 30);
137 w[0][i & 1].t &= ~(1L << (i / 17 * 3));
142 if ((i % 192) > b[4])
151 static int a2[4][3][2] = {{{ 0, 0 }, { 0, 0 }, { 0, 0 }},
152 {{ 312, 381 }, { 295, 356 }, { 337, 335 }},
153 {{ 1041, 975 }, { 1016, 1085 }, { 935, 1060 }},
154 {{ 0, 0 }, { 0, 0 }, { 0, 0 }}};
155 A<int> (*p)[3][2] = &a[2];
156 M<int> y[5] = { 0, 1, 1, 1, 0 };
157 int y2[5] = { 0, 6561, 2401, 289, 0 };
158 char z2[10] = { 0, 0, 48, 49, 50, 51, 0, 0, 0, 0 };
160 foo<2> (p, y, w, 1, 3L, 4L, 3, 4, 2L, 5, -1, 0);
161 for (int i = 0; i < 4; i++)
162 for (int j = 0; j < 3; j++)
163 for (int k = 0; k < 2; k++)
164 if (a[i][j][k].t != a2[i][j][k])
166 for (int i = 0; i < 5; i++)
169 for (int i = 0; i < 10; i++)
172 if (w[0][0].t != ~0x249249L || w[0][1].t != ~0x249249L)
175 s.foo (1, 3L, 4L, 3, 4, 2L, 5, -1, 0);
176 for (int i = 0; i < 9; i++)
177 if (s.a[i].t != ((i < 6 && i >= 2) ? 0x55555555ULL : 0))
179 for (int i = 0; i < 4; i++)
180 for (int j = 0; j < 3; j++)
181 for (int k = 0; k < 2; k++)
182 if (a3[i][j][k].t != a2[i][j][k])
184 for (int i = 0; i < 5; i++)
185 if (y3[i].t != y2[i])
187 for (int i = 0; i < 10; i++)
188 if (s.z[i].t != z2[i])
190 if (w3[0][0].t != ~0x249249L || w3[0][1].t != ~0x249249L)
192 if (s.b[0] != 0 || s.b[1] != 0 || s.b[2] != 22
193 || s.b[3] != 84 || s.b[4] != 127)