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

Jon Chesterfield via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Jun 27 11:09:07 PDT 2023


JonChesterfield added a comment.

Including system headers which know nothing about GPU architectures on the GPU causes a lot of grief in the offloading languages.

How necessary is it to put both our headers and the system one in the same translation unit, given that libc is meant to abstract over architectures? If a fundamental goal is bugward compat with glibc, we're probably better off including the glibc headers in whatever hacky way seems fit and providing an implementation shim that makes this work. E.g. for the div_t example, we swap the fields on the way into and out of the libc implementation.

This setup would be
Glibc headers
Header hacks
Llvm libc translation shim
Llvm libc

While the pure, non-glibc-hybrid thing would just use the libc headers directly on the host and the GPU.


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