Dear Sebastian,

Sebastian Hoffmann <[email protected]> writes:
> I've just finished writing my first pyopencl program. While the OpenCL C
> part build()s, calling it fails with a TypeError in pyopencl/__init__.py
> I'm trying to run this on an Ubuntu 13.10 saucy with the python-pyopencl
> 2013.1~git20130613-1 provided in the Ubuntu repo (I've tried installing the
> 2013.2 version via pip, but run into compile errors due to it not finding
> CL/cl.h in /opt/AMDAPP/include/; how can I tell pip that it should make the
> compiler look there?).
>
> Here are call, traceback and error:
>
>     program.simulate(queue, instances, None,
>                      np.int32(num_particles),
>                      position_buf,
>                      dest_buf)
>
> Traceback (most recent call last):
>   File "./particle_sim.py", line 88, in <module>
>     simulate()
>   File "./particle_sim.py", line 65, in simulate
>     dest_buf)
>   File "/usr/lib/python2.7/dist-packages/pyopencl/__init__.py", line 567,
> in kernel_call
>     global_offset, wait_for, g_times_l=g_times_l)
> TypeError: object of type 'int' has no len()
>
> The full code is in the attachment for error-reproduction (and, as I've
> learned in the meantime, as an example on how not to do pairwise
> computation of particle influences). Thanks in advance.

Simple fix:

program.simulate(queue, (instances,), None, ...)

The grid size needs to be a tuple.

HTH,
Andreas

Attachment: pgp_06oC7zRok.pgp
Description: PGP signature

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

Reply via email to