[Openmp-commits] [PATCH] D94256: [OpenMP] Fixed the issue that memory manager calls plugin interface to release buffered memory even after the plugin has been destroyed

Shilei Tian via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Sun Jan 10 13:29:19 PST 2021


tianshilei1992 added a comment.

In D94256#2489154 <https://reviews.llvm.org/D94256#2489154>, @JonChesterfield wrote:

> The complexity of this approach is very high relative to instantiating MemoryManagerTy in the cuda plugin, and optionally in any others that want to use it.

This approach does not only fix the issue, but also open a door for future development. `RTLInfoTy` is used by `DeviceTy`, so each one has pointers to the other. It is a weak dependence so not a problem. We have a lot of similar things in LLVM, such as `use` and `user`.

The callback function can also be used later as it is the only chance for `libomptarget` to know when the plugin is destroyed and do something needed.

In the future we will add something to let a plugin exchange information with `libomptarget`. For example, a plugin can tell `libomptarget` what features it can support and `libomptarget` can use that information accordingly. Moving the memory manager to plugin and taking it as a common part is also feasible.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D94256



More information about the Openmp-commits mailing list