Skip to content

Commit aace5d0

Browse files
committed
fix getting started example
1 parent 926b4e6 commit aace5d0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cuda_core/docs/source/getting-started.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ and a corresponding {class}`Stream <cuda.core.experimental.Stream>`.
4949
Don't forget to use {meth}`Device.set_current() <cuda.core.experimental.Device.set_current>`!
5050

5151
```python
52+
import cupy as cp
5253
from cuda.core.experimental import Device, LaunchConfig, Program, ProgramOptions, launch
5354

5455
dev = Device()
@@ -76,6 +77,7 @@ ker = mod.get_kernel("vector_add<float>")
7677

7778
# Prepare input/output arrays (using CuPy)
7879
size = 50000
80+
rng = cp.random.default_rng()
7981
a = rng.random(size, dtype=cp.float32)
8082
b = rng.random(size, dtype=cp.float32)
8183
c = cp.empty_like(a)

0 commit comments

Comments
 (0)