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