aboutsummaryrefslogtreecommitdiff
path: root/libc/src/stdio/generic/fprintf.cpp
AgeCommit message (Collapse)AuthorFilesLines
2024-07-12[libc] Implement (v|f)printf on the GPU (#96369)Joseph Huber1-0/+34
Summary: This patch implements the `printf` family of functions on the GPU using the new variadic support. This patch adapts the old handling in the `rpc_fprintf` placeholder, but adds an extra RPC call to get the size of the buffer to copy. This prevents the GPU from needing to parse the string. While it's theoretically possible for the pass to know the size of the struct, it's prohibitively difficult to do while maintaining ABI compatibility with NVIDIA's varargs. Depends on https://github.com/llvm/llvm-project/pull/96015.