Rivoreo Source Code Repositories
src.rivoreo.one
/
compiler-explorer
/
2d94bfa8c1919c85c1165cf8f0039ec67a532dbb
/
.
/
examples
/
cuda
/
default.cu
blob: e2eba826ecc6628c2591966d688877310a9b1798 [
file
] [
log
] [
blame
] [
raw
]
// Type your code here, or load an example.
__global__
void
square
(
int
*
array
,
int
n
)
{
int
tid
=
blockDim
.
x
*
blockIdx
.
x
+
threadIdx
.
x
;
if
(
tid
<
n
)
array
[
tid
]
=
array
[
tid
]
*
array
[
tid
];
}