[libc-commits] [libc] [libc] Replace usage of GPU helpers with ones from 'gpuintrin.h' (PR #116454)

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Fri Nov 15 20:12:00 PST 2024


================
@@ -101,16 +110,16 @@ template <bool Invert> struct Process {
 
   /// Retrieve the inbox state from memory shared between processes.
   LIBC_INLINE uint32_t load_inbox(uint64_t lane_mask, uint32_t index) const {
-    return gpu::broadcast_value(
-        lane_mask,
-        inbox[index].load(cpp::MemoryOrder::RELAXED, cpp::MemoryScope::SYSTEM));
+    return rpc::broadcast_value(
+        lane_mask, __scoped_atomic_load_n(&inbox[index], __ATOMIC_RELAXED,
+                                          __MEMORY_SCOPE_SYSTEM));
   }
 
   /// Retrieve the outbox state from memory shared between processes.
   LIBC_INLINE uint32_t load_outbox(uint64_t lane_mask, uint32_t index) const {
-    return gpu::broadcast_value(lane_mask,
----------------
jhuber6 wrote:

Still used in the tests and other implementations like `printf` or `assert`. This is just trying to make the `rpc.h` header independent so we can put it somewhere else. Doing it bit by bit instead of all at once.

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


More information about the libc-commits mailing list