brintos

brintos / llvm-project-archived public Read only

0
0
Text · 676 B · 8c5b313 Raw
23 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/workitem/clc_get_local_id.h>10 11_CLC_OVERLOAD _CLC_DEF size_t __clc_get_local_id(uint dim) {12  switch (dim) {13  case 0:14    return __nvvm_read_ptx_sreg_tid_x();15  case 1:16    return __nvvm_read_ptx_sreg_tid_y();17  case 2:18    return __nvvm_read_ptx_sreg_tid_z();19  default:20    return 0;21  }22}23