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
for
omp_nonmonotonic_nowait.c
Go to the documentation of this file.
1
// RUN: %libomp-compile-and-run
2
3
// The test checks nonmonotonic scheduling works correctly when threads
4
// may execute different loops concurrently.
5
6
#include <stdio.h>
7
#include <omp.h>
8
9
#define N 200
10
#define C 20
11
int
main
()
12
{
13
int
i
, l0 = 0, l1 = 0;
14
#pragma omp parallel num_threads(8)
15
{
16
#pragma omp for schedule(nonmonotonic:dynamic,C) nowait
17
for
(
i
= 0;
i
<
N
; ++
i
) {
18
#pragma omp atomic
19
l0++;
20
}
21
#pragma omp for schedule(nonmonotonic:dynamic,C) nowait
22
for
(
i
= 0;
i
<
N
*
N
; ++
i
) {
23
#pragma omp atomic
24
l1++;
25
}
26
}
27
if
(l0 !=
N
|| l1 !=
N
*
N
) {
28
printf(
"failed l0 = %d, l1 = %d, should be %d %d\n"
, l0, l1,
N
,
N
*
N
);
29
return
1;
30
}
else
{
31
printf(
"passed\n"
);
32
return
0;
33
}
34
}
i
#define i
Definition:
kmp_stub.cpp:87
N
#define N
Definition:
omp_nonmonotonic_nowait.c:9
main
int main()
Definition:
omp_nonmonotonic_nowait.c:11
Generated on Mon Jul 21 2025 21:23:18 for LLVM OpenMP by
1.9.6