[clang] [Cuda] Handle -fcuda-short-ptr even with -nocudalib (PR #111682)

Fraser Cormack via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 9 08:16:51 PDT 2024


frasercrmck wrote:

> > I'm not sure why we would ever want the current default if this is an option. I'm trying to see it, but I can't work out a case where a 64bit pointer would make sense, since the even tens-of-thousands of money supercomputer cards have less than 256KiB of addressable shared memory.
> > It might be a bit of an intrusive change (albeit a relatively mechanical one), but until we see a GPU come to market that has >4GiB addressable shared memory, I think we should use the "short pointer" datalayout as default
> 
> It also applies to constant and private / local address spaces. I don't think those hit 4 GiB yet but it's more feasible than shared. Making address space 3 32-bit by default would make sense to me.

I was also considering separating out address space 3 into its own option, yep. At that point I suppose you might as well split out the remaining two, and have `-fcuda-short-ptr` alias the three of them.

https://github.com/llvm/llvm-project/pull/111682


More information about the cfe-commits mailing list