| 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_global_offset(uint dim) { |
| 12 |
__attribute__((address_space(7))) uint *ptr = |
| 13 |
(__attribute__((address_space(7))) |
| 14 |
uint *)__builtin_r600_implicitarg_ptr(); |
| 15 |
if (dim < 3) |
| 16 |
return ptr[dim + 1]; |
| 17 |
return 0; |
| 18 |
} |