[Openmp-commits] [PATCH] D94379: [OpenMP] Move memory manager to plugin and make it a common interface

Shilei Tian via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Sun Jan 10 17:12:08 PST 2021


tianshilei1992 created this revision.
tianshilei1992 added reviewers: jdoerfert, JonChesterfield, manorom, protze.joachim.
Herald added subscribers: guansong, yaxunl, mgorny.
tianshilei1992 requested review of this revision.
Herald added subscribers: openmp-commits, sstefan1.
Herald added a project: OpenMP.

The lifetime of `libomptarget` and its opened plugins are not aligned
and it's hard for `libomptarget` to determine when the plugins are destroyed.
As a result, some issues (see D94256 <https://reviews.llvm.org/D94256> for details) occur on some platforms.
Actually, if we take target memory as target resources, same as other resources,
such as CUDA streams, in each plugin, then the memory manager should also be in
the plugin. Also considering some platforms may want to opt out the feature, it
makes sense to move the memory manager to plugin, make it a common interface, and
let plguin developers determine whether they need it. This is what this patch does.
CUDA plugin is taken as example to show how to integrate it. In this way, we can
also get a bonus that different thresholds can be set for different platforms.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D94379

Files:
  openmp/libomptarget/plugins/common/MemoryManager.h
  openmp/libomptarget/plugins/cuda/src/rtl.cpp
  openmp/libomptarget/src/CMakeLists.txt
  openmp/libomptarget/src/MemoryManager.cpp
  openmp/libomptarget/src/MemoryManager.h
  openmp/libomptarget/src/device.cpp
  openmp/libomptarget/src/device.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94379.315682.patch
Type: text/x-patch
Size: 31389 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210111/b3c4b794/attachment-0001.bin>


More information about the Openmp-commits mailing list