[PATCH] D78655: [CUDA][HIP] Let non-caputuring lambda be host device

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 22 10:12:56 PDT 2020


tra added a comment.

In D78655#2105058 <https://reviews.llvm.org/D78655#2105058>, @yaxunl wrote:

> - lambdas with any lambda-capture (which must therefore have an enclosing function) inherit the enclosing function's HDness.


Nit: *any* capture does not necessarily imply existence of the enclosing function. One can explicitly capture variables in the global scope. E.g.:

  int x;
  auto l = [x=x](){ return x;};


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

https://reviews.llvm.org/D78655





More information about the cfe-commits mailing list