Rivoreo Source Code Repositories
src.rivoreo.one
/
compiler-explorer
/
5f76052a4f1457c335b7c5454d4baa8f3a2a5dae
/
.
/
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
];
}