Rivoreo Source Code Repositories
src.rivoreo.one
/
compiler-explorer
/
6cebfc3cc8f11c3af4f79d92a69d5f6a4773bd62
/
.
/
examples
/
cpp_for_opencl
/
default.clcpp
blob: 6845eaa60e017c5f8bfff0a31799fd96eaa59bda [
file
] [
log
] [
blame
] [
raw
]
template
<
typename
T
>
T add
(
T a
,
T b
)
{
return
a
+
b
;
}
kernel
void
k
(
global
int
*
in1
,
global
int
*
in2
,
global
int
*
out
)
{
auto
index
=
get_global_id
(
0
);
out
[
index
]
=
add
(
in1
[
index
],
in2
[
index
]);
}