[Openmp-commits] [PATCH] D155003: [libc] Add basic support for calling host functions from the GPU

Joseph Huber via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Jul 11 12:19:42 PDT 2023


jhuber6 created this revision.
jhuber6 added reviewers: jdoerfert, tianshilei1992, ye-luo, ronlieb, sivachandra, JonChesterfield, michaelrj, tra.
Herald added projects: libc-project, All.
Herald added a subscriber: libc-commits.
jhuber6 requested review of this revision.
Herald added subscribers: openmp-commits, jplehr, sstefan1.
Herald added a project: OpenMP.

This patch adds the `rpc_host_call` function as a GPU extension. This is
exported from the `libc` project to use the RPC interface to call a
function pointer via RPC any copying the arguments by-value. The
interface can only support a single void pointer argument much like
pthreads. The function call here is the bare-bones version of what's
required for OpenMP reverse offloading. Full support will require
interfacing with the mapping table, nowait support, etc.

I decided to test this interface in `libomptarget` as that will be the
primary consumer and it would be more difficult to make a test in `libc`
due to the testing infrastructure not really having a concept of the
"host" as it runs directly on the GPU as if it were a CPU target.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D155003

Files:
  libc/config/gpu/entrypoints.txt
  libc/include/llvm-libc-types/rpc_opcodes_t.h
  libc/spec/gpu_ext.td
  libc/src/gpu/CMakeLists.txt
  libc/src/gpu/rpc_host_call.cpp
  libc/src/gpu/rpc_host_call.h
  libc/utils/gpu/server/rpc_server.cpp
  openmp/libomptarget/test/libc/host_call.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155003.539237.patch
Type: text/x-patch
Size: 6247 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20230711/ee0143d4/attachment.bin>


More information about the Openmp-commits mailing list