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.  :-/


http://reviews.llvm.org/D18458



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to