Work-Item Built-In Functions

Click an item in the table below for details about that function.

get_work_dim Number of dimensions in use
get_global_size Number of global work items
get_global_id Global work item ID value
get_local_size Number of local work items
get_enqueued_local_size Same as get_local_size(dimindx) if the kernel is executed with a uniform work-group size
get_local_id Local work item ID
get_num_groups Number of work groups
get_group_id Work group ID
get_global_offset Work offset
get_global_linear_id Work-items 1-dimensional global ID
get_local_linear_id Work-items 1-dimensional local ID

Functions enabled with the cl_khr_subgroups extension

get_sub_group_size Number of work-items in the subgroup
get_max_sub_group_size Maximum size of a subgroup
get_num_sub_groups Number of subgroup
get_enqueued_num_sub_groups Number of enqueued subgroups
get_sub_group_id The sub-group ID
get_sub_group_local_id The unique work-item ID within the current subgroup


Built-in work-item functions can be used to query the number of dimensions, the global and local work size specified to clEnqueueNDRangeKernel, and the global and local identifier of each work-item when this kernel is being executed on a device.


OpenCL Specification

Also see

clEnqueueNDRangeKernel, cl_khr_subgroups

Copyright © 2007-2013 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.