[libc-commits] [PATCH] D149894: [libc] Add RPC utility functions for handling the lanes

Jon Chesterfield via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu May 4 13:00:34 PDT 2023


JonChesterfield added inline comments.


================
Comment at: libc/src/__support/RPC/rpc_util.h:20
+/// Maximum amount of data a single lane can use.
+constexpr uint64_t MAX_LANE_SIZE = 64;
+
----------------
this ^ isn't a utility thing


================
Comment at: libc/src/__support/RPC/rpc_util.h:39
+/// Conditional that is only true for a single thread in a lane.
+LIBC_INLINE bool is_first_lane(uint64_t lane_mask) {
+  return gpu::get_lane_id() == get_first_lane_id(lane_mask);
----------------
this one ^ is really helpful for the locks thing I'm documenting


================
Comment at: libc/src/__support/RPC/rpc_util.h:44
+/// Conditional to indicate if this process is running on the GPU.
+LIBC_INLINE constexpr bool is_process_gpu() {
+#if defined(LIBC_TARGET_ARCH_IS_GPU)
----------------
and this ^ might not survive refactoring in the parent patch


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149894



More information about the libc-commits mailing list