Skip to content

Conversation

@Fznamznon
Copy link
Contributor

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.

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.
@Fznamznon
Copy link
Contributor Author

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
smanna12 previously approved these changes Oct 12, 2021
Copy link
Contributor

@smanna12 smanna12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@Fznamznon
Copy link
Contributor Author

BTW, the previous commit passed CI checks. It lacks only comment in the test.

Copy link
Contributor

@premanandrao premanandrao left a 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?

@Fznamznon
Copy link
Contributor Author

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?

@premanandrao
Copy link
Contributor

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)?

@Fznamznon Fznamznon dismissed stale reviews from smanna12 and elizabethandrews via ef59534 October 12, 2021 17:10
@Fznamznon
Copy link
Contributor Author

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)?

Sure, thank you for the explanation. I've added it.

@bader bader merged commit dce4c6a into intel:sycl Oct 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants