Is the value returned by get_local_id indexed relative to the group id or is it globally indexed.
Take the following example:
I am splitting a matrix up into small 4x4 blocks for processing. Each thread will compute the results for a single 4x4 block. So to find the (i,j) of that matrix do I need to simply refer to the get_local_id or do I need to offset by the group id.
I have the following to get group index:
// Block index
int gx = get_group_id(0);
int gy = get_group_id(1);
// Thread index
int tx = get_local_id(0);
int ty = get_local_id(1);
so which indexing should I do:
int mat_i = 4*tx;
int mat_j = 4*ty;
or
int mat_i = 4*tx + THREADS_PER_GROUP*4*gx;
int mat_j = 4*ty + THREADS_PER_GROUP*4*gy;