HIP currently diagnose capture of this pointer in device lambda in
host member functions. If this pointer points to managed memory,
it can be used in both device and host functions. Under this
situation, capturing this pointer in device lambda functions
in host member functions is valid usage. Change the diagnostic
about capturing this pointer to warning.
Details
- Reviewers
tra - Commits
- rG26e492e134c0: [HIP] Warn capture this pointer in device lambda
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/lib/Sema/SemaCUDA.cpp | ||
---|---|---|
881–882 | I assume there's no easy way to tell if it's a managed pointer or not. |
clang/lib/Sema/SemaCUDA.cpp | ||
---|---|---|
881–882 | 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. |
clang/lib/Sema/SemaCUDA.cpp | ||
---|---|---|
881–882 |
I'm not sure I understand what you mean. Do you suggest that the warning should be issued for both HIP and CUDA? If so, the diag already applies to CUDA. Or that we should allow capturing wrong-side this w/o diagnostics for both CUDA and HIP? I'm fine with the former. But I do not think we should silently allow capturing wrong-side this for CUDA, because it will be an error most of the time. |
clang/lib/Sema/SemaCUDA.cpp | ||
---|---|---|
881–882 | Ah. Never mind. I've replied before your latest patch update. |
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?