2 foo (int x
, int *y
, int n
, int v
)
4 int z
[3] = { 45, 46, 47 };
6 for (i
= 0; i
< n
; i
++)
8 #pragma omp taskgroup task_reduction (+: x, y[:2], z[1:2], u, w[1:v])
10 #pragma omp task in_reduction (+: x, y[:2], z[1:2], u, w[1:v])
19 #pragma omp target in_reduction (+: x, y[:2], z[1:2], u, w[1:v])
28 #pragma omp target in_reduction (+: x, y[:v], z[1:v], u, w[1:2])
38 if (x
!= 56 || y
[0] != 60 || y
[1] != 64)
40 if (z
[0] != 45 || z
[1] != 62 || z
[2] != 54)
42 if (u
[0] != 8 || u
[1] != 12 || u
[2] != 18)
44 if (w
[0] != 3 || w
[1] != 24 || w
[2] != 12)
49 bar (int x
, int *y
, int n
, int v
)
51 int z
[3] = { 45, 46, 47 };
53 for (i
= 0; i
< n
; i
++)
55 #pragma omp parallel master
56 #pragma omp taskgroup task_reduction (+: x, y[:2], z[1:2], u, w[1:v])
58 #pragma omp task in_reduction (+: x, y[:2], z[1:2], u, w[1:v])
67 #pragma omp target in_reduction (+: x, y[:2], z[1:2], u, w[1:v])
76 #pragma omp target in_reduction (+: x, y[:v], z[1:v], u, w[1:2])
86 if (x
!= 56 || y
[0] != 77 || y
[1] != 84)
88 if (z
[0] != 45 || z
[1] != 62 || z
[2] != 54)
90 if (u
[0] != 8 || u
[1] != 12 || u
[2] != 18)
92 if (w
[0] != 3 || w
[1] != 24 || w
[2] != 12)
99 int y
[2] = { 43, 44 };
100 #pragma omp parallel master