-
Notifications
You must be signed in to change notification settings - Fork 796
[SYCL] Enable diagnosing of indirect implicit capture of "this" #4745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The compiler issues an error if a lambda passed directly to a SYCL kernel function implicitly captures "this", but does not issue an error if the lambda that captures "this" is itself captured by the kernel lambda. The situation when SYCL kernel function captures lambda is a normal workflow for SYCL reductions, so it is important to diagnose this case as well.
|
I've reported an issue with CI to tools team. I don't think that a small change in FE somehow could make llvm build hang. |
smanna12
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
|
BTW, the previous commit passed CI checks. It lacks only comment in the test. |
premanandrao
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, one question: does this work within nested lambdas?
Yes, this should work with nested lambdas. I.e. when kernel lambda captures lambda that captures "this" - we issue an error. Or you mean something different? Or just one more level of nesting? |
I did mean one more level of nesting. Could you add a test case with one more level of nesting (and the data member being captured only within the nested one)? |
ef59534
Sure, thank you for the explanation. I've added it. |
The compiler issues an error if a lambda passed directly to a SYCL kernel
function implicitly captures "this", but does not issue an error if the
lambda that captures "this" is itself captured by the kernel lambda.
The situation when SYCL kernel function captures lambda is a normal
workflow for SYCL reductions, so it is important to diagnose this case
as well.