[Openmp-commits] [PATCH] D130714: [openmp][amdgpu] Tear down amdgpu plugin accurately

Shilei Tian via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Jul 28 09:37:48 PDT 2022


tianshilei1992 added a comment.

In D130714#3685347 <https://reviews.llvm.org/D130714#3685347>, @jhuber6 wrote:

> In D130714#3685324 <https://reviews.llvm.org/D130714#3685324>, @tianshilei1992 wrote:
>
>> This doesn't work because the life time of a plugin is shorter than `libomptarget`.
>
> Is there a reason for this? We initialize them late sure, but why do we destruct them earlier?

I'm not very familiar with dynamic linker, but I guess it just tries to destruct them in a reverse order. I did some experiments before, and that showed when `libomptarget` starts to destruct, the plugin is already destroyed. Any call from d'tor of `libomptarget` to plugins will lead to UB, or in most of cases for NVPTX, segfault.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130714



More information about the Openmp-commits mailing list