rjmccall added a comment.

In https://reviews.llvm.org/D44985#1050674, @yaxunl wrote:

> In https://reviews.llvm.org/D44985#1050670, @rjmccall wrote:
>
> > What exactly are you trying to express here?  Are you just trying to make 
> > these external declarations when compiling for the device because 
> > `__shared__` variables are actually defined on the host?  That should be 
> > handled by the frontend by setting up the AST so that these declarations 
> > are not definitions.
>
>
> No. These variables are not like external symbols defined on the host. They 
> behave like global variables in the kernel code but never initialized. 
> Currently no targets are able to initialize them and it is users' 
> responsibility to initialize them explicitly.
>
> Giving them an initial value will cause error in some backends since they 
> cannot handle them, therefore put undef as initializer.


So undef is being used as a special marker to the backends that it's okay not 
to try to initialize these variables?


https://reviews.llvm.org/D44985



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

Reply via email to