[all-commits] [llvm/llvm-project] 0871d6: [OpenMP] Move memory manager to plugin and make it...

Shilei Tian via All-commits all-commits at lists.llvm.org
Mon Jan 11 18:34:00 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0871d6d51648dd2a8009ddff59936ea9e3fe871b
      https://github.com/llvm/llvm-project/commit/0871d6d51648dd2a8009ddff59936ea9e3fe871b
  Author: Shilei Tian <tianshilei1992 at gmail.com>
  Date:   2021-01-11 (Mon, 11 Jan 2021)

  Changed paths:
    M openmp/libomptarget/plugins/common/CMakeLists.txt
    A openmp/libomptarget/plugins/common/MemoryManager/CMakeLists.txt
    A openmp/libomptarget/plugins/common/MemoryManager/MemoryManager.h
    M openmp/libomptarget/plugins/cuda/CMakeLists.txt
    M openmp/libomptarget/plugins/cuda/src/rtl.cpp
    M openmp/libomptarget/src/CMakeLists.txt
    R openmp/libomptarget/src/MemoryManager.cpp
    R openmp/libomptarget/src/MemoryManager.h
    M openmp/libomptarget/src/device.cpp
    M openmp/libomptarget/src/device.h

  Log Message:
  -----------
  [OpenMP] Move memory manager to plugin and make it a common interface

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 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.

Reviewed By: jdoerfert, JonChesterfield

Differential Revision: https://reviews.llvm.org/D94379




More information about the All-commits mailing list