Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arithmetic overflow when passing large integer range to RNG #150

Open
mattwala opened this issue Nov 2, 2016 · 0 comments
Open

Arithmetic overflow when passing large integer range to RNG #150

mattwala opened this issue Nov 2, 2016 · 0 comments

Comments

@mattwala
Copy link
Contributor

mattwala commented Nov 2, 2016

Running this snippet results in the following error:

File "test.py", line 11, in <module>
  rand(q, shape=(), a=np.iinfo(dt).min, b=np.iinfo(dt).max, dtype=dt)
File "/home/matt/src/pyopencl/pyopencl/clrandom.py", line 741, in rand
  gen.fill_uniform(result, a=a, b=b))
File "/home/matt/src/pyopencl/pyopencl/clrandom.py", line 651, in fill_uniform
  scale=(b-a), shift=a, queue=queue)
File "/home/matt/src/pyopencl/pyopencl/clrandom.py", line 638, in _fill
  evt = knl(queue, gsize, lsize, *args)
File "/home/matt/src/pyopencl/pyopencl/cffi_cl.py", line 1964, in __call__
  return self._enqueue(self, queue, global_size, local_size, *args, **kwargs)
File "<generated function enqueue_knl_generate>", line 81, in enqueue_knl_generate
struct.error: 'i' format requires -2147483648 <= number <= 2147483647

This is probably due to the fact that b-a is out of range.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant