[all-commits] [llvm/llvm-project] a1be5d: [libc] Implement more input functions on the GPU (...

Joseph Huber via All-commits all-commits at lists.llvm.org
Thu Sep 14 13:39:43 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a1be5d69dff0ff9bdf0329370a3ce724bcd25ed2
      https://github.com/llvm/llvm-project/commit/a1be5d69dff0ff9bdf0329370a3ce724bcd25ed2
  Author: Joseph Huber <35342157+jhuber6 at users.noreply.github.com>
  Date:   2023-09-14 (Thu, 14 Sep 2023)

  Changed paths:
    M libc/config/gpu/entrypoints.txt
    M libc/docs/gpu/support.rst
    M libc/include/llvm-libc-types/rpc_opcodes_t.h
    M libc/src/stdio/CMakeLists.txt
    R libc/src/stdio/clearerr.cpp
    R libc/src/stdio/clearerr_unlocked.cpp
    R libc/src/stdio/feof.cpp
    R libc/src/stdio/feof_unlocked.cpp
    R libc/src/stdio/ferror.cpp
    R libc/src/stdio/ferror_unlocked.cpp
    R libc/src/stdio/fgetc.cpp
    R libc/src/stdio/fgetc_unlocked.cpp
    R libc/src/stdio/fgets.cpp
    M libc/src/stdio/generic/CMakeLists.txt
    A libc/src/stdio/generic/clearerr.cpp
    A libc/src/stdio/generic/clearerr_unlocked.cpp
    A libc/src/stdio/generic/feof.cpp
    A libc/src/stdio/generic/feof_unlocked.cpp
    A libc/src/stdio/generic/ferror.cpp
    A libc/src/stdio/generic/ferror_unlocked.cpp
    A libc/src/stdio/generic/fgetc.cpp
    A libc/src/stdio/generic/fgetc_unlocked.cpp
    A libc/src/stdio/generic/fgets.cpp
    A libc/src/stdio/generic/getc.cpp
    A libc/src/stdio/generic/getc_unlocked.cpp
    A libc/src/stdio/generic/getchar.cpp
    A libc/src/stdio/generic/getchar_unlocked.cpp
    R libc/src/stdio/getc.cpp
    R libc/src/stdio/getc_unlocked.cpp
    R libc/src/stdio/getchar.cpp
    R libc/src/stdio/getchar_unlocked.cpp
    M libc/src/stdio/gpu/CMakeLists.txt
    A libc/src/stdio/gpu/clearerr.cpp
    A libc/src/stdio/gpu/feof.cpp
    A libc/src/stdio/gpu/ferror.cpp
    A libc/src/stdio/gpu/fgetc.cpp
    A libc/src/stdio/gpu/fgets.cpp
    M libc/src/stdio/gpu/file.h
    A libc/src/stdio/gpu/getc.cpp
    A libc/src/stdio/gpu/getchar.cpp
    M libc/test/src/stdio/CMakeLists.txt
    M libc/utils/gpu/server/rpc_server.cpp

  Log Message:
  -----------
  [libc] Implement more input functions on the GPU (#66288)

Summary:
This patch implements the `fgets`, `getc`, `fgetc`, and `getchar`
functions on the GPU. Their implementations are straightforward enough.
One thing worth noting is that the implementation of `fgets` will be
extremely slow due to the high latency to read a single char. A faster
solution would be to make a new RPC call to call `fgets` (due to the
special rule that newline or null breaks the stream). But this is left
out because performance isn't the primary concern here.




More information about the All-commits mailing list