[libc-commits] [PATCH] D148635: [libc] Add a support library for GPU utilities

Joseph Huber via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Apr 18 09:51:56 PDT 2023


jhuber6 added a comment.

So, one

In D148635#4277933 <https://reviews.llvm.org/D148635#4277933>, @JonChesterfield wrote:

> It seems like an abstraction over these things shows up in essentially every GPU codebase. I think they're a good candidate for clang intrinsics that translate to the corresponding platform specific incantation.
>
> However there are currently no such intrinsics and it's hard to anticipate how well received such a proposal would be so I'm very much I'm favour of the approach you're taking here. Long term maybe the file would shrink to zero as intrinsics are created.
>
> It seems credible that this could be a header only library. I know openmp devicertl does it's own thing based around variant dispatch but maybe it wouldn't be the worst thing to include header files from libc for part of that. It would use intrinsics if they existed I think.

Yeah, separation here is done via the macros. Intrinsics would be a solution here, but it's difficult to find a common set sometimes, since not every Nvidia builtin matches an AMD one. it would actually be possible to export these via the `libc` interface as an extension. But providing this as a library might be less optimal than handling it in LLVM.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148635



More information about the libc-commits mailing list