-
Notifications
You must be signed in to change notification settings - Fork 795
[NFC][SYCL] Refactor code around device_image_impl::KernelIDs
#19516
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
Open
aelovikov-intel
wants to merge
1
commit into
intel:sycl
Choose a base branch
from
aelovikov-intel:get_kernel_ids_ptr
base: sycl
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+54
−47
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fbbf961
to
4e11774
Compare
4e11774
to
c69c3ba
Compare
aelovikov-intel
commented
Jul 18, 2025
@@ -2691,7 +2691,7 @@ ProgramManager::createDependencyImage(const context &Ctx, devices_range Devs, | |||
assert(DepState == getBinImageState(DepImage) && | |||
"State mismatch between main image and its dependency"); | |||
DeviceImageImplPtr DepImpl = | |||
device_image_impl::create(DepImage, Ctx, Devs, DepState, DepKernelIDs, | |||
device_image_impl::create(DepImage, Ctx, Devs, DepState, std::move(DepKernelIDs), |
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.
An alternative to part of this change would be to initialize DepKernelIDs
if it's nullptr
here and add an assert in device_image_impl::create
to make sure that device_image_impl::KernelIDs
is always non-null. @steffenlarsen, what approach would you like better?
c69c3ba
to
a4a6feb
Compare
device_image_impl::get_kernel_ids_ptr
device_image_impl::KernelIDs
a4a6feb
to
f7ed339
Compare
* Clarify the reason for `std::shared_ptr` (performance) * Clarify that `get_kernel_ids` is preferred over `get_kernel_ids_ptr` and update some of the existing uses of the latter to use the former * Change `get_kernel_ids` to return `iterator_range` instead of the reference to the underlying container. That way we can also return an empty range when `shared_ptr` isn't initialized, which was possible before but many ctors led to believe that is guaranteed to never happen. * Change those ctors to keep empty `shared_ptr` instead of creating empty `vector`s
f7ed339
to
146abac
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
std::shared_ptr
(performance,see Improve get_kernel_bundle performance #5496)
get_kernel_ids
is preferred overget_kernel_ids_ptr
andupdate some of the existing uses of the latter to use the former
get_kernel_ids
to returniterator_range
instead of thereference to the underlying container. That way we can also return an
empty range when
shared_ptr
isn't initialized, which was possiblebefore but many ctors led to believe that is guaranteed to never happen.
shared_ptr
instead of creatingempty
vector
s