[Openmp-commits] [PATCH] D112154: [OpenMP][NFCI] Cleanup new device RT mapping interface

Jon Chesterfield via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Oct 21 00:47:38 PDT 2021


JonChesterfield added a comment.

Cleanups good, be a shame to lose the functions clang calls into just as we're on the edge of deleting the amdgcn and nvptx subclasses from openmp codegen.

Is getNumberOfProcessorElements the number of SMs / CUs? That may only be known accurately at application runtime



================
Comment at: openmp/libomptarget/DeviceRTL/src/Mapping.cpp:232-239
-extern "C" {
-__attribute__((noinline)) uint32_t __kmpc_get_hardware_thread_id_in_block() {
-  return mapping::getThreadIdInBlock();
-}
-
-__attribute__((noinline)) uint32_t __kmpc_get_hardware_num_threads_in_block() {
-  return mapping::getNumberOfProcessorElements();
----------------
jhuber6 wrote:
> jdoerfert wrote:
> > jhuber6 wrote:
> > > Why do we want to get rid of these? I thought the idea was to keep these functions so we can generate generic IR in Clang that gets dispatched by the runtime once it's linked in.
> > I think we should replace runtime call folding with store->load forwarding. The new runtime does generic store->load forwarding for IsSPMD, as an example, and it works better as we do not need to keep calls around. That said, there is an argument made for both to exist. However, even if, we can simply look for the mangled names of the new runtime once we switched over rather than some `__kmpc` names.
> We use these in `OpenMPOpt` and `CGOpenMPRuntimeGPU`, could we replace the definitions in `OMPKinds.def` with the mangled names?
The _kmpc prefix is used for the rest of the functions clang emits calls to, not that keen to replace all those with mangled symbols written in clang


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112154



More information about the Openmp-commits mailing list