[libc-commits] [PATCH] D148943: [libc] Enable multiple threads to use RPC on the GPU

Johannes Doerfert via Phabricator via libc-commits libc-commits at lists.llvm.org
Fri Apr 21 11:05:46 PDT 2023


jdoerfert added a comment.

Drive



================
Comment at: libc/src/__support/RPC/rpc.h:47
+/// A buffer used to swap data between the client and server across an entire
+/// lane. The GPU executes threads in lock-step so we use a 'warp' for
+/// 'wavefront' as our minimum granularity.
----------------
Or


================
Comment at: libc/src/__support/RPC/rpc.h:55
+#elif defined(LIBC_TARGET_ARCH_IS_NVPTX)
+  Buffer slot[32];
+#else
----------------
We should have a single generic warp size macro



================
Comment at: libc/src/__support/RPC/rpc.h:101
+  LIBC_INLINE void reset(uint32_t size, void *mtx, void *in, void *out,
+                         void *data) {
+    lane_size = size;
----------------
why is data not typed here?


================
Comment at: libc/src/__support/RPC/rpc.h:188
   // Apply the \p fill function to initialize the buffer and release the memory.
-  fill(&process.buffer[index]);
+  for (uint32_t idx = 0; idx < process.lane_size; idx += gpu::get_lane_size())
+    if (is_process_gpu() || process.buffer[index].mask & 1ul << idx)
----------------
shouldn't 0 be something like gpu::get_id_in_lane()? Also below.


================
Comment at: libc/src/__support/RPC/rpc.h:271
+    }
+  } else {
+    uint64_t size[64];
----------------
return;
}



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148943



More information about the libc-commits mailing list