It does make sense to send host-side buffers over the network though, or as
a way to save a state to file.
You could do the same with device buffers (with an auto copy from device
memory when pickling and to device when unpicking) although you'd need to
disambiguate which device you wish to unpickle to, maybe through a
module-wide switch...

On 17 Aug 2016 05:44, "Andreas Kloeckner" <li...@informa.tiker.net> wrote:

> Hi Marcos,
>
> Marcos Paulo Rocha <marka...@gmail.com> writes:
> > Hi, i'm using multiprocessing and pyopencl and need to pass pyopencl
> > objects between processes. The problem is that pyopencl objects aren't
> > compatibles with pickle module, using by multiprocessing lib. Any idea to
> > solve this problem ?
>
> Honestly, the only PyOpenCL object that I could think of that we could
> meaningfully pickle is a device. Contexts, command queues, buffers, and
> all the other stuff are not likely to make sense in the context of
> another process. (At the OpenCL API level they're pointers, and they
> each carry substantial non-enumerable state that we just can't package
> up.) But even for devices, you're probably better off sending (platform
> name, device name, index) triples...
>
> Sorry,
> Andreas
>
> _______________________________________________
> PyOpenCL mailing list
> PyOpenCL@tiker.net
> https://lists.tiker.net/listinfo/pyopencl
>
_______________________________________________
PyOpenCL mailing list
PyOpenCL@tiker.net
https://lists.tiker.net/listinfo/pyopencl

Reply via email to