[libc-commits] [PATCH] D153897: [libc][hdr-gen] Add special offloading handling for the GPU target

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Jun 27 22:45:15 PDT 2023


sivachandra added a comment.

In D153897#4454578 <https://reviews.llvm.org/D153897#4454578>, @jhuber6 wrote:

> So, these headers need the ability to do some potentially ugly hacks. I have
> added an extra field to the `PublicAPI` called `ExtraDefn`, which is currently a
> simple string that we can use to inject some special-case handling for the
> wrapper headers. In this case, we needed to define the `__atexithander_t` type
> for the `atexit` function. In general this can be used as a general purpose shim
> to address edge cases.
>
> It's not pretty, but as I've stated I think this is the only sound solution to
> this problem short of fully implementing the LLVM C library for both the host
> and device.

I am still not convinced about the "soundness" of the solution. I am on vacation but will try to spend more time on this tomorrow (late evening/night US west coast time) so that we can move forward on this in whatever way. I think the RFC is missing a comparison of alternatives. If you can describe the potential alternative approaches and their pros and cons, it will become easier for me (and others I am sure) to understand (and may be even concur). One of the alternatives that I had mentioned previously is separating out the offloading language use case and standalone GPU use case. IIRC, you wanted to combine them as a matter of convenience - I think you should describe that in the RFC for others benefit (and at the least for the sake of record).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153897



More information about the libc-commits mailing list