Andreas Kloeckner, on 2010-10-28 21:19,  wrote:
> Hi Paul,
> 
> On Thu, 28 Oct 2010 14:45:05 -0700, Paul Ivanov <[email protected]> wrote:
> > I'm just getting my feet wet with OpenCL, so it is likely that
> > something is wrong on my end, but it seems like a lot of the
> > other tests pass, and this looks like just an error on the python
> > side, so I decided to ask on here.
> > 
> > I'm getting a bunch of erors like this (array.py:621)
> > >       size = int(ceil((stop-start)/step))
> > E       OverflowError: math range error
> > 
> > I appreciate any feedback,
> 
> I.e. I had better help you, hadn't I? :)

You're always looking out for us little people ;) and we
appreciate it very much.

> This is weird--I'm not understanding what's going on.
> 
> >         from math import ceil
> > >       size = int(ceil((stop-start)/step))
> > E       OverflowError: math range error
> 
> a) You can run each test in isolation by doing, e.g.
> 
> python test_clmath.py 'test_exp(cl.create_some_context)' 
> 
> b) In the failing line, can you print start, stop, step and their
> respective dtypes?

I only figured out that the error was on the Python side as I
typed the previous email, and should have had more patience to
just do the above myself.  

The argument to ceil was inf, because step was 0.0, since on line
63 of test_clmath, the step argument was passed as (b-a)/s with
all a,b,s all ints, and s>(b-a), hence the troubles.  

I fixed it here [1] (view in your browser using [2]), and
also made a one line change in test_clmath for the sizes, two of
which were both 1024 previously.

$ python test_clmath.py
==================== test session starts ====================
platform linux2 -- Python 2.5.2 -- pytest-1.3.4
test path 1: test_clmath.py
test_clmath.py ....................
================= 20 passed in 7.37 seconds =================

[1] http://git.pirsquared.org/pyopencl.git
[2] http://git.pirsquared.org/?p=pyopencl.git

-- 
Paul Ivanov
314 address only used for lists,  off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 

_______________________________________________
PyOpenCL mailing list
[email protected]
http://lists.tiker.net/listinfo/pyopencl

Reply via email to