[PATCH] D36410: [OpenCL] Handle taking address of block captures

Alexey Bader via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 30 11:50:48 PDT 2017

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.


More information about the cfe-commits mailing list