CLENQUEUEFILLIMAGE(3clc)
π NAME π
okay so bestie, meet clEnqueueFillImage β she queues up a command that fills an image object with a specified color. no cap, that's literally her whole job and she does it flawlessly. π
this page lives in the OpenCL Manual, section 3clc, and yes we're getting into the good stuff. π¦
cl_int clEnqueueFillImage(cl_command_queue command_queue, cl_mem image,
const void *fill_color, const size_t *origin,
const size_t *region,
cl_uint num_events_in_wait_list,
const cl_event *event_wait_list,
cl_event *event);
β¨ PARAMETERS β¨
command_queueβ the command-queue where this fill command is gonna get queued. π important: the OpenCL context associated withcommand_queueandimagemust be the same. same context or it's giving red flag energy, fr fr.imageβ a valid image object. that's it, that's the requirement. πfill_colorβ the fill color, and bestie the type depends on your image channel data type, so listen up:- it's a four component RGBA floating-point color value if the image channel data type is not an unnormalized signed and unsigned integer type,
- it's a four component signed integer value if the image channel data type is an unnormalized signed integer type,
- and it's a four component unsigned integer value if the image channel data type is an unormalized unsigned integer type.
the fill color will be converted to the appropriate image channel format and order associated with image. the way it just adapts? iconic. β¨
originβ this one defines the(x, y, z)offset in pixels in the 1D, 2D, or 3D image, the(x, y)offset and the image index in the image array, or the(x)offset and the image index in the 1D image array. and the rules, because there are always rules:- if
imageis a 2D image object,origin[2]must be0. - if
imageis a 1D image or 1D image buffer object,origin[1]andorigin[2]must be0. - if
imageis a 1D image array object,origin[2]must be0. - if
imageis a 1D image array object,origin[1]describes the image index in the 1D image array. - if
imageis a 2D image array object,origin[2]describes the image index in the 2D image array.
- if
regionβ defines the(width, height, depth)in pixels of the 1D, 2D or 3D rectangle, the(width, height)in pixels of the 2D rectangle and the number of images of a 2D image array, or the(width)in pixels of the 1D rectangle and the number of images of a 1D image array. rules again, sorry bestie:- if
imageis a 2D image object,region[2]must be1. - if
imageis a 1D image or 1D image buffer object,region[1]andregion[2]must be1. - if
imageis a 1D image array object,region[2]must be1.
- if
event_wait_list,num_events_in_wait_listβ these specify events that need to complete before this particular command can be executed. the deets:- if
event_wait_listisNULL, then this particular command does not wait on any event to complete. π«Ά - if
event_wait_listisNULL,num_events_in_wait_listmust be0. - if
event_wait_listis notNULL, the list of events pointed to byevent_wait_listmust be valid andnum_events_in_wait_listmust be greater than0. - the events specified in
event_wait_listact as synchronization points. β - the context associated with events in
event_wait_listandcommand_queuemust be the same. - the memory associated with
event_wait_listcan be reused or freed after the function returns. so efficient, we love her.
- if
eventβ returns an event object that identifies this particular write command and can be used to query or queue a wait for this particular command to complete.eventcan beNULL, in which case it will not be possible for the application to query the status of this command or queue a wait for this command to complete β and in that caseclEnqueueBarrierWithWaitList(3clc)can be used instead. π§ if theevent_wait_listand theeventarguments are notNULL, theeventargument should not refer to an element of theevent_wait_listarray. noted, no cap.
πΈ NOTES πΈ
the usage information which indicates whether the memory object can be read or written by a kernel and/or the host, and is given by the cl_mem_flags argument value specified when image is created, is ignored by clEnqueueFillImage.
she literally does not care. ignored. periodt. π
π₯ ERRORS π₯
clEnqueueFillImage returns CL_SUCCESS if the function is executed successfully. otherwise, she returns one of the following errors, bestie:
CL_INVALID_COMMAND_QUEUEifcommand_queueis not a valid command-queue.CL_INVALID_CONTEXTif the context associated withcommand_queueandimageare not the same, or if the context associated withcommand_queueand events inevent_wait_listare not the same.CL_INVALID_MEM_OBJECTifimageis not a valid image object.CL_INVALID_VALUEiffill_colorisNULL.CL_INVALID_VALUEif the region being written specified byoriginandregionis out of bounds, or ifptris aNULLvalue.CL_INVALID_VALUEif values inoriginandregiondo not follow rules described in the argument description fororiginandregion.CL_INVALID_EVENT_WAIT_LISTifevent_wait_listisNULLandnum_events_in_wait_list>0, orevent_wait_listis notNULLandnum_events_in_wait_listis0, or if event objects inevent_wait_listare not valid events.CL_INVALID_IMAGE_SIZEif image dimensions (image width, height, specified or compute row and/or slice pitch) forimageare not supported by device associated with queue.CL_INVALID_IMAGE_FORMATif image format (image channel order and data type) forimageare not supported by device associated with queue.CL_MEM_OBJECT_ALLOCATION_FAILUREif there is a failure to allocate memory for data store associated withimage.CL_OUT_OF_RESOURCESif there is a failure to allocate resources required by the OpenCL implementation on the device. πCL_OUT_OF_HOST_MEMORYif there is a failure to allocate resources required by the OpenCL implementation on the host. π
π SPECIFICATION π
OpenCL Specification[1]
π SEE ALSO π
clEnqueueReadImage(3clc), clEnqueueWriteImage(3clc), clEnqueueCopyImage(3clc), clEnqueueBarrierWithWaitList(3clc)
the whole friend group, honestly. go say hi. π«Ά
π 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 π
- OpenCL Specification page 105, section 5.3.3 - Reading, Writing and Copying Image Objects
and that's the whole page, bestie!! π brought to you by The Khronos Group, dated 01/14/2021, and filed under CLENQUEUEFILLIMAGE(3clc) in the OpenCL Manual. slay, you read the whole thing π¦β¨
π¦ 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