[Openmp-commits] [PATCH] D110195: [OpenMP] Add thread ID function into new RTL

Joseph Huber via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Sep 21 14:44:16 PDT 2021


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGe95731cca7ec: [OpenMP] Add thread ID function into new RTL (authored by jhuber6).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110195/new/

https://reviews.llvm.org/D110195

Files:
  openmp/libomptarget/DeviceRTL/include/Interface.h
  openmp/libomptarget/DeviceRTL/src/Mapping.cpp


Index: openmp/libomptarget/DeviceRTL/src/Mapping.cpp
===================================================================
--- openmp/libomptarget/DeviceRTL/src/Mapping.cpp
+++ 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
Index: openmp/libomptarget/DeviceRTL/include/Interface.h
===================================================================
--- openmp/libomptarget/DeviceRTL/include/Interface.h
+++ 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
 ///
 ///{


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110195.374038.patch
Type: text/x-patch
Size: 954 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210921/f7d3eeb1/attachment-0001.bin>


More information about the Openmp-commits mailing list