GET_IMAGE_CHANNEL_OR(3clc)
GET_IMAGE_CHANNEL_OR π β¨
okay so this is a page from the OpenCL Manual, and bestie it's about one (1) function and the way it will tell you exactly what channel order your image is giving. no cap. let's go π«Ά
πΈ NAME πΈ
get_image_channel_order β Return the image channel data order.
here's the whole squad of overloads, literally all six of them, character for character:
int get_image_channel_order(image1d_t image);
int get_image_channel_order(image1d_buffer_t image);
int get_image_channel_order(image2d_t image);
int get_image_channel_order(image3d_t image);
int get_image_channel_order(image1d_array_t image);
int get_image_channel_order(image2d_array_t image);
π¦ DESCRIPTION π¦
it returns the image channel order, periodt. the valid values are these iconic little guys and you do not get to invent new ones:
CLK_ACLK_RCLK_RxCLK_RGCLK_RGxCLK_RACLK_RGBCLK_RGBxCLK_RGBACLK_ARGBCLK_BGRACLK_INTENSITYCLK_LUMINANCE
π NOTES π
so the values that get_image_channel_order hands back, the ones with the CLK_ prefixes up there, they correspond to the CL_ prefixes used to describe the image channel order and data type in the table of supported names and values in clCreateSubBuffer(3clc), and in the list of supported Image Channel Order Values for clCreateImage(3clc). iykyk. for example β and this is the example, fr fr β both CL_UNORM_INT8 and CLK_UNORM_INT8 refer to an image channel data type that is an unnormalized unsigned 8-bit integer. same thing, different outfit. π
π the mapping table (but make it a list, because vibes) π
the following table describes the mapping of the number of channels of an image element to the appropriate components in the float4, int4 or uint4 vector data type, for the color values returned by read_image{f|i|ui} or supplied to write_image{f|i|ui}. the unmapped components will be set to 0.0 for red, green and blue channels, and will be set to 1.0 for the alpha channel. noted. π
here's the channel order β the float4, int4 or unsigned int4 components of channel data:
CL_R,CL_Rxβ(r, 0.0, 0.0, 1.0)CL_Aβ(0.0, 0.0, 0.0, a)CL_RG,CL_RGxβ(r, g, 0.0, 1.0)CL_RAβ(r, 0.0, 0.0, a)CL_RGB,CL_RGBxβ(r, g, b, 1.0)CL_RGBA,CL_BGRA,CL_ARGBβ(r, g, b, a)CL_INTENSITYβ(I, I, I, I)CL_LUMINANCEβ(L, L, L, 1.0)
π the sampler tea (read this one, it's giving warning) π
a kernel that uses a sampler with the CL_ADDRESS_CLAMP addressing mode with multiple images may result in additional samplers being used internally by an implementation. so if the same sampler is used with multiple images called via read_imagef2d(3clc), then it is possible that an implementation may need to allocate an additional sampler to handle the different border color values that may be needed depending on the image formats being used. lowkey sneaky of it.
these implementation-allocated samplers will count against the maximum sampler values supported by the device, given by CL_DEVICE_MAX_SAMPLERS. so budget accordingly bestie π«Ά
and enqueuing a kernel that requires more samplers than the implementation can support will result in a CL_OUT_OF_RESOURCES error being returned. that's the whole thing just πing on you. dramatic but true.
β SPECIFICATION β
OpenCL Specification[1]
π SEE ALSO π
π AUTHORS π
The Khronos Group
π COPYRIGHT π
Copyright Β© 2007-2011 The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and/or associated documentation files (the "Materials"), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Materials, and to permit persons to whom the Materials are furnished to do so, subject to the condition that this copyright notice and permission notice shall be included in all copies or substantial portions of the Materials.
π NOTES (yes, again, this is the footnote one) π
OpenCL Specificationpage 292, section 6.12.14 - Image Read and Write Functions
and that's the whole page bestie, no crumbs left π
cute little sign-off: this one's brought to you by The Khronos Group, dated 01/14/2021, filed under GET_IMAGE_CHANNEL_OR(3clc). slay, stay hydrated, go check your channel orders πβ¨π
π¦ where this page comes from
- ubuntu jammy: opencl-1.2-man-doc 1.0~svn33624-5 Β· other
- ubuntu noble: opencl-1.2-man-doc 1.0~svn33624-5 Β· other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms