Debian Codegraph @

libclc/opencl/lib/r600/workitem/get_group_id.cl

raw
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8
9 #include <clc/opencl/opencl-base.h>
10
11 _CLC_DEF _CLC_OVERLOAD uint get_group_id(uint dim) {
12 switch (dim) {
13 case 0:
14 return __builtin_r600_read_tgid_x();
15 case 1:
16 return __builtin_r600_read_tgid_y();
17 case 2:
18 return __builtin_r600_read_tgid_z();
19 default:
20 return 1;
21 }
22 }