[Openmp-commits] [PATCH] D131089: [Libomptarget] Explicitly init / deinit libomptarget from the user

Jon Chesterfield via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Aug 4 07:14:55 PDT 2022


JonChesterfield added a comment.

In D131089#3699489 <https://reviews.llvm.org/D131089#3699489>, @tianshilei1992 wrote:

> The initialization of both `libomptarget` and other plugins (now excluding AMD plugin) don't use any lock. There is no issue reported regarding messing up the state in initialization.
> That being said, I don't think it's worthy to mess the code up like now for some cases that we don't even know if that could happen.
>
> @jhuber6 Can we do some experiments to see if we can hit the multi-thread initialization?

Right, but this patch changes that initialisation, and in order to try to make the use of requires_flags less broken will initialise libomptarget before calling into it.

Test case goes something like:

- Build two host shared libraries which use target offloading
- Dlopen those shared libraries from different host threads
- Call the function in them that uses target offloading


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131089



More information about the Openmp-commits mailing list