[Libomptarget] Begin implementing support for RPC services
authorJoseph Huber <jhuber6@vols.utk.edu>
Sat, 1 Jul 2023 03:08:42 +0000 (22:08 -0500)
committerJoseph Huber <jhuber6@vols.utk.edu>
Fri, 7 Jul 2023 17:36:46 +0000 (12:36 -0500)
commit691dc2d10d4bc5a8e6cea266f201693aee46b40d
treebee624f9c07f5b1c3207e778ec3d4ff5d8f7fa03
parentfa78983bcb355bbe9a3cf40870a2378d03ffb591
[Libomptarget] Begin implementing support for RPC services

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

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D154312
13 files changed:
libc/CMakeLists.txt
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 [new file with mode: 0644]
openmp/libomptarget/plugins-nextgen/common/PluginInterface/RPC.h [new file with mode: 0644]
openmp/libomptarget/plugins-nextgen/cuda/src/rtl.cpp
openmp/libomptarget/test/CMakeLists.txt
openmp/libomptarget/test/libc/malloc.c [new file with mode: 0644]
openmp/libomptarget/test/libc/puts.c [new file with mode: 0644]
openmp/libomptarget/test/lit.cfg
openmp/libomptarget/test/lit.site.cfg.in