This patch adds support for more trivial file functions. This leaves out
specifically fgets. This is because as implemented this does not have
the correct behavior as it does not stop on EOF or newline since we map
it all to fread. This will probably need to be fixed somehow.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
This is because as implemented this does not have the correct behavior as it does not stop on EOF or newline since we map it all to fread.
Because the RPC maps it to fread or because the libc default impl does?
Haven't tested w/ the CPU version of libc their version maps to a linux syscall which has similar semantics I think.
libc/docs/gpu/support.rst | ||
---|---|---|
132 | This two don't need RPC? |
libc/docs/gpu/support.rst | ||
---|---|---|
132 | So that's actually a can of worms I'm not sure what the best way to handle is. These don't require RPC because the file class maintains some internal state about the result of the last action, e.g. if the last return value was negative. But, this means that calling feof on the GPU will return something different if the last call was on the CPU. However, it also means that if we didn't want that to happen we'd need everything to go through RPC with very little ability to optimize anything from the GPU side. I'm sort-of leaning towards treating this as a similar case if you were to statically link a MUSL application with a glibc one, you should kind of see them as separate and not expect them to work well when mixed. |
This two don't need RPC?