CLGETEVENTINFO(3clc)
β¨ NAME β¨
okay bestie, welcome to the OpenCL Manual β this is section 3clc, and today we're getting to know clGetEventInfo π
clGetEventInfo β it returns information about the event object. that's it, that's the whole vibe. it's giving "let me peek at your event, no big deal" π
πΈ SYNOPSIS πΈ
cl_int clGetEventInfo(cl_event event, cl_event_info param_name,
size_t param_value_size, void *param_value,
size_t *param_value_size_ret);
π PARAMETERS π
so here's the cast of characters, and yes every single one matters π«Ά
eventβ this is the event object you're interrogating, bestie. you're asking this specific one for its info. no cap πparam_valueβ a pointer to memory where the appropriate result you're querying gets dropped off. lowkey important detail: ifparam_valueisNULL, it just gets ignored. the function said "not my problem" πparam_value_sizeβ the size in bytes of the memory thatparam_valueis pointing at. this size must be β₯ the size of the return type as described in the table below. so like, size it right or else πparam_value_size_retβ returns the actual size in bytes of the data copied intoparam_value. and guess what, ifparam_value_size_retisNULL, it is ignored too. iconic "if you don't wanna know, you don't gotta know" energy π
ok so that's the setup, and we're literally just getting started β the rest of this page is still coming, don't go anywhere π¦
param_name β the info you're requesting, bestie β¨ It tells clGetEventInfo what to put in param_value. The supported param_name types and their returns are all right here:
CL_EVENT_COMMAND_QUEUEβ Return Type:cl_command_queue. Returns the command-queue associated withevent. For user event objects, aNULLvalue is returned.CL_EVENT_CONTEXTβ Return Type:cl_context. Returns the context associated withevent.CL_EVENT_COMMAND_TYPEβ Return Type:cl_command_type. Returns the command associated withevent. Can be one of these values:CL_COMMAND_NDRANGE_KERNELCL_COMMAND_TASKCL_COMMAND_NATIVE_KERNELCL_COMMAND_READ_BUFFERCL_COMMAND_WRITE_BUFFERCL_COMMAND_COPY_BUFFERCL_COMMAND_READ_IMAGECL_COMMAND_WRITE_IMAGECL_COMMAND_COPY_IMAGECL_COMMAND_COPY_BUFFER_TO_IMAGECL_COMMAND_COPY_IMAGE_TO_BUFFERCL_COMMAND_MAP_BUFFERCL_COMMAND_MAP_IMAGECL_COMMAND_UNMAP_MEM_OBJECTCL_COMMAND_MARKERCL_COMMAND_ACQUIRE_GL_OBJECTSCL_COMMAND_RELEASE_GL_OBJECTSCL_COMMAND_READ_BUFFER_RECTCL_COMMAND_WRITE_BUFFER_RECTCL_COMMAND_COPY_BUFFER_RECTCL_COMMAND_USERCL_COMMAND_BARRIERCL_COMMAND_MIGRATE_MEM_OBJECTSCL_COMMAND_FILL_BUFFERCL_COMMAND_FILL_IMAGECL_COMMAND_GL_FENCE_SYNC_OBJECT_KHR(ifcl_khr_gl_event(3clc)is enabled)CL_COMMAND_ACQUIRE_D3D10_OBJECTS_KHR(ifcl_khr_d3d10_sharing(3clc)is enabled)CL_COMMAND_RELEASE_D3D10_OBJECTS_KHR(ifcl_khr_d3d10_sharing(3clc)is enabled)CL_COMMAND_ACQUIRE_DX9_MEDIA_SURFACES_KHR(ifcl_khr_dx9_media_sharing(3clc)is enabled)CL_COMMAND_RELEASE_DX9_MEDIA_SURFACES_KHR(ifcl_khr_dx9_media_sharing(3clc)is enabled)CL_COMMAND_ACQUIRE_D3D11_OBJECTS_KHR(ifcl_khr_d3d11_sharing(3clc)is enabled)CL_COMMAND_RELEASE_D3D11_OBJECTS_KHR(ifcl_khr_d3d11_sharing(3clc)is enabled)
CL_EVENT_COMMAND_EXECUTION_STATUSβ Return Type:cl_int. Returns the execution status of the command identified byevent. The valid values are:CL_QUEUED(command has been enqueued in the command-queue),CL_SUBMITTED(enqueued command has been submitted by the host to the device associated with the command-queue),CL_RUNNING(device is currently executing this command),CL_COMPLETE(the command has completed), or- Error code given by a negative integer value. (command was abnormally terminated β this may be caused by a bad memory access etc.) These error codes come from the same set of error codes that are returned from the platform or runtime API calls as return values or
errcode_retvalues. π
okay bestie we're finishing the table, stay with me π
β¦and the way that CL_EVENT_COMMAND_EXECUTION_STATUS entry wraps up? Chef's kiss. The error code values are negative, and event state values are positive. The event state values are ordered from the largest value (CL_QUEUED) for the first or initial state, alllll the way down to the smallest value (CL_COMPLETE or negative integer value) for the last or complete state. And plot twist: the value of CL_COMPLETE and CL_SUCCESS are the same. iykyk.
CL_EVENT_REFERENCE_COUNTβ typecl_uint. Returns the event reference count. β οΈ The reference count returned should be considered immediately stale β it is unsuitable for general use in applications. This feature is provided for identifying memory leaks. So likeβ¦ it's a vibe check, not a receipt, fr fr.
πΈ NOTES πΈ
Using clGetEventInfo to determine if a command identified by event has finished execution (i.e. CL_EVENT_COMMAND_EXECUTION_STATUS returns CL_COMPLETE) is not a synchronization point. There are no guarantees that the memory objects being modified by the command associated with event will be visible to other enqueued commands.
no cap, bestie β "it says COMPLETE" does not mean "and also everything it touched is now safe to read." that's a whole different conversation. don't do it. π«Ά
π ERRORS π
Returns CL_SUCCESS if the function executed successfully, or one of the errors below:
CL_INVALID_VALUEβ if param_name is not valid, or if size in bytes specified by param_value_size is< size of return typeas described in the table above and param_value is notNULL.CL_INVALID_VALUEβ if information to query given in param_name cannot be queried for event.CL_INVALID_EVENTβ if event is not a valid event object.CL_OUT_OF_RESOURCESβ if there is a failure to allocate resources required by the OpenCL implementation on the device.CL_OUT_OF_HOST_MEMORYβ if there is a failure to allocate resources required by the OpenCL implementation on the host.
π 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 π
- OpenCL Specification page 180, section 5.9 - Event Objects
and that's the whole page, bestie, we ate and left zero crumbs π β¨
Shoutout to The Khronos Group for writing this, dated 01/14/2021, living under the name CLGETEVENTINFO(3clc) β go read clWaitForEvents if you actually want to wait on something, mwah ππ¦
π¦ 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