repo.or.cz
/
gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Fix type compatibility for types with flexible array member 2/2 [PR113688,PR114713...
[gcc.git]
/
libgomp
/
testsuite
/
libgomp.oacc-c-c++-common
/
reduction-8.c
blob
d25060572b56bf159c50477bba8793e7e50380f7
1
const int
n
=
100
;
2
3
// Check async over parallel construct with reduction
4
5
int
6
async_sum
(
int
c
)
7
{
8
int
s
=
0
;
9
10
#pragma acc parallel loop num_gangs (10) gang reduction (+:s) async
11
for
(
int
i
=
0
;
i
<
n
;
i
++)
12
s
+=
i
+
c
;
13
14
#pragma acc wait
15
return
s
;
16
}
17
18
int
19
main
()
20
{
21
int
result
=
0
;
22
23
for
(
int
i
=
0
;
i
<
n
;
i
++)
24
result
+=
i
+
1
;
25
26
if
(
async_sum
(
1
) !=
result
)
27
__builtin_abort
();
28
29
return
0
;
30
}