pyopencl icon indicating copy to clipboard operation
pyopencl copied to clipboard

Support for cl_khr_image2d_from_buffer

Open andravin opened this issue 6 years ago • 2 comments

It appears that OpenCL 1.2 extension cl_khr_image2d_from_buffer is not completely supported.

This allows zero-copy creation of a 2D image from a buffer, provided that the buffer satisfies CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT and CL_DEVICE_IMAGE_PITCH_ALIGNMENT requirements.

It appears that pyopencl actually defines the CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT and CL_DEVICE_IMAGE_PITCH_ALIGNMENT attributes when cl_khr_image2d_from_buffer is defined, but still does not allow use of the buffer argument when constructing an Image with 2D shape.

Apologies if I am missing something. Hope this report was helpful.

reference: https://www.khronos.org/registry/OpenCL/specs/opencl-1.2-extensions.pdf https://software.intel.com/sites/default/files/managed/87/11/ImageFromBuffer.pdf

andravin avatar Jul 29 '17 19:07 andravin

Thanks for the report. I won't have time to do much about this myself in the near future, but I'd be happy to take a patch.

inducer avatar Jul 29 '17 20:07 inducer

OK cool, mostly wanted a sanity check in case I had missed something. I will take a crack at fixing it myself. Thanks for the quick feedback.

andravin avatar Jul 29 '17 20:07 andravin