[libc-commits] [PATCH] D148342: [libc] Add a test to directly stimulate the RPC interface

Tue Ly via Phabricator via libc-commits libc-commits at lists.llvm.org
Fri Apr 14 20:02:28 PDT 2023


lntue added inline comments.


================
Comment at: libc/test/integration/startup/gpu/rpc_test.cpp:19
+    rpc::Port port = rpc::client.open(rpc::TEST_INCREMENT);
+    port.send_and_recv([&](rpc::Buffer *buffer) { buffer->data[0] = cnt; },
+                       [&](rpc::Buffer *buffer) { cnt = buffer->data[0]; });
----------------
The first lambda doesn't need to capture-by-reference.


================
Comment at: libc/utils/gpu/loader/Server.h:47
+    port->recv_and_send(
+        [&](__llvm_libc::rpc::Buffer *buffer) { buffer->data[0] += 1; });
+    break;
----------------
This lambda doesn't need capture-by-reference.


================
Comment at: libc/utils/gpu/loader/Server.h:51
   default:
     port->recv([&](__llvm_libc::rpc::Buffer *) {
       /* no-op */
----------------
Same with this one.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148342



More information about the libc-commits mailing list