[Openmp-dev] Declare target functions and libomptarget image registration order

Römmer, Manoel via Openmp-dev openmp-dev at lists.llvm.org
Tue Oct 20 03:48:32 PDT 2020


Hi,

We have the following problem: We have a shared library containing a function which is declared with '#pragma omp declare target', and a main executable with a target region in which this function is called. Now the target image in the shared library is registered with libomptarget (__tgt_register_lib()) before the target image of the main executable.
However, libomptarget then passes the target image of the main executable to our RTL plugin (with __tgt_rtl_load_binary()) before the target image of the shared library.
This is a problem for us because our plugin then tries to load the main executable's image first and fails due to unresolved symbols.

So, it seems to me, that libomptarget calls __tgt_rtl_load_binary() with images not in the order which they were registered but in the order they are placed in memory.


Is this intended behaviour?


Thanks,

Manoel




More information about the Openmp-dev mailing list