This patch adds support for fread on the GPU via the RPC mechanism.
Here we simply pass the size of the read to the server and then copy it
back to the client via the RPC channel. This should allow us to do the
basic operations on files now. This will obviously be slow for large
sizes due ot the number of RPC calls involved, this could be optimized
further by having a special RPC call that can initiate a memcpy between
the two pointers.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
This is what confused me earlier:
If I read the fread definition properly, libc's implementation is wrong. The read is supposed to be quantized, but in libc it is not (or it is quantized with an element size of 1).
libc/utils/gpu/server/rpc_server.cpp | ||
---|---|---|
122 | I mean, whatever host fread returns is what we should return. That said, we really need to pass size and nmemb from the device to the host. |
Turns out, all libc impl. do this... anyway. With 1 as size on the host side this should do what the host would do, so we should be fine.
UPPER_CASE.