This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Add time profiling support in libomp
ClosedPublic

Authored by ggeorgakoudis on Jan 15 2021, 6:53 PM.

Details

Summary

Profiling has been recently implemented in libomptarget (D93055). This patch enables time profiling support for libomptarget in libomp, to support profiling of multi-threaded execution of offloaded regions.

Diff Detail

Event Timeline

ggeorgakoudis created this revision.Jan 15 2021, 6:53 PM
ggeorgakoudis requested review of this revision.Jan 15 2021, 6:53 PM
Herald added a project: Restricted Project. · View Herald Transcript
ggeorgakoudis edited the summary of this revision. (Show Details)Jan 15 2021, 6:59 PM

Fix setting LIBOMPTARGET_PROFILING_SUPPORT

This revision is now accepted and ready to land.Jan 18 2021, 2:34 PM
This revision was automatically updated to reflect the committed changes.

This breaks the build for me. Compiling openmp via ENABLE_RUNTIMES without any extra options, the include path isn't set up so kmp_runtime.cpp fails to find the header.

This breaks the build for me. Compiling openmp via ENABLE_RUNTIMES without any extra options, the include path isn't set up so kmp_runtime.cpp fails to find the header.

Thanks for spotting that @JonChesterfield. Will fix soon.

I see two issues in this patch. LIBOMPTARGET_LLVM_INCLUDE_DIRS is not included when building libomp.so therefore the header will not be found (in my case). Another probably bigger one is D95371. From my observation, code in runtime is very conservative in terms of using C++.

We need to revise the decision in this patch. Per @AndreyChurbanov in D95371, libomp.so is intended to be a C library. Linking a C library with a C++ static library doesn't work, as shown in D95371.