[PATCH] D78655: [CUDA][HIP] Let lambda be host device by default

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 30 14:41:41 PDT 2020


tra added inline comments.


================
Comment at: clang/lib/Sema/SemaCUDA.cpp:750
 
+bool Sema::CUDACheckLambdaCapture(CXXMethodDecl *Callee,
+                                  const sema::Capture &Capture) {
----------------
What does the return value mean? We don't seem to check it anyways.  If we don't care about the result, perhaps the function should be void.
If we do, then it would be good to document its purpose and returned values and, probably, rename it to better indicate what is it it's supposed to check.


================
Comment at: clang/lib/Sema/SemaLambda.cpp:1783
+
+      if (LangOpts.CUDA && LangOpts.CUDAIsDevice)
+        CUDACheckLambdaCapture(CallOperator, From);
----------------
I would expect Sema-level diags to be produced during both host and device compilation. Some of the diags for HD may need to be postponed until after things have been CodeGen'ed, but the checks should happen nevertheless.




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

https://reviews.llvm.org/D78655





More information about the cfe-commits mailing list