tra added a comment.

I'd propose splitting the patch into two. One with the addition of CUID and the 
other that changes the way we havdle static vars.
CUID is useful on its own and is relatively uncontroversial.

Externalizing static vars is a more interesting issue and I'm not sure what's 
the best way to handle it yet. On one hand it is necessary for visibility 
across host/device, on the other, externalizing all static vars will almost 
always have negative effect as very few of the static vars actually need this. 
As already pointed out in the `#if 0` section of the patch, ideally we should 
externalize only the vars that need it. Generally speaking, I do not think we 
will be able to do that, because with `-fgpu-rdc` it may be used from the host 
code in some other TU.

We may need to explicitly annotate such the static variables that need to be 
visible on both sides and only apply externalization to the variables annotated 
this way. E.g. require them to be `__host__ __device__`.

WDYT?


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

https://reviews.llvm.org/D85223

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

Reply via email to