This is an archive of the discontinued LLVM Phabricator instance.

[libc] Allow the RPC client to be initialized via a H2D memcpy
ClosedPublic

Authored by jhuber6 on Jun 23 2023, 7:25 AM.

Details

Summary

The RPC client must be initialized to set a pointer to the underlying
buffer. This is currently done with the reset method which may not be
ideal for the use-case. We want runtimes to be able to initialize this
without needing to call a kernel. Recent changes allowed the Client
type to be trivially copyable. That means we can create a client on the
server side and then copy it over. To that end we take the existing
externally visible symbol and initialize it to the client's pointer.
Therefore we can look up the symbol and copy it over once loaded.

No test currently, I tested with a demo OpenMP application but couldn't think of
how to put that in-tree.

Diff Detail

Event Timeline

jhuber6 created this revision.Jun 23 2023, 7:25 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJun 23 2023, 7:25 AM
jhuber6 requested review of this revision.Jun 23 2023, 7:25 AM
jhuber6 updated this revision to Diff 533958.Jun 23 2023, 7:30 AM

Add the symbol's name to the RPC header so users can look it up in the runtime.

jhuber6 updated this revision to Diff 534037.Jun 23 2023, 11:46 AM

Move string constant to the server and make it static, since only the server should care about it.

JonChesterfield accepted this revision.Jun 26 2023, 8:35 AM

Thanks for the update, LG

This revision is now accepted and ready to land.Jun 26 2023, 8:35 AM