[PATCH] D18458: [CUDA] Mangle __host__ __device__ functions differently than __host__ or __device__ functions.
Justin Lebar via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 24 17:55:13 PDT 2016
jlebar added a comment.
In http://reviews.llvm.org/D18458#383266, @rsmith wrote:
> This makes the "`constexpr` implies `__host__` `__device__`" patch look slightly questionable: two translation units defining the same `constexpr` function will mangle that function differently depending on whether the translation unit is built with CUDA support enabled. That will cause you to get duplicates of static locals and the like (but I suppose you do anyway between the host and the device, so maybe that's not much more broken than it would be regardless).
Hm. I agree that would be surprising to users.
I suppose we could say that HD can overload D but not H. Then we could apply mangling to all device functions, solving the ambiguity that way. That feels pretty ham-fisted, though. :-/
More information about the cfe-commits