Skip to content

Commit

Permalink
use np.random.default_rng with a seed consistently
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfikl authored and inducer committed Aug 6, 2022
1 parent 8bce4f6 commit c7718d2
Show file tree
Hide file tree
Showing 7 changed files with 275 additions and 257 deletions.
3 changes: 2 additions & 1 deletion doc/algorithm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,8 @@ Here's a usage example::
knl = InclusiveScanKernel(context, np.int32, "a+b")

n = 2**20-2**18+5
host_data = np.random.randint(0, 10, n).astype(np.int32)
rng = np.random.default_rng(seed=42)
host_data = rng.integers(0, 10, size=n, dtype=np.int32)
dev_data = cl_array.to_device(queue, host_data)

knl(dev_data)
Expand Down
Loading

0 comments on commit c7718d2

Please sign in to comment.