1 // RUN: %libomp-c99-compile-and-run | %sort-threads | FileCheck %s
3 // UNSUPPORTED: gcc-4, gcc-5, gcc-6, gcc-7
9 #pragma omp parallel num_threads(2)
10 #pragma omp for ordered(2)
11 for (int i
= 0; i
< 2; i
++)
12 for (int j
= 0; j
< 2; j
++) {
14 printf("%d, %d\n", i
, j
);
15 #pragma omp ordered depend(sink : i - 1, j) depend(sink : i, j - 1)
17 a
[i
][j
] = a
[i
- 1][j
] + a
[i
][j
- 1] + 1;
18 printf("%d, %d\n", i
, j
);
19 #pragma omp ordered depend(source)
24 // CHECK: 0: NULL_POINTER=[[NULL:.*$]]
26 // CHECK: {{^}}[[MASTER:[0-9]+]]: ompt_event_loop_begin:
27 // CHECK-SAME: parallel_id={{[0-9]+}}, parent_task_id=[[ITASK:[0-9]+]],
29 // CHECK: {{^}}[[MASTER]]: ompt_event_dependences: task_id=[[ITASK]],
30 // CHECK-SAME: deps=[(0, ompt_dependence_type_source), (0,
31 // CHECK-SAME: ompt_dependence_type_source)], ndeps=2
33 // CHECK: {{^}}[[MASTER]]: ompt_event_dependences: task_id=[[ITASK]],
34 // CHECK-SAME: deps=[(0, ompt_dependence_type_sink), (0,
35 // CHECK-SAME: ompt_dependence_type_sink)], ndeps=2
37 // CHECK: {{^}}[[MASTER]]: ompt_event_dependences: task_id=[[ITASK]],
38 // CHECK-SAME: deps=[(0, ompt_dependence_type_source), (1,
39 // CHECK-SAME: ompt_dependence_type_source)], ndeps=2
41 // CHECK: {{^}}[[WORKER:[0-9]+]]: ompt_event_loop_begin:
42 // CHECK-SAME: parallel_id={{[0-9]+}}, parent_task_id=[[ITASK:[0-9]+]],
44 // CHECK: {{^}}[[WORKER]]: ompt_event_dependences: task_id=[[ITASK]],
45 // CHECK-SAME: deps=[(0, ompt_dependence_type_sink), (0,
46 // CHECK-SAME: ompt_dependence_type_sink)], ndeps=2
48 // CHECK: {{^}}[[WORKER]]: ompt_event_dependences: task_id=[[ITASK]],
49 // CHECK-SAME: deps=[(1, ompt_dependence_type_source), (0,
50 // CHECK-SAME: ompt_dependence_type_source)], ndeps=2
52 // either can be first for last iteration
54 // CHECK-DAG: [[ITASK]]{{.*}}deps=[(0{{.*}}sink), (1,{{.*}}sink)]
56 // CHECK-DAG: [[ITASK]]{{.*}}deps=[(1{{.*}}sink), (0,{{.*}}sink)]
58 // CHECK: {{^}}[[WORKER]]: ompt_event_dependences: task_id=[[ITASK]],
59 // CHECK-SAME: deps=[(1, ompt_dependence_type_source), (1,
60 // CHECK-SAME: ompt_dependence_type_source)], ndeps=2