[libc] Support fopen / fclose on the GPU
authorJoseph Huber <jhuber6@vols.utk.edu>
Wed, 5 Jul 2023 15:10:07 +0000 (10:10 -0500)
committerJoseph Huber <jhuber6@vols.utk.edu>
Wed, 5 Jul 2023 23:31:58 +0000 (18:31 -0500)
commitc850ea1498733d4f54d501d56157270d83a4244c
treec8ce76e738b9e554c676318d42fa1c6c1a96106e
parent7e88e26d3845a30c2831328f902fd3d597b3ef26
[libc] Support fopen / fclose on the GPU

This patch adds the necessary support for the fopen and fclose functions
to work on the GPU via RPC. I added a new test that enables testing this
with the minimal features we have on the GPU. I will update it once we
have `fread` and `fwrite` to actually check the outputted strings. For
now I just relied on checking manually via the outpuot temp file.

Reviewed By: JonChesterfield, sivachandra

Differential Revision: https://reviews.llvm.org/D154519
libc/config/gpu/entrypoints.txt
libc/docs/gpu/support.rst
libc/include/llvm-libc-types/rpc_opcodes_t.h
libc/src/__support/File/gpu/file.cpp
libc/test/src/stdio/CMakeLists.txt
libc/test/src/stdio/fopen_test.cpp [new file with mode: 0644]
libc/utils/gpu/server/rpc_server.cpp