hliao added a comment.

In D62603#1521503 <https://reviews.llvm.org/D62603#1521503>, @tra wrote:

> In D62603#1521484 <https://reviews.llvm.org/D62603#1521484>, @hliao wrote:
>
> > thanks, but that `static __device__` variable won't have shadow in host 
> > anymore.
>
>
> Why not? Your change only changes whether `externally_initialized` is applied 
> to the variable during device-side compilation. It does not change what 
> happens on the host side. 
>  AFAICT, it will still be generated on the host side and the host side should 
> still be able to take its address.
>  NVCC also allows that: https://godbolt.org/z/t78RvM


BTW, that code posted looks quite weird to me, how the code could make sense by 
return a pointer of device variable? or a pointer of shadow host variable?


Repository:
  rC Clang

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

https://reviews.llvm.org/D62603



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

Reply via email to