Returns the work-items 1-dimensional global ID.

size_t get_global_linear_id(uint)

Description

Returns the work-items 1-dimensional global ID. For 1D work-groups, it is computed as get_global_id(0) – get_global_offset(0).

For 2D work-groups, it is computed as (get_global_id(1) - get_global_offset(1)) * get_global_size(0) + (get_global_id(0) - get_global_offset(0)).

For 3D work-groups, it is computed as get_global_id(2) – get_global_offset(2 * get_global_size(1) * get_global_size(0)) + get_global_id(1) – get_global_offset(1 * get_global_size(0)) + (get_global_id(0) – get_global_offset(0)).

Also see

Specification