Hi Antoine,

Antoine Martin <[email protected]> writes:
> Is there a particular reason why when I declare a read-only image as
> input to my kernel, I have to make the input data buffer read-write?
> Attached is a test case, you can find a copy online here:
> https://www.xpra.org/trac/browser/xpra/trunk/src/tests/xpra/codecs/test_opencl_readonly_image.py
>
> And here is the output, it tries various buffer types:
> ERR: <type 'str'> buffer fails:       Cannot use string as modifiable buffer
> OK:  <class 'ctypes.c_char_Array_65536'> buffer
> OK:  <type 'buffer'> buffer
> ERR: <type 'buffer'> buffer fails:       buffer is read-only
>
> Since the memory is only ever used as input, I would much prefer keeping
> it in a read-only buffer.
> This a bit inconvenient for us as PyOpenCL is just one of many data
> consumers we have, and I've had to make all the memory buffers
> read-write, which potentially exposes us to more bugs.
> Is there a known workaround, or anything we can do to not require
> read-write memory?

Thanks for reporting this. Should be fixed in git.

Andreas

Attachment: pgpbwHaXfuHZR.pgp
Description: PGP signature

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

Reply via email to