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