You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Offload][OpenMP] Move OMPT out of plugins (llvm#2282)
This PR addresses the issue that we currently cannot build `liboffload`
downstream given the OMPT symbols inside the plugin. Since liboffload is
moving forward upstream, we should enable building it downstream.
This is also a first step towards making the OMPT implementation (more)
acceptable to upstream.
## Problem
liboffload links the plugins but not libomptarget. libomptarget defines
some of the OMPT symbols that are used inside the plugins. As a result
you end up with two error modes: (1) when building offload you get
unresolved symbols linker errors. (2) If you were to add the files that
contains these symbols to the plugin build to address (1), you end up
with a multiply-defined symbols error in the libomptarget build.
## Solution
This patch moves all OMPT symbols out of the plugins and into an OMPT
library with a common interface `GenericProfilerTy` that is used inside
the plugin. The interface is then implemented in the OMPT library as
`OmptProfilerTy` which calls the appropriate existing OMPT infrastructure.
That OMPT library is linked to libomptarget but not liboffload. liboffload
links an empty default implementation for now. This separation was also
a request from upstream when we want to upstream OMPT support.
## Future Work
We need to clean up the whole OMPT build and code anyway, but I
figured that should not be done in this patch, given that it is already
too large. The clean up should look at moving things into the right places
and simplify the implementation where possible, given that we statically
link the plugins and all (potentially still existing) dlopen cruft can
go away.
0 commit comments