Skip to content

[SYCL] Move function pointer diagnostics to BuildResolvedCallExpr #16987

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

Merged
merged 10 commits into from
Mar 19, 2025

Conversation

Naghasan
Copy link
Contributor

The patch moves the function pointer related diagnostics from DiagDeviceFunction::VisitCallExpr class to BuildResolvedCallExpr and use a delayed diagnostic.

This allow the compiler to provide the template instantiation trace when emitting the diagnostic.

The patch moves the function pointer related diagnostics from
DiagDeviceFunction::VisitCallExpr class to BuildResolvedCallExpr
and use a delayed diagnostic.

This allow the compiler to provide the template instantiation trace
when emitting the diagnostic.
@Naghasan Naghasan requested a review from a team as a code owner February 12, 2025 17:04
@premanandrao
Copy link
Contributor

What diagnostics are possible with this change that weren't possible before? Please add test case showing them.

@Naghasan
Copy link
Contributor Author

It just didn't display the instantiation stack, making things difficult to understand where it was coming from. Updated test to check the note emission.

Copy link
Contributor

@Fznamznon Fznamznon left a comment

Choose a reason for hiding this comment

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

That is a nice improvement! Could you please also check that the error is not emitted from the host code? Delayed diagnostics can be buggy.

@Naghasan
Copy link
Contributor Author

Could you please also check that the error is not emitted from the host code?

Sure, I added a no-diagnostics check in constexpr-function-pointer.cpp

Copy link
Contributor

@Fznamznon Fznamznon left a comment

Choose a reason for hiding this comment

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

Thanks!

@Naghasan
Copy link
Contributor Author

@premanandrao do you have comments on the PR ?

@Naghasan
Copy link
Contributor Author

Naghasan commented Mar 6, 2025

ping @premanandrao

@Naghasan
Copy link
Contributor Author

@intel/llvm-gatekeepers I believe this ready (comments addressed and PR approved)

@sommerlukas sommerlukas merged commit 270bb93 into intel:sycl Mar 19, 2025
23 checks passed
@KornevNikita
Copy link
Contributor

@Naghasan this commit broke the sycl-cts/test_language test (see):

/__w/llvm/llvm/khronos_sycl_cts/tests/language/constant_evaluation.cpp:52:22: error: SYCL kernel cannot call through a function pointer
   52 |         auto other = p(5) + f(6);
      |                      ^

Is it a test issue?

@igchor
Copy link
Member

igchor commented Mar 20, 2025

@Naghasan This is also causing issues for llama.cpp. They pass function pointers as a template parameter and this triggers an error after this patch. See here: https://github.com/ggml-org/llama.cpp/blob/master/ggml/src/ggml-sycl/mmq.cpp#L1196

@aelovikov-intel
Copy link
Contributor

Is it a test issue?

No, that's a bug in our implementation. KhronosGroup/SYCL-Docs#388 explicitly allowed that code.

@Naghasan
Copy link
Contributor Author

Is it a test issue?

well it is, clang lit works but there is clearly holes in them

KornevNikita added a commit that referenced this pull request Mar 20, 2025
@aelovikov-intel
Copy link
Contributor

Is it a test issue?

well it is, clang lit works but there is clearly holes in them

Can you clarify what you mean? CTS failure is real and not a test issue.

@pbalcer
Copy link
Contributor

pbalcer commented Mar 20, 2025

Is it a test issue?

well it is, clang lit works but there is clearly holes in them

Can you clarify what you mean? CTS failure is real and not a test issue.

Also, like @igchor said llama.cpp, which we use for performance testing, no longer compiles after this PR.

@Naghasan
Copy link
Contributor Author

Can you clarify what you mean? CTS failure is real and not a test issue.

there is coverage in clang's tests :)

working on a fix BTW

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.

8 participants