Debian Codegraph @

libclc/opencl/lib/r600/workitem/get_local_size.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 uint __clc_r600_get_local_size_x(void) __asm("llvm.r600.read.local.size.x");
12 uint __clc_r600_get_local_size_y(void) __asm("llvm.r600.read.local.size.y");
13 uint __clc_r600_get_local_size_z(void) __asm("llvm.r600.read.local.size.z");
14
15 _CLC_DEF _CLC_OVERLOAD size_t get_local_size(uint dim) {
16 switch (dim) {
17 case 0:
18 return __clc_r600_get_local_size_x();
19 case 1:
20 return __clc_r600_get_local_size_y();
21 case 2:
22 return __clc_r600_get_local_size_z();
23 default:
24 return 1;
25 }
26 }