From 9e3a94dbf047d1ae3c7d55189f490dcc7fd0bdb8 Mon Sep 17 00:00:00 2001 From: Yaxun Sam Liu Date: Wed, 1 Aug 2018 15:13:07 -0400 Subject: [PATCH] Add hc_get_workitem_absolute_id for hip-clang HCC compatibility mode [ROCm/hip commit: ef1d1d57f7ac0a935a0f1b22d37d049b3cac61f3] --- projects/hip/include/hip/hcc_detail/hip_runtime.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/projects/hip/include/hip/hcc_detail/hip_runtime.h b/projects/hip/include/hip/hcc_detail/hip_runtime.h index 61a614ee15..0b44c5f9c0 100644 --- a/projects/hip/include/hip/hcc_detail/hip_runtime.h +++ b/projects/hip/include/hip/hcc_detail/hip_runtime.h @@ -456,6 +456,14 @@ __DEFINE_HCC_FUNC(group_id, blockIdx) __DEFINE_HCC_FUNC(group_size, blockDim) __DEFINE_HCC_FUNC(num_groups, gridDim) #pragma pop_macro("__DEFINE_HCC_FUNC") + +extern "C" __device__ __attribute__((const)) size_t __ockl_get_global_id(uint); +inline __device__ __attribute__((always_inline)) uint +hc_get_workitem_absolute_id(int dim) +{ + return (uint)__ockl_get_global_id(dim); +} + #endif // Support std::complex.