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_par_in_loop.c
Go to the documentation of this file.
1
// RUN: %libomp-c99-compile-and-run
2
//
3
#include <stdlib.h>
4
#include <stdio.h>
5
#include <math.h>
6
#include <omp.h>
7
8
#define TYPE long
9
#define MAX_ITER (TYPE)((TYPE)1000000)
10
#define EVERY (TYPE)((TYPE)100000)
11
12
int
main
(
int
argc,
char
* argv[]) {
13
TYPE
x =
MAX_ITER
;
14
omp_set_max_active_levels
(2);
15
omp_set_num_threads
(2);
16
#pragma omp parallel for schedule(nonmonotonic:dynamic,1)
17
for
(
TYPE
i
= 0;
i
< x;
i
++) {
18
int
tid = omp_get_thread_num();
19
omp_set_num_threads
(1);
20
#pragma omp parallel proc_bind(spread)
21
{
22
if
(
i
%
EVERY
== (
TYPE
)0)
23
printf(
"Outer thread %d at iter %ld\n"
, tid,
i
);
24
}
25
}
26
printf(
"passed\n"
);
27
return
0;
28
}
i
#define i
Definition:
kmp_stub.cpp:87
omp_set_max_active_levels
#define omp_set_max_active_levels
Definition:
kmp_stub.cpp:29
omp_set_num_threads
#define omp_set_num_threads
Definition:
kmp_stub.cpp:34
TYPE
#define TYPE
Definition:
omp_par_in_loop.c:8
EVERY
#define EVERY
Definition:
omp_par_in_loop.c:10
MAX_ITER
#define MAX_ITER
Definition:
omp_par_in_loop.c:9
main
int main()
Definition:
test-touch.c:21
Generated on Sat Jun 14 2025 07:53:27 for LLVM OpenMP by
1.9.6