[Openmp-commits] [PATCH] D154971: [Libomptarget] Remove RPCHandleTy indirection

Joseph Huber via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Jul 11 07:30:57 PDT 2023


jhuber6 created this revision.
jhuber6 added reviewers: JonChesterfield, jdoerfert, tianshilei1992, jplehr.
Herald added subscribers: kerbowa, tpr, jvesely.
Herald added a project: All.
jhuber6 requested review of this revision.
Herald added a project: OpenMP.
Herald added a subscriber: openmp-commits.

The 'RPCHandleTy' was intended to capture the intention that a specific
device owns its slot in the RPC server. However, this required creating
a temporary store to hold these pointers. This was causing really weird
spurious failure due to undefined behaviour in the order of library
teardown. For example, the x64 plugin would be torn down, set this to
some invalid memory, and then the CUDA plugin would crash. Rather than
spend the time to fully diagnose this problem I found it pertinent to
simply remove the failure mode.

This patch removes this indirection so now the usage of the RPC server
must always be done with the intended device. This just requires some
extra handling for the AMDGPU indirection where we need to store a
reference to the device.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D154971

Files:
  openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp
  openmp/libomptarget/plugins-nextgen/common/PluginInterface/CMakeLists.txt
  openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp
  openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.h
  openmp/libomptarget/plugins-nextgen/common/PluginInterface/RPC.cpp
  openmp/libomptarget/plugins-nextgen/common/PluginInterface/RPC.h
  openmp/libomptarget/plugins-nextgen/cuda/src/rtl.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D154971.539093.patch
Type: text/x-patch
Size: 11331 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20230711/f84c7f5f/attachment-0001.bin>


More information about the Openmp-commits mailing list