-
Notifications
You must be signed in to change notification settings - Fork 814
[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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,7 @@ | |
| #include "sycl/handler.hpp" | ||
| #include <detail/cg.hpp> | ||
| #include <detail/kernel_bundle_impl.hpp> | ||
| #include <detail/kernel_data.hpp> | ||
| #include <memory> | ||
| #include <sycl/ext/oneapi/experimental/enqueue_types.hpp> | ||
|
|
||
|
|
@@ -61,8 +62,7 @@ class handler_impl { | |
| } | ||
|
|
||
| KernelNameStrRefT getKernelName() const { | ||
| assert(MDeviceKernelInfoPtr); | ||
| return static_cast<KernelNameStrRefT>(MDeviceKernelInfoPtr->Name); | ||
| return MKernelData.getKernelName(); | ||
| } | ||
|
|
||
| /// Registers mutually exclusive submission states. | ||
|
|
@@ -108,12 +108,6 @@ class handler_impl { | |
| // If the pipe operation is read or write, 1 for read 0 for write. | ||
| bool HostPipeRead = true; | ||
|
|
||
| ur_kernel_cache_config_t MKernelCacheConfig = UR_KERNEL_CACHE_CONFIG_DEFAULT; | ||
|
|
||
| bool MKernelIsCooperative = false; | ||
| bool MKernelUsesClusterLaunch = false; | ||
| uint32_t MKernelWorkGroupMemorySize = 0; | ||
|
|
||
| // Extra information for bindless image copy | ||
| ur_image_desc_t MSrcImageDesc = {}; | ||
| ur_image_desc_t MDstImageDesc = {}; | ||
|
|
@@ -138,29 +132,17 @@ class handler_impl { | |
| sycl::ext::oneapi::experimental::node_type MUserFacingNodeType = | ||
| sycl::ext::oneapi::experimental::node_type::empty; | ||
|
|
||
| // Storage for any SYCL Graph dynamic parameters which have been flagged for | ||
| // registration in the CG, along with the argument index for the parameter. | ||
| std::vector<std::pair< | ||
| ext::oneapi::experimental::detail::dynamic_parameter_impl *, int>> | ||
| MDynamicParameters; | ||
|
|
||
| /// The storage for the arguments passed. | ||
| /// We need to store a copy of values that are passed explicitly through | ||
| /// set_arg, require and so on, because we need them to be alive after | ||
| /// we exit the method they are passed in. | ||
| detail::CG::StorageInitHelper CGData; | ||
|
|
||
| /// The list of arguments for the kernel. | ||
| std::vector<detail::ArgDesc> MArgs; | ||
|
|
||
| /// The list of associated accessors with this handler. | ||
| /// These accessors were created with this handler as argument or | ||
| /// have become required for this handler via require method. | ||
| std::vector<detail::ArgDesc> MAssociatedAccesors; | ||
|
|
||
| /// Struct that encodes global size, local size, ... | ||
| detail::NDRDescT MNDRDesc; | ||
|
|
||
| /// Type of the command group, e.g. kernel, fill. Can also encode version. | ||
| /// Use getType and setType methods to access this variable unless | ||
| /// manipulations with version are required | ||
|
|
@@ -241,16 +223,16 @@ class handler_impl { | |
| // Allocation ptr to be freed asynchronously. | ||
| void *MFreePtr = nullptr; | ||
|
|
||
| // Store information about the kernel arguments. | ||
| void *MKernelFuncPtr = nullptr; | ||
| #ifndef __INTEL_PREVIEW_BREAKING_CHANGES | ||
| // TODO: remove in the next ABI-breaking window | ||
| // Today they are used only in the handler::setKernelNameBasedCachePtr | ||
|
Comment on lines
+227
to
+228
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This makes little sense to me. Everything under
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These vars are used only when app is compiled with 6.3 compiler. In case of 6.3 compiler You are right that this members does not cross ABI boundaries, but they are used only by the API that is under |
||
| int MKernelNumArgs = 0; | ||
| detail::kernel_param_desc_t (*MKernelParamDescGetter)(int) = nullptr; | ||
| bool MKernelIsESIMD = false; | ||
| bool MKernelHasSpecialCaptures = true; | ||
| #endif | ||
|
|
||
| // A pointer to device kernel information. Cached on the application side in | ||
| // headers or retrieved from program manager. | ||
| DeviceKernelInfo *MDeviceKernelInfoPtr = nullptr; | ||
| KernelData MKernelData; | ||
| }; | ||
|
|
||
| } // namespace detail | ||
|
|
||
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.
@sergey-semenov I removed this assert because in case of app was compiled with the 6.3 compiler, the kernel size is not passed from the headers to the runtime.
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.
After discussion with @sergey-semenov, we decided to keep this assert in the preview mode.
Corresponding comment is added.
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 deserves more explanation (probably in the PR description). New
KernelDatais undersource/detailand doesn't cross ABI boundary. What are we changing here that has ABI effects and why can't that be done in a separate PR?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.
But I added comment in place. And the issue happens only in case of 6.3 or 6.2 headers. There is nothing about ABI here.