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
worksharing
sections
omp_parallel_sections_firstprivate.c
Go to the documentation of this file.
1
// RUN: %libomp-compile-and-run
2
#include <stdio.h>
3
#include "
omp_testsuite.h
"
4
5
int
test_omp_parallel_sections_firstprivate
()
6
{
7
int
sum
;
8
int
sum0
;
9
int
known_sum;
10
11
sum
=7;
12
sum0
=11;
13
14
#pragma omp parallel sections firstprivate(sum0)
15
{
16
#pragma omp section
17
{
18
#pragma omp critical
19
{
20
sum
=
sum
+
sum0
;
21
}
22
}
23
#pragma omp section
24
{
25
#pragma omp critical
26
{
27
sum
=
sum
+
sum0
;
28
}
29
}
30
#pragma omp section
31
{
32
#pragma omp critical
33
{
34
sum
=
sum
+
sum0
;
35
}
36
}
37
}
38
39
known_sum=11*3+7;
40
return
(known_sum==
sum
);
41
}
/* end of check_section_firstprivate*/
42
43
int
main
()
44
{
45
int
i
;
46
int
num_failed=0;
47
48
for
(
i
= 0;
i
<
REPETITIONS
;
i
++) {
49
if
(!
test_omp_parallel_sections_firstprivate
()) {
50
num_failed++;
51
}
52
}
53
return
num_failed;
54
}
i
#define i
Definition:
kmp_stub.cpp:87
sum
int sum
Definition:
omp_for_schedule_runtime.c:19
test_omp_parallel_sections_firstprivate
int test_omp_parallel_sections_firstprivate()
Definition:
omp_parallel_sections_firstprivate.c:5
main
int main()
Definition:
omp_parallel_sections_firstprivate.c:43
omp_testsuite.h
REPETITIONS
#define REPETITIONS
Definition:
omp_testsuite.h:13
sum0
static int sum0
Definition:
omp_threadprivate.c:14
Generated on Mon Feb 24 2025 09:29:28 for LLVM OpenMP by
1.9.6