[Openmp-commits] [PATCH] D154312: [Libomptarget] Begin implementing support for RPC services

Joseph Huber via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Sun Jul 2 15:50:39 PDT 2023


jhuber6 created this revision.
jhuber6 added reviewers: jdoerfert, tianshilei1992, kevinsala, JonChesterfield, ronlieb, carlo.bertolli, doru1004, ye-luo.
Herald added subscribers: kerbowa, jvesely.
Herald added a project: All.
jhuber6 requested review of this revision.
Herald added subscribers: openmp-commits, jplehr, sstefan1.
Herald added a project: OpenMP.

This patch adds the intial support for running an RPC server in
libomptarget to handle host services. We interface with the library
provided by the `libc` project to stand up a basic server. We introduce
a new type that is controlled by the plugin and has each device
intialize its interface. We then run a basic server to check the RPC
buffer.

This patch does not fully implement the interface. In the future each
plugin will want to define special handlers via the interface to support
things like malloc or H2D copies coming from RPC. We will also want to
allow the plugin to specify t he number of ports. This is currently
capped in the implementation but will be adjusted soon.

Right now running the server is handled by whatever thread ends up doing
the waiting. This is probably not a completely sound solution but I am
not overly familiar with the behaviour of OpenMP tasks and what would be
required here. This works okay with synchrnous regions, and somewhat
fine with `nowait` regions, but I've observed some weird behavior when
one of those regions calls `exit`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D154312

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: D154312.536635.patch
Type: text/x-patch
Size: 24649 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20230702/b1c9d602/attachment-0001.bin>


More information about the Openmp-commits mailing list