annotate libclc/amdgcn/lib/workitem/get_num_groups.cl @ 237:c80f45b162ad llvm-original

add some fix
author kono
date Wed, 09 Nov 2022 17:47:54 +0900 (2022-11-09)
parents 79ff65ed7e25
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 #include <clc/clc.h>
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 uint __clc_amdgcn_get_num_groups_x(void) __asm("llvm.r600.read.ngroups.x");
anatofuz
parents:
diff changeset
4 uint __clc_amdgcn_get_num_groups_y(void) __asm("llvm.r600.read.ngroups.y");
anatofuz
parents:
diff changeset
5 uint __clc_amdgcn_get_num_groups_z(void) __asm("llvm.r600.read.ngroups.z");
anatofuz
parents:
diff changeset
6
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
7 _CLC_DEF _CLC_OVERLOAD size_t get_num_groups(uint dim) {
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
8 switch (dim) {
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
9 case 0:
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
10 return __clc_amdgcn_get_num_groups_x();
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
11 case 1:
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
12 return __clc_amdgcn_get_num_groups_y();
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
13 case 2:
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
14 return __clc_amdgcn_get_num_groups_z();
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
15 default:
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
16 return 1;
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
17 }
150
anatofuz
parents:
diff changeset
18 }