This is an archive of the discontinued LLVM Phabricator instance.

[OpenCL] Allow addr space qualifiers on lambda call expressions
ClosedPublic

Authored by Anastasia on Nov 14 2019, 7:10 AM.

Details

Summary

The addr space qualifier can be added optionally for lambdas after the attributes. They will alter the default address space of lambda call operator that is in __generic address space by default for OpenCL (see https://reviews.llvm.org/D69938).

Syntax:

[ captures ] ( params ) specifiers exception attr opencl_addrspace -> ret { body }

Example:

[&] (int i) mutable __global { ... };

On the call into lambda a compatibility check will be performed to determine whether address space of lambda object and its call operator are compatible. This will follow regular address space conversion rules and there will be no difference to the behavior of address spaces in method qualifiers (see: https://reviews.llvm.org/D55850)

Diff Detail

Event Timeline

Anastasia created this revision.Nov 14 2019, 7:10 AM
Anastasia edited the summary of this revision. (Show Details)Nov 14 2019, 7:10 AM
rjmccall accepted this revision.Nov 15 2019, 1:12 PM

Well that was easy.

Do we accept the address-space attribute in this position, or is that TBD?

This revision is now accepted and ready to land.Nov 15 2019, 1:12 PM

Well that was easy.

Do we accept the address-space attribute in this position, or is that TBD?

We accept the OpenCL one right at the end. I might need to test more in C++ though...

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptDec 4 2019, 4:34 AM