LLVM OpenMP
20.0.0git
Toggle main menu visibility
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
c
d
e
g
h
i
m
n
p
r
s
t
u
Functions
c
d
e
g
i
m
n
p
r
s
u
Variables
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
~
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
w
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
Typedefs
Enumerations
Enumerator
Related Functions
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
Typedefs
_
a
b
c
d
e
i
k
l
m
n
o
p
r
t
u
Enumerations
_
b
c
d
f
k
l
n
o
s
t
Enumerator
_
a
b
c
d
e
f
k
l
n
o
p
r
s
t
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
runtime
test
ompt
synchronization
taskgroup.c
Go to the documentation of this file.
1
// RUN: %libomp-compile-and-run | %sort-threads | FileCheck %s
2
// REQUIRES: ompt
3
// UNSUPPORTED: gcc-4, gcc-5, gcc-6, gcc-7
4
5
#include "
callback.h
"
6
#include <unistd.h>
7
#include <stdio.h>
8
9
int
main
()
10
{
11
int
condition
=0;
12
int
x=0;
13
#pragma omp parallel num_threads(2)
14
{
15
#pragma omp master
16
{
17
#pragma omp taskgroup
18
{
19
print_current_address
(1);
20
#pragma omp task
21
{
22
#pragma omp atomic
23
x++;
24
}
25
}
26
print_current_address
(2);
27
}
28
}
29
30
31
// Check if libomp supports the callbacks for this test.
32
// CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_task_create'
33
// CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_task_schedule'
34
// CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_cancel'
35
// CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_thread_begin'
36
37
38
// CHECK: {{^}}0: NULL_POINTER=[[NULL:.*$]]
39
40
// CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_taskgroup_begin: parallel_id=[[PARALLEL_ID:[0-9]+]], task_id=[[TASK_ID:[0-9]+]], codeptr_ra=[[RETURN_ADDRESS:0x[0-f]+]]
41
// CHECK-NEXT: {{^}}[[MASTER_ID]]: current_address={{.*}}[[RETURN_ADDRESS]]
42
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_wait_taskgroup_begin: parallel_id=[[PARALLEL_ID]], task_id=[[TASK_ID]], codeptr_ra=[[RETURN_ADDRESS:0x[0-f]+]]
43
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_wait_taskgroup_end: parallel_id=[[PARALLEL_ID]], task_id=[[TASK_ID]], codeptr_ra=[[RETURN_ADDRESS]]
44
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_taskgroup_end: parallel_id=[[PARALLEL_ID]], task_id=[[TASK_ID]], codeptr_ra=[[RETURN_ADDRESS]]
45
// CHECK-NEXT: {{^}}[[MASTER_ID]]: current_address={{.*}}[[RETURN_ADDRESS]]
46
47
return
0;
48
}
callback.h
print_current_address
#define print_current_address(id)
Definition:
callback.h:213
condition
int condition
Definition:
interoperability.cpp:15
main
int main()
Definition:
taskgroup.c:9
Generated on Sat Jun 14 2025 07:53:25 for LLVM OpenMP by
1.9.6