repo.or.cz
/
llvm-project.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
[llvm] Stop including unordered_map (NFC)
[llvm-project.git]
/
openmp
/
runtime
/
test
/
tasking
/
omp_taskloop_taskwait.c
blob
6cb226461c8ebeff97faf032f90f186560a1a309
1
// RUN: %libomp-compile-and-run
2
#include <stdio.h>
3
#include <omp.h>
4
int
main
()
5
{
6
enum
{
ITERS
=
500
};
7
enum
{
SIZE
=
5
};
8
int
err
=
0
;
9
#pragma omp parallel num_threads(2) reduction(+:err)
10
{
11
int
r
=
0
;
12
int
i
;
13
#pragma omp taskloop grainsize(SIZE) shared(r) nogroup
14
for
(
i
=
0
;
i
<
ITERS
;
i
++) {
15
#pragma omp atomic
16
++
r
;
17
}
18
#pragma omp taskwait
19
printf
(
"%d
\n
"
,
r
);
20
if
(
r
!=
ITERS
)
21
err
++;
22
}
// end of parallel
23
if
(
err
!=
0
) {
24
printf
(
"failed, err = %d
\n
"
,
err
);
25
return
1
;
26
}
else
{
27
printf
(
"passed
\n
"
);
28
return
0
;
29
}
30
}