1#include <clc/clc.h>
2
3_CLC_DEF _CLC_OVERLOAD size_t get_group_id(uint dim) {
4  switch (dim) {
5  case 0:
6    return __builtin_amdgcn_workgroup_id_x();
7  case 1:
8    return __builtin_amdgcn_workgroup_id_y();
9  case 2:
10    return __builtin_amdgcn_workgroup_id_z();
11  default:
12    return 1;
13  }
14}
15