yaxunl marked an inline comment as done. yaxunl added inline comments.
================ Comment at: clang/lib/Sema/SemaCUDA.cpp:881-882 + } else if (Capture.isThisCapture() && !LangOpts.HIP) { + // Capture of this pointer is allowed for HIP since this pointer may be + // pointing to managed memory which is accessible on both device and + // host sides. ---------------- tra wrote: > I assume there's no easy way to tell if it's a managed pointer or not. > Capturing a non-managed pointer would still be bad. > Should we make it a warning instead? > > warning makes sense. will do. Also this should apply to CUDA too. Although clang does not support `__managed__` keyword for CUDA, `this` pointer may be allocated in managed memory through host API's. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D108493/new/ https://reviews.llvm.org/D108493 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits