summaryrefslogtreecommitdiff
path: root/libc/src/assert/gpu
AgeCommit message (Collapse)Author
2024-07-12[libc] Migrate to using LIBC_NAMESPACE_DECL for namespace declaration (#98597)Petr Hosek
This is a part of #97655.
2024-07-12Revert "[libc] Migrate to using LIBC_NAMESPACE_DECL for namespace ↵Mehdi Amini
declaration" (#98593) Reverts llvm/llvm-project#98075 bots are broken
2024-07-11[libc] Migrate to using LIBC_NAMESPACE_DECL for namespace declaration (#98075)Petr Hosek
This is a part of #97655.
2023-10-10[libc] Fix missing warp sync for the NVPTX assertJoseph Huber
Summary: The implementation of `assert` has an if statement so that only the first thread in the warp prints the assertion. On modern NVPTX architecture, this can be printed out of order with the abort call. This would lead to only a portion of the message being printed and then exiting the program. By adding a mandatory warp sync we force the full string to be printed before we continue to the abort.
2023-09-26[libc] Mass replace enclosing namespace (#67032)Guillaume Chatelet
This is step 4 of https://discourse.llvm.org/t/rfc-customizable-namespace-to-allow-testing-the-libc-when-the-system-libc-is-also-llvms-libc/73079
2023-09-12[libc][NFC] Factor GPU exiting into a common function (#66093)Joseph Huber
Summary: We currently call the GPU routine to terminate the current thread in three separate locations .This should be wrapped into a helper function to simplify the implementation.
2023-08-31[libc] Support 'assert.h' on the GPUJoseph Huber
This patch adds the necessary support to provide `assert` functionality through the GPU `libc` implementation. This implementation creates a special-case GPU implementation rather than relying on the common version. This is because the GPU has special considerings for printing. The assertion is printed out in chunks with `write_to_stderr`, however when combined with the GPU execution model this causes 32+ threads to all execute in-lock step. Meaning that we'll get a horribly fragmented message. Furthermore, potentially thousands of threads could hit the assertion at once and try to print even if we had it all in one `printf`. This is solved by having a one-time lock that each thread group / wave / warp will attempt to claim. We only let one thread group pass through while the others simply stop executing. Finally only the first thread in that group will do the printing until we finally abort execution. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D159296