everyone! I'm not really clear about the meaning of CL_UNORM_INT8, which is one of the available choice of value of cl_image_format.image_channel_data_type; what's specific about this type, and what's its difference with CL_UNSIGNED_INT8?
As far as storage is concerned, these types are identical. In both cases, each pixel channel value will be stored as an 8-bit integer, with values in the range 0-255. The difference comes when reading/writing the image from a kernel.
For the CL_UNSIGNED_INT8
type, you will use the read_imageui
and write_imageui
functions to access the image. These functions will return (or accept) an unsigned integer, with values in the same range as the storage type.
For the CL_UNORM_INT8
type, you will use the read_imagef
and write_imagef
functions to access to the image. These functions will return (or accept) a normalised floating point value, in the range 0.0f
- 1.0f
. Some devices (e.g. most GPUs) have hardware support for normalising texture values, so the conversion between integer and normalised floating point values will be very efficient.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With