On Sun, Apr 17, 2011 at 8:47 PM, Andreas Kloeckner
<[email protected]> wrote:
> Hi all,
>
> I'm considering replacing all transfer functions in PyOpenCL with a
> single new one, documented here:
>
> http://documen.tician.de/pyopencl/runtime.html#pyopencl.enqueue_copy
>
> The old transfer functions would continue to work for the foreseeable
> future, but print deprecation warnings.
>
> A prototype implementation of this is now in git. I'd be happy to hear
> your comments.
>
Hi,
first my comment: i think think it is a great idea to unify all
transfer functions into a single one.
but i started to change my code but ran into problems:
I'll skip the class around the snippets but i think it should be clear
whats going on..
i create a in Image:
self.device_buffer = cl.Image(ctx,self.flags,self.image_format,shape=self.shape)
and after running some kernels on it read it back to the host:
output_array = numpy.empty(self.shape,dtype='float32')
cl.enqueue_read_image(queue,self.device_buffer,(0,0),output_array.shape,output_array).wait()
this works as expected. but if i change the last line to:
cl.enqueue_copy(queue,output_array,self.device_buffer,origin=(0,0),region=output_array.shape).wait()
i get:
File
"/usr/local/lib/python2.6/dist-packages/pyopencl-2011.1beta3-py2.6-linux-x86_64.egg/pyopencl/__init__.py",
line 553, in enqueue_copy
return _cl._enqueue_read_image(queue, src, dest, **kwargs)
Boost.Python.ArgumentError: Python argument types in
pyopencl._cl._enqueue_read_image(CommandQueue, Image, numpy.ndarray)
did not match C++ signature:
_enqueue_read_image(pyopencl::command_queue {lvalue} queue,
pyopencl::image {lvalue} mem, boost::python::api::object origin,
boost::python::api::object region, boost::python::api::object hostbuf,
unsigned long row_pitch=0, unsigned long slice_pitch=0,
boost::python::api::object wait_for=None, bool is_blocking=True,
boost::python::api::object host_buffer=None)
_______________________________________________
PyOpenCL mailing list
[email protected]
http://lists.tiker.net/listinfo/pyopencl