[libc-commits] [PATCH] D148288: [libc] Update RPC interface for system utilities on the GPU
Joseph Huber via Phabricator via libc-commits
libc-commits at lists.llvm.org
Mon Apr 17 14:33:42 PDT 2023
jhuber6 marked an inline comment as done.
jhuber6 added inline comments.
================
Comment at: libc/src/__support/RPC/rpc.h:42
+ uint16_t opcode;
};
----------------
jdoerfert wrote:
> static assert sizeof
My future plan is to collapse all this inbox / outbox stuff into a struct of arrays, but we should go for a static 64-byte buffer in any case.
================
Comment at: libc/src/__support/RPC/rpc.h:301
+ sleep_briefly();
+ }
}
----------------
jdoerfert wrote:
> I think {try,}open need a common helper impl. but should not use each other.
> The problem right now is that we check the in/out multiple times for no good reason.
> In fact, we might get stuck in a weird state which we could reasonably report as error.
> Why not a single impl. with a flag, in case it is set you loop, otherwise you give up?
The logic is that the client can only open a port capable of sending and the server can only open a port capable of receiving.
================
Comment at: libc/utils/gpu/loader/Server.h:41
+ port->recv([](__llvm_libc::rpc::Buffer *buffer) {
+ exit(reinterpret_cast<uint32_t *>(buffer->data)[0]);
+ });
----------------
jdoerfert wrote:
> FWIW, later we want an easier way to get a single Ty value from the RPC. Seems like something common that should hide the casts and encoding.
Definitely, I'm already tired of reinterpret cast.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D148288/new/
https://reviews.llvm.org/D148288
More information about the libc-commits
mailing list