This is an archive of the discontinued LLVM Phabricator instance.

[libc][docs] Add documentation for the new GPU mode
ClosedPublic

Authored by jhuber6 on Nov 28 2022, 12:57 PM.

Details

Summary

This patch introduces documentation for the new GPU mode added in
D138608. The documentation includes instructions for building and using
the library, along with a description of the supported functions and
headers.

Diff Detail

Event Timeline

jhuber6 created this revision.Nov 28 2022, 12:57 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptNov 28 2022, 12:57 PM
jhuber6 requested review of this revision.Nov 28 2022, 12:57 PM

I think as a first draft this looks great. It also makes it clear this is WIP. @sivachandra wdyt?

tschuett added inline comments.Nov 28 2022, 1:22 PM
libc/docs/gpu_mode.rst
51

double toolchain

michaelrj accepted this revision.Nov 28 2022, 1:23 PM

LGTM as a first draft after fixing the typo.

This revision is now accepted and ready to land.Nov 28 2022, 1:23 PM
sivachandra accepted this revision.Nov 28 2022, 1:31 PM

In addition to what you have here, we should also describe what you envision this to eventually become. Including information on how you envision this to plug holes in the current practices/systems would be even better.

libc/docs/gpu_mode.rst
55

The actual build command, a ninja <something> is missing in the above list of commands.

In the original diff, you hinted at that there is currently no support for malloc and free. Could you inspect the archive with llvm-nm for unsupported functions?

In the original diff, you hinted at that there is currently no support for malloc and free. Could you inspect the archive with llvm-nm for unsupported functions?

The device code is embedded inside the objects so llvm-nm won't show the interesting symbols, but we could probably tell by name. The functions listed in the Supported Functions header is intended to be an inclusive list. Implementing malloc and free will require an RPC mechanism to call the host OS from the GPU which we're still working on. I could make this more clear in the current documentation.

Sorry. llvm-nm was a distraction. However, I believe mentioning RPC, malloc, and free is an improvement. Thx!

jhuber6 updated this revision to Diff 478544.Nov 29 2022, 5:40 AM

Addressing comments.

lntue accepted this revision.Nov 29 2022, 6:30 AM
lntue added inline comments.
libc/docs/gpu_mode.rst
28
This revision was automatically updated to reflect the committed changes.