Skip to content

[SYCL] Move Kernel specific data from handler_impl to a separate data structure #19843

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

Draft
wants to merge 3 commits into
base: sycl
Choose a base branch
from

Conversation

vinser52
Copy link
Contributor

This PR is a prerequisite for the handler-less API.
Kernel-specific data and argument parsing logic are moved from the handler_impl to the new KernelData class that will be used in a handler-less path.

auto *DynParamImpl = static_cast<
ext::oneapi::experimental::detail::dynamic_parameter_impl *>(Ptr);

MDynamicParameters.emplace_back(DynParamImpl, Index + IndexShift);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are two functional changes in this PR (this line and line 241). Before these changes, the handler::registerDynamicParameter method was used to add a dynamic parameter. The handler::registerDynamicParameter method has two checks that might throw exceptions. Since the processArg function is moved from handler to the KernelData we cannot use handler::registerDynamicParameter. I also cannot move the registerDynamicParameter to the KernelData class because it requires to access Queue and Graph from the handler.

@vinser52 vinser52 changed the title [SYCL] Handler refactoring [SYCL] Move Kernel specific data from handler_impl to a separate data structure Aug 20, 2025
Copy link
Contributor

@aelovikov-intel aelovikov-intel left a comment

Choose a reason for hiding this comment

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

I was thinking about something like this: https://godbolt.org/z/jjG5zsb5z

@vinser52 , @sergey-semenov , WDYT?

The link above introduces

struct KernelData { /* information about device kernel */ };
struct SubmissionInfo { /* information about what's being submitted, including KernelData */ };

I think there will be a need for at least one other data structure to pass from handler to scheduler that will be encapsulating SubmissionInfo along with some other information filled in handler/no-handler submission path before reaching either scheduler or direct UR enqueue APIs.

Comment on lines +111 to +112
void *MKernelFuncPtr = nullptr;
size_t MKernelNumArgs = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

This mixes data specific to the kernel (i.e., as generated by the device compiler) and the current submission of that kernel. I believe those pieces should belong to different data structures. @Alexandr-Konovalov has introduced some SubmissionInfo few weeks/months ago. I think MKernelFuncPtr belongs there and not with things like MKernelNumArgs and MKernelIsESIMD.

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.

2 participants