diff --git a/openmp/libomptarget/DeviceRTL/include/Interface.h b/openmp/libomptarget/DeviceRTL/include/Interface.h --- a/openmp/libomptarget/DeviceRTL/include/Interface.h +++ b/openmp/libomptarget/DeviceRTL/include/Interface.h @@ -198,6 +198,9 @@ /// Called by the worker threads in the parallel region (function). void __kmpc_get_shared_variables(void ***GlobalArgs); +/// External interface to get the thread ID. +uint32_t __kmpc_get_hardware_thread_id_in_block(); + /// Kernel /// ///{ diff --git a/openmp/libomptarget/DeviceRTL/src/Mapping.cpp b/openmp/libomptarget/DeviceRTL/src/Mapping.cpp --- a/openmp/libomptarget/DeviceRTL/src/Mapping.cpp +++ b/openmp/libomptarget/DeviceRTL/src/Mapping.cpp @@ -226,4 +226,9 @@ bool mapping::isGenericMode() { return !isSPMDMode(); } ///} +extern "C" { +uint32_t __kmpc_get_hardware_thread_id_in_block() { + return mapping::getThreadIdInBlock(); +} +} #pragma omp end declare target