LLVM OpenMP
22.0.0git
runtime
test
ompt
misc
threads.c
Go to the documentation of this file.
1
// clang-format off
2
// RUN: %libomp-compile-and-run | %sort-threads | FileCheck %s
3
// REQUIRES: ompt
4
// clang-format on
5
#include "
callback.h
"
6
#include <omp.h>
7
8
int
main
() {
9
int
x = 0;
10
#pragma omp parallel num_threads(4)
11
{
12
#pragma omp atomic
13
x++;
14
}
15
16
// clang-format off
17
// CHECK: 0: NULL_POINTER=[[NULL:.*$]]
18
19
// CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_thread_begin:
20
// CHECK-SAME: thread_type=ompt_thread_initial=1, thread_id=[[MASTER_ID]]
21
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_thread_end:
22
// CHECK-SAME: thread_id=[[MASTER_ID]]
23
// CHECK: {{^}}[[WORKER_ID1:[0-9]+]]: ompt_event_thread_begin:
24
// CHECK-SAME: thread_type=ompt_thread_worker=2, thread_id=[[WORKER_ID1]]
25
// CHECK: {{^}}[[WORKER_ID1]]: ompt_event_thread_end:
26
// CHECK-SAME: thread_id=[[WORKER_ID1]]
27
// CHECK: {{^}}[[WORKER_ID2:[0-9]+]]: ompt_event_thread_begin:
28
// CHECK-SAME: thread_type=ompt_thread_worker=2, thread_id=[[WORKER_ID2]]
29
// CHECK: {{^}}[[WORKER_ID2]]: ompt_event_thread_end:
30
// CHECK-SAME: thread_id=[[WORKER_ID2]]
31
// CHECK: {{^}}[[WORKER_ID3:[0-9]+]]: ompt_event_thread_begin:
32
// CHECK-SAME: thread_type=ompt_thread_worker=2, thread_id=[[WORKER_ID3]]
33
// CHECK: {{^}}[[WORKER_ID3]]: ompt_event_thread_end:
34
// CHECK-SAME: thread_id=[[WORKER_ID3]]
35
// clang-format on
36
37
return
0;
38
}
callback.h
main
int main()
Definition
threads.c:8
Generated on
for LLVM OpenMP by
1.14.0