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_id.h>10#include <clc/opencl/workitem/get_global_offset.h>11#include <clc/opencl/workitem/get_group_id.h>12#include <clc/opencl/workitem/get_local_id.h>13#include <clc/opencl/workitem/get_local_size.h>14 15_CLC_DEF _CLC_OVERLOAD size_t get_global_id(uint dim) {16 return get_group_id(dim) * get_local_size(dim) + get_local_id(dim) +17 get_global_offset(dim);18}19