[libc-commits] [PATCH] D156731: [libc] Add basic wrappers for the backend address spaces

Joseph Huber via Phabricator via libc-commits libc-commits at lists.llvm.org
Mon Jul 31 14:06:38 PDT 2023


jhuber6 added inline comments.


================
Comment at: libc/src/__support/GPU/amdgpu/utils.h:25-28
+template <typename T> using Private = [[clang::address_space(5)]] T;
+template <typename T> using Constant = [[clang::address_space(4)]] T;
+template <typename T> using Shared = [[clang::address_space(3)]] T;
+template <typename T> using Global = [[clang::address_space(1)]] T;
----------------
arsenm wrote:
> jhuber6 wrote:
> > arsenm wrote:
> > > jhuber6 wrote:
> > > > arsenm wrote:
> > > > > I don't really condone using the numbered address spaces to access these, they don't quite work the same way
> > > > They directly map LLVM ones to the ones documented in the backend. Since this is regular C++ we don't have any other option.
> > > Doesn't declaring as the opencl langAses work? I think those have attributes
> > That doesn't work for NVPTX it seems, https://godbolt.org/z/7515T83nE.
> This looks correct to me when you account for the stack-is-flat hack PTX uses
Ah, you're right it seems it understands constant and friends.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D156731



More information about the libc-commits mailing list