[all-commits] [llvm/llvm-project] 8a0763: [Libomptarget] Remove RPCHandleTy indirection

Joseph Huber via All-commits all-commits at lists.llvm.org
Tue Jul 11 08:54:58 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8a0763f19ca543a00bb9e2c3b35279d3eb6339ff
  Author: Joseph Huber <jhuber6 at vols.utk.edu>
  Date:   2023-07-11 (Tue, 11 Jul 2023)

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

  Log Message:
  [Libomptarget] Remove RPCHandleTy indirection

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.

Reviewed By: JonChesterfield

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

More information about the All-commits mailing list