brintos

brintos / llvm-project-archived public Read only

0
0
Text · 671 B · 988e482 Raw
19 lines · plain
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-exception6//7//===----------------------------------------------------------------------===//8 9#include <clc/opencl/workitem/get_global_offset.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}19