[Openmp-commits] [PATCH] D120089: [OpenMP][WIP] Explicitly deinitialize device resources

Johannes Doerfert via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Feb 17 14:14:09 PST 2022


jdoerfert created this revision.
jdoerfert added reviewers: tianshilei1992, JonChesterfield.
Herald added subscribers: guansong, bollu, yaxunl.
jdoerfert requested review of this revision.
Herald added a subscriber: sstefan1.
Herald added a project: OpenMP.

This is a WIP patch, some parts are missing and I need feedback on it
first.

There are two problems this patch tries to address:

1. We currently free resources in a random order wrt. plugin and libomptarget destruction. This patch should ensure the plugins can always relinquish their resources first as we call into them during the libomptarget DeviceTy destructor.
2. We need to support (hard) pause runtime calls eventually. This patch allows us to free all associated resources, though we cannot reinitialize the device yet.

The only known weirdness is the event pool which is shared across
devices. We could have one per device, or, deallocate it when the last
device associated with the plugin is deallocated. I opted for the latter
now.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D120089

Files:
  openmp/libomptarget/include/device.h
  openmp/libomptarget/include/omptargetplugin.h
  openmp/libomptarget/include/rtl.h
  openmp/libomptarget/plugins/cuda/src/rtl.cpp
  openmp/libomptarget/plugins/exports
  openmp/libomptarget/src/device.cpp
  openmp/libomptarget/src/rtl.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120089.409790.patch
Type: text/x-patch
Size: 8092 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20220217/6aed3fe8/attachment.bin>


More information about the Openmp-commits mailing list