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
tasking
task_reduction1.c
Go to the documentation of this file.
1
// RUN: %libomp-compile-and-run
2
3
// UNSUPPORTED: gcc-4, gcc-5, gcc-6, gcc-7, gcc-8
4
5
#include <stdio.h>
6
#include <stdlib.h>
7
8
int
a
= 0,
b
= 1;
9
10
int
main
(
int
argc,
char
**argv) {
11
12
#pragma omp parallel
13
#pragma omp single
14
{
15
#pragma omp taskgroup task_reduction(+: a) task_reduction(*: b)
16
{
17
int
i
;
18
for
(
i
= 1;
i
<= 5; ++
i
) {
19
#pragma omp task in_reduction(+: a) in_reduction(*: b)
20
{
21
a
+=
i
;
22
b
*=
i
;
23
#pragma omp task in_reduction(+: a)
24
{
25
a
+=
i
;
26
}
27
}
28
}
29
}
30
}
31
32
if
(
a
!= 30) {
33
fprintf(stderr,
"error: a != 30. Instead a = %d\n"
,
a
);
34
exit(EXIT_FAILURE);
35
}
36
if
(
b
!= 120) {
37
fprintf(stderr,
"error: b != 120. Instead b = %d\n"
,
b
);
38
exit(EXIT_FAILURE);
39
}
40
41
return
EXIT_SUCCESS;
42
}
i
#define i
Definition:
kmp_stub.cpp:87
b
int b
Definition:
task_reduction1.c:8
a
int a
Definition:
task_reduction1.c:8
main
int main()
Definition:
test-touch.c:21
Generated on Thu Jun 12 2025 12:16:49 for LLVM OpenMP by
1.9.6