Skip to content

Commit

Permalink
Merge pull request #8244 from kmaehashi/fix-random-generator-state-size
Browse files Browse the repository at this point in the history
Fix Generator API parallelism
  • Loading branch information
takagi committed Mar 18, 2024
2 parents cf4d4e9 + a666ee8 commit 028889e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cupy/random/_bit_generator.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ class _cuRANDGenerator(BitGenerator):
# Raw kernel has problems with integers with the 64th bit set
self._seed = self._seed_seq.generate_state(1, numpy.uint32)[0]
if size < 0:
size = 8 * 256 * cupy.cuda.runtime.cudaDevAttrMultiProcessorCount
size = 8 * 256 * runtime.deviceGetAttribute(
runtime.cudaDevAttrMultiProcessorCount,
self._current_device_id)
self._size = size
cdef uint64_t b_size = self._type_size() * size
self._state = cupy.zeros(b_size, dtype=numpy.int8)
Expand Down

0 comments on commit 028889e

Please sign in to comment.