Skip to content

Commit efa91a6

Browse files
authored
fix getting started example (#797)
1 parent c016d65 commit efa91a6

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

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)