1. May 24, 2023
  2. May 23, 2023
    • Joseph Huber's avatar
      [libc] More efficiently send bytes via `send_n` and `recv_n` · e826762a
      Joseph Huber authored
      Currently we have the `send_n` and `recv_n` routines to stream data,
      such as a string to print, to the other side. The first operation is to
      send the size so the other side knows the number of bytes to recieve.
      However, this wasted 56 bytes that could've been sent. This meant that
      small values, like the arguments to a function to call on the host for
      example, needed to perform an extra send. This patch sends the first 56
      bytes in the first packet and continues if necessary.
      
      Depends on D150992
      
      Reviewed By: JonChesterfield
      
      Differential Revision: https://reviews.llvm.org/D151041
      e826762a
    • Joseph Huber's avatar
      [libc] Fix the `send_n` and `recv_n` utilities under divergent lanes · 29d3da3b
      Joseph Huber authored
      We provide the `send_n` and `recv_n` utilities as a generic way to
      stream data between both sides of the process. This was previously
      tested and performed as expected when using a string of constant size.
      However, when the size was allowed to diverge between the threads in the
      warp or wavefront this could deadlock. This did not occur on NVPTX
      because of the use of the explicit warp sync. However, on AMD one of the
      work items in the wavefront could continue executing and hit the next
      `recv` call before the other threads, then we would deadlock as we
      violated the RPC invariants.
      
      This patch replaces the for loop with a thread ballot. This will cause
      every thread in the warp or wavefront to continue executing the loop
      until all of them can exit. This acts as a more explicit wavefront sync.
      
      Reviewed By: JonChesterfield
      
      Differential Revision: https://reviews.llvm.org/D150992
      29d3da3b
    • Nikolas Klauser's avatar
      [libc++] Remove tests from ranges.pass.cpp which violate semantic requirements · 75eb3bd1
      Nikolas Klauser authored
      This also removes some tests which we have grouped together into robust_from_*.pass.cpp tests.
      
      Specifically, checking that
      - `ranges::dangling` is returned is done in `libcxx/test/std/algorithms/ranges_robust_against_dangling.pass.cpp`
      - `std::invoke` is used is done in `libcxx/test/std/algorithms/ranges_robust_against_omitting_invoke.pass.cpp`.
      - implicit conversion to bool works is done in `libcxx/test/std/algorithms/ranges_robust_against_nonbool_predicates.pass.cpp`
      
      Checking the comparison order is invalid because the `operator==` isn't symmetric.
      Checking what the exact type of `operator==` is, is invalid because comparing the same object has to yield the same results if the objects are not modified.
      
      Reviewed By: ldionne, #libc
      
      Spies: EricWF, libcxx-commits
      
      Differential Revision: https://reviews.llvm.org/D150588
      75eb3bd1