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

Johannes Doerfert via Openmp-dev openmp-dev at lists.llvm.org
Wed Oct 21 08:18:02 PDT 2020


Hi Manoel,

we briefly discussed it today in our meeting 
https://docs.google.com/document/d/1Tz8WFN13n7yJ-SCE0Qjqf9LmjGUw0dWO9Ts1ss4YOdg/edit?usp=sharing
If we don't solve this over the list, feel free to join next week.
In the meantime, I'm unsure I grasp the situation.
Could you use a debug enabled libomptarget and use the 
LIBOMPTARGET_DEBUG environment variable to get the sequence of events?

~ Johannes


On 10/20/20 5:48 AM, Römmer, Manoel via Openmp-dev wrote:
> 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
>
>
> _______________________________________________
> Openmp-dev mailing list
> Openmp-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev


More information about the Openmp-dev mailing list