[all-commits] [llvm/llvm-project] 732701: [libc] Implement temporary `printf` on the GPU (#8...

Joseph Huber via All-commits all-commits at lists.llvm.org
Tue Apr 2 14:25:40 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7327014b49ba0e4c8227edaed569d21d3cc1ec74
      https://github.com/llvm/llvm-project/commit/7327014b49ba0e4c8227edaed569d21d3cc1ec74
  Author: Joseph Huber <huberjn at outlook.com>
  Date:   2024-04-02 (Tue, 02 Apr 2024)

  Changed paths:
    M libc/config/gpu/entrypoints.txt
    M libc/include/llvm-libc-types/rpc_opcodes_t.h
    M libc/spec/gpu_ext.td
    M libc/src/__support/arg_list.h
    M libc/src/gpu/CMakeLists.txt
    A libc/src/gpu/rpc_fprintf.cpp
    A libc/src/gpu/rpc_fprintf.h
    M libc/test/integration/src/stdio/CMakeLists.txt
    A libc/test/integration/src/stdio/gpu/CMakeLists.txt
    A libc/test/integration/src/stdio/gpu/printf.cpp
    M libc/utils/gpu/server/CMakeLists.txt
    M libc/utils/gpu/server/rpc_server.cpp

  Log Message:
  -----------
  [libc] Implement temporary `printf` on the GPU (#85331)

Summary:
This patch adds a temporary implementation that uses a struct-based
interface in lieu of varargs support. Once varargs support exists we
will move this implementation to the "real" printf implementation.

Conceptually, this patch has the client copy over its format string and
arguments to the server. The server will then scan the format string
searching for any specifiers that are actually a string. If it is a
string then we will send the pointer back to the server to tell it to
copy it back. This copied value will then replace the pointer when the
final formatting is done.

This will require a built-in extension to the varargs support to get
access to the underlying struct. The varargs used on the GPU will simply
be a struct wrapped in a varargs ABI.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list