Questions on performance of work-item built-in functions. I'm talking about these:
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_local_id | Local work item ID |
get_num_groups | Number of work groups |
get_group_id | Work group ID |
Are these like real function calls or more like a constant? I am supposing the latter. I might typically write something like this for a starting location:
int offset = get_group_id(0)*myitemsize*get_local_size(0);
and initialize other similar offset variables for other things, also using the same built-ins. Or perhaps something like:
int x = get_global_id(0);
If I were to never change x, or offset, do I get a performance benefit by defining these variables in the first place? How are registers impacted? I was thinking about changing above to something like this for readability but don't know of the impact.
#define x get_global_id(0)