-
Notifications
You must be signed in to change notification settings - Fork 798
[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
base: sycl
Are you sure you want to change the base?
Conversation
…ure to use it in handler-based and handler-less submission paths
auto *DynParamImpl = static_cast< | ||
ext::oneapi::experimental::detail::dynamic_parameter_impl *>(Ptr); | ||
|
||
MDynamicParameters.emplace_back(DynParamImpl, Index + IndexShift); |
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.
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.
handler_impl
to a separate data structure
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.
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.
void *MKernelFuncPtr = nullptr; | ||
size_t MKernelNumArgs = 0; |
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.
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
.
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 newKernelData
class that will be used in a handler-less path.