Hi Máté,
If I understand the problem here correctly, you are trying to create the appropriate accessor for an image of lower channel size and channel order such as image_channel_order::r
and image_channel_type::int8
, where each pixel is a single 8bit element.
In SYCL, like in OpenCL, there is not a one-to-one mapping of an image’s channel order and type to the in-kernel type that represents a pixel. Images are always read as either a cl_float4
, cl_half4
, cl_int4
or cl_uint4
, so these are the only valid data types for an image accessor. The image data in memory will be interpreted in the image’s channel order and type, but pixels are always read from or written to as a 4-dimensional vector.
So in the case where you have an image with image_channel_order::r
and image_channel_type::int8
, you would use the data type cl_int4
, which would map to {r, 0.0, 0.0, 1.0}. The OpenCL 1.2 specification describes the mapping of the different channel orders and types in more detail in section 6.12.14.6.
I hope this helps.
Gordon