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
single
omp_single.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_single
()
6
{
7
int
nr_threads_in_single;
8
int
result
;
9
int
nr_iterations;
10
int
i
;
11
12
nr_threads_in_single = 0;
13
result
= 0;
14
nr_iterations = 0;
15
16
#pragma omp parallel private(i)
17
{
18
for
(
i
= 0;
i
<
LOOPCOUNT
;
i
++) {
19
#pragma omp single
20
{
21
#pragma omp flush
22
nr_threads_in_single++;
23
#pragma omp flush
24
nr_iterations++;
25
nr_threads_in_single--;
26
result
=
result
+ nr_threads_in_single;
27
}
28
}
29
}
30
return
((
result
== 0) && (nr_iterations ==
LOOPCOUNT
));
31
}
/* end of check_single*/
32
33
int
main
()
34
{
35
int
i
;
36
int
num_failed=0;
37
38
for
(
i
= 0;
i
<
REPETITIONS
;
i
++) {
39
if
(!
test_omp_single
()) {
40
num_failed++;
41
}
42
}
43
return
num_failed;
44
}
result
int result[2]
Definition:
cancellation_for_sections.c:13
i
#define i
Definition:
kmp_stub.cpp:87
test_omp_single
int test_omp_single()
Definition:
omp_single.c:5
main
int main()
Definition:
omp_single.c:33
omp_testsuite.h
LOOPCOUNT
#define LOOPCOUNT
Definition:
omp_testsuite.h:12
REPETITIONS
#define REPETITIONS
Definition:
omp_testsuite.h:13
Generated on Mon Jun 16 2025 04:18:25 for LLVM OpenMP by
1.9.6