bader added a comment.

In https://reviews.llvm.org/D36410#856716, @yaxunl wrote:

> The captured variable is still passed by value. The address taking is on the 
> duplicate of the captured variable, not on the original variable.


In this case address of captured variables should point to the private address 
space, as function parameters reside in private address space (see "6.5 Address 
Space Qualifiers" paragraph 3).
This makes unclear to me how capturing works for variables declared in the 
address spaces other than private (e.g. `local int a;`).

> The OpenCL spec does not forbid taking address of captured variable. 
> Forbidding taking address of captured variable would violate the spec.

I'm not sure yet, but it might be OpenCL spec inconsistency issue.


https://reviews.llvm.org/D36410



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

Reply via email to