repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
C++: simplify output from suggest_alternatives_for
[official-gcc.git]
/
libgomp
/
testsuite
/
libgomp.oacc-c-c++-common
/
kernels-reduction.c
blob
8647a9432fc6cacee993491ebf06a1fec56743d0
1
#include <stdlib.h>
2
3
#define n 10000
4
5
unsigned int
a
[
n
];
6
7
void
__attribute__
((
noinline
,
noclone
))
8
foo
(
void
)
9
{
10
int
i
;
11
unsigned int
sum
=
1
;
12
13
#pragma acc kernels copyin (a[0:n]) copy (sum)
14
{
15
for
(
i
=
0
;
i
<
n
; ++
i
)
16
sum
+=
a
[
i
];
17
}
18
19
if
(
sum
!=
5001
)
20
abort
();
21
}
22
23
int
24
main
()
25
{
26
int
i
;
27
28
for
(
i
=
0
;
i
<
n
; ++
i
)
29
a
[
i
] =
i
%
2
;
30
31
foo
();
32
33
return
0
;
34
}