[libc-commits] [PATCH] D145913: [libc] Add initial support for an RPC mechanism for the GPU

Johannes Doerfert via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Mar 14 16:50:33 PDT 2023


jdoerfert added inline comments.


================
Comment at: libc/src/__support/OSUtil/gpu/io.cpp:27
+        [](rpc::Buffer *) {});
+}
+
----------------
Why is this function unused? (also braces for the loop).
Let's avoid "print" for now and go with fputs and exit first.
We certainly want fputs to be the fast path for fprintf, and the non-f versions can be resolved on the device.


================
Comment at: libc/src/__support/RPC/rpc.h:30
+struct Buffer {
+  uint64_t data[8];
+};
----------------
Since data[0] is supposed to be the Opcode, should we not make it a  opcode member and then 7 * 8 bytes payload?



================
Comment at: libc/src/__support/RPC/rpc.h:20
+enum Opcode : uint64_t {
+  noop = 0,
+  print = 1,
----------------
jhuber6 wrote:
> jdoerfert wrote:
> > reserve it, don't call it noon now.
> How about `null`? I think it's important that `0` doesn't do anything as we expect that to be the default clean state of this buffer.
OK, null.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145913/new/

https://reviews.llvm.org/D145913



More information about the libc-commits mailing list