[clang] constexpr built-in elementwise bitreverse function. (#118177)
[llvm-project.git] / libclc / r600 / lib / workitem / get_num_groups.cl
blobab4f5f629c27b38d9b94278b71dd461bf0a1a9f0
1 #include <clc/clc.h>
3 uint __clc_r600_get_num_groups_x(void) __asm("llvm.r600.read.ngroups.x");
4 uint __clc_r600_get_num_groups_y(void) __asm("llvm.r600.read.ngroups.y");
5 uint __clc_r600_get_num_groups_z(void) __asm("llvm.r600.read.ngroups.z");
7 _CLC_DEF _CLC_OVERLOAD size_t get_num_groups(uint dim) {
8 switch (dim) {
9 case 0:
10 return __clc_r600_get_num_groups_x();
11 case 1:
12 return __clc_r600_get_num_groups_y();
13 case 2:
14 return __clc_r600_get_num_groups_z();
15 default:
16 return 1;