[libc-commits] [libc] [libc] Rework the RPC interface to accept runtime wave sizes (PR #80914)

via libc-commits libc-commits at lists.llvm.org
Wed Feb 7 10:29:07 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 5c84054223102b00cc0dd343a4023e3c6cba42b2 b7d1bb79cda07374ec7b315dd9dd66848a29a02c -- libc/src/__support/GPU/amdgpu/utils.h libc/src/__support/GPU/generic/utils.h libc/src/__support/GPU/nvptx/utils.h libc/src/__support/OSUtil/gpu/io.cpp libc/src/__support/OSUtil/gpu/quick_exit.cpp libc/src/__support/RPC/rpc.h libc/src/__support/RPC/rpc_client.cpp libc/src/__support/RPC/rpc_client.h libc/src/gpu/rpc_host_call.cpp libc/src/stdio/gpu/clearerr.cpp libc/src/stdio/gpu/fclose.cpp libc/src/stdio/gpu/feof.cpp libc/src/stdio/gpu/ferror.cpp libc/src/stdio/gpu/fflush.cpp libc/src/stdio/gpu/fgets.cpp libc/src/stdio/gpu/file.h libc/src/stdio/gpu/fopen.cpp libc/src/stdio/gpu/fseek.cpp libc/src/stdio/gpu/ftell.cpp libc/src/stdio/gpu/ungetc.cpp libc/src/stdlib/gpu/abort.cpp libc/src/stdlib/gpu/free.cpp libc/src/stdlib/gpu/malloc.cpp libc/test/integration/startup/gpu/rpc_interface_test.cpp libc/test/integration/startup/gpu/rpc_stream_test.cpp libc/test/integration/startup/gpu/rpc_test.cpp libc/test/src/__support/RPC/rpc_smoke_test.cpp libc/utils/gpu/server/rpc_server.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libc/src/__support/RPC/rpc.h b/libc/src/__support/RPC/rpc.h
index e657ab274e..ad0ed3c910 100644
--- a/libc/src/__support/RPC/rpc.h
+++ b/libc/src/__support/RPC/rpc.h
@@ -281,7 +281,8 @@ static LIBC_INLINE void invoke_rpc(cpp::function<void(Buffer *)> fn,
   if constexpr (is_process_gpu()) {
     fn(&slot[gpu::get_lane_id()]);
   } else {
-    auto sz = lane_size == VARIABLE_LANE_SIZE ? gpu::get_lane_size() : lane_size;
+    auto sz =
+        lane_size == VARIABLE_LANE_SIZE ? gpu::get_lane_size() : lane_size;
     for (uint32_t i = 0; i < sz; i += gpu::get_lane_size())
       if (mask & 1ul << i)
         fn(&slot[i]);
@@ -295,7 +296,8 @@ static LIBC_INLINE void invoke_rpc(cpp::function<void(Buffer *, uint32_t)> fn,
   if constexpr (is_process_gpu()) {
     fn(&slot[gpu::get_lane_id()], gpu::get_lane_id());
   } else {
-    auto sz = lane_size == VARIABLE_LANE_SIZE ? gpu::get_lane_size() : lane_size;
+    auto sz =
+        lane_size == VARIABLE_LANE_SIZE ? gpu::get_lane_size() : lane_size;
     for (uint32_t i = 0; i < sz; i += gpu::get_lane_size())
       if (mask & 1ul << i)
         fn(&slot[i], i);

``````````

</details>


https://github.com/llvm/llvm-project/pull/80914


More information about the libc-commits mailing list