Skip to content

Conversation

sommerlukas
Copy link
Contributor

Add support for the DPC++ SYCL extension raw_kernel_arg that allows to pass a binary blob as kernel arguments.

This is for example useful if the kernel uses a struct as kernel parameter, but is loaded from SPIR-V and the argument type is unknown for set_arg.

The implementation follows #1984.

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?
  • If this PR is a work in progress, are you opening the PR as a draft?

@coveralls
Copy link
Collaborator

coveralls commented Apr 2, 2025

Coverage Status

coverage: 86.354% (-0.06%) from 86.41%
when pulling 5fb74e6 on sommerlukas:raw-kernel-arg
into 3e74087 on IntelPython:master.

@ndgrigorian
Copy link
Collaborator

@sommerlukas
Master now has a fix for nightly build, so please merge or rebase on master so the tests run on nightly compiler

Switch approach to not introduce an intermediate struct, but have the
opaque pointer directly point to std::vector instead.
@sommerlukas
Copy link
Contributor Author

Thanks for the feedback @ndgrigorian @AlexanderKalistratov!

After taking a look at how the opaque pointers for other std::vector work, I've changed the approach: I've removed RawKernelArgDataTy entirely, so that the opaque pointer (DPCTLSyclRawKernelArgRef) now directly points to std::vector<unsigned char>. That way, we can avoid defining a struct with std::vector in the header, so the offending includes of <vector> and <cstring> are now removed.

@sommerlukas
Copy link
Contributor Author

sommerlukas commented Apr 30, 2025

@ndgrigorian @AlexanderKalistratov Friendly ping for reviews. CI is looking quite good now, I can unfortunately not see the logs for the single failing Jenkins job.

Copy link

@AlexanderKalistratov AlexanderKalistratov left a comment

Choose a reason for hiding this comment

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

@sommerlukas PR looks great for me, thank you!
I'm not code owner, so we need to wait @ndgrigorian review as well

@ndgrigorian
Copy link
Collaborator

@ndgrigorian @AlexanderKalistratov Friendly ping for reviews. CI is looking quite good now, I can unfortunately not see the logs for the single failing Jenkins job.

Sorry, forgot to put my final review on this.

Jenkins job is unrelated. I'll give it a last look over but I think it's ready to go in.

Copy link
Collaborator

@ndgrigorian ndgrigorian left a comment

Choose a reason for hiding this comment

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

LGTM!

@ndgrigorian ndgrigorian merged commit 32948cd into IntelPython:master May 1, 2025
70 of 71 checks passed
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.

4 participants