[PATCH] D91088: [CUDA][HIP] Fix capturing reference to host variable

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 24 05:39:08 PST 2020


yaxunl marked 2 inline comments as done.
yaxunl added a comment.

ping



================
Comment at: clang/lib/Sema/SemaExpr.cpp:357
 
+  if (LangOpts.CUDAIsDevice) {
+    auto *FD = dyn_cast_or_null<FunctionDecl>(CurContext);
----------------
tra wrote:
> This could use a comment about why we only check `D->H` references.
> `H->D` references will still work (sort of) because on the host side we have matching `shadow` variables.
> 
> 
the comment has been added in the separated patch for diagnostics.


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

https://reviews.llvm.org/D91088



More information about the cfe-commits mailing list