[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 06:57:36 PDT 2022


JonChesterfield added a comment.

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

> I can't come up with a scenario where `libomptarget` could be initialized multiple of times from multiple threads. If user `dlopen` `libomptarget` w/o guarding the thread safety, then I think the user should worry more about if that could break `libdl`. Here using `mutex` and `conditional_variable` are generally an overkill.

The case I have in mind is N host code shared libraries, each of which uses target offload, which are themselved dlopened. Devito definitely puts each kernel in it's own shared library and I think dlopens them as an artefact of driving the system from python. As far I I know there's no reason to expect applications to wrap dlopen calls with their own mutex.


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