[libc-commits] [PATCH] D150337: [libc][rpc] Allocate a single block of shared memory instead of three

Jon Chesterfield via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed May 10 18:46:00 PDT 2023


JonChesterfield added inline comments.


================
Comment at: libc/src/__support/RPC/rpc.h:273
+  memory_allocated_buffer(uint64_t port_count, uint32_t lane_size) {
+#if defined(LIBC_TARGET_ARCH_IS_GPU)
+    (void)lane_size;
----------------
jhuber6 wrote:
> Not sure we need to bother with the macro, I'm sure the optimizer can handle forwarding 32 or `__AMDGCN_WAVEFRONTSIZE`.
gone with this so it matches the definition of the payload type. alternative is something like sizeof(header) + lane_size*N which seems more obscure


================
Comment at: libc/src/__support/RPC/rpc_util.h:54
+template <typename V, typename A>
+LIBC_INLINE constexpr V align_up(V val, A align) {
   return ((val + V(align) - 1) / V(align)) * V(align);
----------------
jhuber6 wrote:
> Did you format this with a different style?
no, adding constexpr hit a line limit. can drop constexpr across the board from this patch if necessary


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150337



More information about the libc-commits mailing list