Fix applied, thanks!

Andreas

On Sonntag 08 März 2009, Guy Billings wrote:
> Dear Andreas,
>
> I have recently started to play with CUDA. I dont know why but it
> captured my imagination somehow.
>
> I downloaded PyCUDA. It is really excellent. Thanks for doing this, it
> makes using CUDA much easier.
>
> I set it up on my computer (mac book pro, Mac OS X 10.5.6, Python
> 2.5). When I ran the demo_elementwise.py example I got the error:
>
> guy-billingss-macbook-pro:pycuda_examples guybillings$ python
> demo_elementwise.py
> Traceback (most recent call last):
>    File "demo_elementwise.py", line 6, in <module>
>      a_gpu = curand((50,))
>    File "/Library/Python/2.5/site-packages/pycuda-0.92-py2.5-
> macosx-10.5-i386.egg/pycuda/curandom.py", line 215, in rand
>      result.gpudata, numpy.random.randint(2**32), result.size)
>    File "mtrand.pyx", line 700, in mtrand.RandomState.randint
> OverflowError: long int too large to convert to int
>
> I also go this same error for any script calling numpy.random.randint.
> I did some digging around on the internet and found this post:
>
> http://www.mail-archive.com/[email protected]/msg03396
>.html
>
> Which explains the problem. I changed the file curandom.py in the base
> distribution so that line 700 goes from
>
> result.gpudata, numpy.random.randint(2**32), result.size)
>
> to
>
> result.gpudata, numpy.random.randint(2**31-1), result.size)
>
> and now it seems ok.
>
> Thought you might find this useful.
>
> Once again, thanks for a great bit of code.
>
> Yours sincerely
>
> Guy Billings, UK

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
PyCuda mailing list
[email protected]
http://tiker.net/mailman/listinfo/pycuda_tiker.net

Reply via email to