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_parallel_for_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_for_firstprivate
()
6
{
7
int
sum
;
8
int
i2;
9
int
i
;
10
int
known_sum;
11
12
sum
=0;
13
i2=3;
14
15
#pragma omp parallel for reduction(+:sum) private(i) firstprivate(i2)
16
for
(
i
= 1;
i
<=
LOOPCOUNT
;
i
++) {
17
sum
=
sum
+ (
i
+ i2);
18
}
19
20
known_sum = (
LOOPCOUNT
* (
LOOPCOUNT
+ 1)) / 2 + i2 *
LOOPCOUNT
;
21
return
(known_sum ==
sum
);
22
}
/* end of check_parallel_for_fistprivate */
23
24
int
main
()
25
{
26
int
i
;
27
int
num_failed=0;
28
29
for
(
i
= 0;
i
<
REPETITIONS
;
i
++) {
30
if
(!
test_omp_parallel_for_firstprivate
()) {
31
num_failed++;
32
}
33
}
34
return
num_failed;
35
}
i
#define i
Definition:
kmp_stub.cpp:87
sum
int sum
Definition:
omp_for_schedule_runtime.c:19
main
int main()
Definition:
omp_parallel_for_firstprivate.c:24
test_omp_parallel_for_firstprivate
int test_omp_parallel_for_firstprivate()
Definition:
omp_parallel_for_firstprivate.c:5
omp_testsuite.h
LOOPCOUNT
#define LOOPCOUNT
Definition:
omp_testsuite.h:12
REPETITIONS
#define REPETITIONS
Definition:
omp_testsuite.h:13
Generated on Sat Jun 7 2025 20:44:01 for LLVM OpenMP by
1.9.6