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

Paul Fultz II via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 22 14:31:44 PDT 2020


pfultz2 added inline comments.


================
Comment at: clang/lib/Sema/SemaCUDA.cpp:753
     return;
+  if (LI.Default == LCD_None && LI.Captures.size() == 0) {
+    Method->addAttr(CUDADeviceAttr::CreateImplicit(Context));
----------------
There should at least be a flag to enable capturing lambdas to be implicitly HD. I dont really understand the rational for making capturing lambdas not implicitly HD. It seems like its trying to prevent using an address to host on the device, but I dont see how this prevents that at all. 

This will also break the compilation in rocm. Should we use a fork of llvm to compile rocm?


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

https://reviews.llvm.org/D78655





More information about the cfe-commits mailing list