1#include <clc/clc.h>
2
3_CLC_DEF _CLC_OVERLOAD size_t get_num_groups(uint dim) {
4 switch (dim) {
5 case 0: return __nvvm_read_ptx_sreg_nctaid_x();
6 case 1: return __nvvm_read_ptx_sreg_nctaid_y();
7 case 2: return __nvvm_read_ptx_sreg_nctaid_z();
8 default: return 0;
9 }
10}
11