Debian Codegraph @

openmp/runtime/test/ompt/tasks/task_early_fulfill.c

raw
1 // clang-format off
2 // RUN: %libomp-compile && env OMP_NUM_THREADS='3' \
3 // RUN: %libomp-run | %sort-threads | FileCheck %s
4 // REQUIRES: ompt
5
6 // Checked gcc 10.1 still does not support detach clause on task construct.
7 // UNSUPPORTED: gcc-4, gcc-5, gcc-6, gcc-7, gcc-8, gcc-9, gcc-10
8 // gcc 11 introduced detach clause, but gomp interface in libomp has no support
9 // XFAIL: gcc-11, gcc-12
10 // clang supports detach clause since version 11.
11 // UNSUPPORTED: clang-10, clang-9, clang-8, clang-7
12 // icc compiler does not support detach clause.
13 // UNSUPPORTED: icc
14 // clang-format on
15
16 #include "callback.h"
17 #include <omp.h>
18
19 int main() {
20 #pragma omp parallel
21 #pragma omp master
22 {
23 omp_event_handle_t event;
24 #pragma omp task detach(event) if (0)
25 { omp_fulfill_event(event); }
26 #pragma omp taskwait
27 }
28 return 0;
29 }
30
31 // clang-format off
32 // Check if libomp supports the callbacks for this test.
33 // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_task_create'
34 // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_task_schedule'
35 // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_parallel_begin'
36 // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_parallel_end'
37 // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_implicit_task'
38 // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_mutex_acquire'
39 // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_mutex_acquired'
40 // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_mutex_released'
41
42 // CHECK: {{^}}0: NULL_POINTER=[[NULL:.*$]]
43
44 // CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_parallel_begin:
45 // CHECK-SAME: parent_task_id=[[PARENT_TASK_ID:[0-f]+]],
46 // CHECK-SAME: parent_task_frame.exit=[[NULL]],
47 // CHECK-SAME: parent_task_frame.reenter={{(0x)?[0-f]+}},
48 // CHECK-SAME: parallel_id=[[PARALLEL_ID:[0-f]+]],
49 // CHECK-SAME: requested_team_size=3,
50
51 // CHECK: {{^}}[[MASTER_ID]]: ompt_event_implicit_task_begin:
52 // CHECK-SAME: parallel_id=[[PARALLEL_ID]],
53 // CHECK-SAME: task_id=[[IMPLICIT_TASK_ID:[0-f]+]]
54
55 // CHECK: {{^}}[[MASTER_ID]]: ompt_event_task_create:
56 // CHECK-SAME: parent_task_id=[[IMPLICIT_TASK_ID]],
57 // CHECK-SAME: parent_task_frame.exit={{(0x)?[0-f]+}},
58 // CHECK-SAME: parent_task_frame.reenter={{(0x)?[0-f]+}},
59 // CHECK-SAME: new_task_id=[[TASK_ID:[0-f]+]],
60
61 // CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_task_schedule:
62 // CHECK-SAME: first_task_id=[[IMPLICIT_TASK_ID]],
63 // CHECK-SAME: second_task_id=[[TASK_ID]],
64 // CHECK-SAME: prior_task_status=ompt_task_switch=7
65
66 // CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_task_schedule:
67 // CHECK-SAME: first_task_id=[[TASK_ID]],
68 // CHECK-SAME: second_task_id=ffffffffffffffff,
69 // CHECK-SAME: prior_task_status=ompt_task_early_fulfill=5
70
71 // CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_task_schedule:
72 // CHECK-SAME: first_task_id=[[TASK_ID]],
73 // CHECK-SAME: second_task_id=[[IMPLICIT_TASK_ID]],
74 // CHECK-SAME: prior_task_status=ompt_task_complete=1
75 // clang-format on