[all-commits] [llvm/llvm-project] 691dc2: [Libomptarget] Begin implementing support for RPC ...

Joseph Huber via All-commits all-commits at lists.llvm.org
Fri Jul 7 10:37:02 PDT 2023


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

  Changed paths:
    M libc/CMakeLists.txt
    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
    A openmp/libomptarget/plugins-nextgen/common/PluginInterface/RPC.cpp
    A openmp/libomptarget/plugins-nextgen/common/PluginInterface/RPC.h
    M openmp/libomptarget/plugins-nextgen/cuda/src/rtl.cpp
    M openmp/libomptarget/test/CMakeLists.txt
    A openmp/libomptarget/test/libc/malloc.c
    A openmp/libomptarget/test/libc/puts.c
    M openmp/libomptarget/test/lit.cfg
    M openmp/libomptarget/test/lit.site.cfg.in

  Log Message:
  -----------
  [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




More information about the All-commits mailing list