[libc-commits] [PATCH] D152028: [libc][Docs] Add some motivation for the GPU libc

Joseph Huber via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Jun 6 12:31:55 PDT 2023


jhuber6 added a comment.

In D152028#4392240 <https://reviews.llvm.org/D152028#4392240>, @jdoerfert wrote:

> Honestly, I feel this is too pessimistic and short sighted. I understand we likely don't want everything on a GPU, maybe event can't, but I would not be so eager to guess for some of the things mentioned here. File I/O, for one, is on my TODO list.

I think that File I/O should be mostly straightforward. The existing interface I pushed for `puts` support pretty much just keeps a reference to a `FILE *` on the host. Using newer CUDA with asyncs in a separate stream we should be able to generically support H2D or D2H memcpy, so we should probably have some logic that lets us use that if the device pointer is global

> The entire "we do not want dependencies" is nice, but also somewhat irrelevant given that the vendor libs are linked in (to this day) anyway. Sure, we do not link them into libcgpu, but that is not because of some grant design, IMHO, but rather because we didn't need to (yet). Once libmgpu arrives, we will have to (or link libdevice later), so we will do what the motivation now states we don't want to.

So, a long-term goal of this project is to provide a lot of those facilities in a more complete way. I think the initial invocation of `libmgpu.a` will simply map to the vendor libraries, but we can easily extend it further using a more generic implementation.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152028/new/

https://reviews.llvm.org/D152028



More information about the libc-commits mailing list