-
Notifications
You must be signed in to change notification settings - Fork 798
[SYCL] Delete symbol based info with the last image referencing it #19659
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
Prior to this patch, kernel name based info (e.g. kernel id or assert usage) was deleted whenever an image referencing it was removed. This is technically incorrect since multiple images can contain the same kernel name.
This reverts commit dcb4788.
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.
LGTM
@@ -2140,44 +2155,67 @@ void ProgramManager::removeImages(sycl_device_binaries DeviceBinary) { | |||
// Unmap the unique kernel IDs for the offload entries | |||
for (sycl_offload_entry EntriesIt = EntriesB; EntriesIt != EntriesE; | |||
EntriesIt = EntriesIt->Increment()) { | |||
|
|||
const char *Name = EntriesIt->GetName(); |
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.
Can it be std::string_view
instead?
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 changed it to detail::KernelNameStrT
, which maps to std::string_view
in preview builds and std::string
otherwise, since there are a lot of containers involved that use this key type and don't have heterogenous lookup support.
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 don't have hard objections any more.
m_KernelIDs2BinImage.erase(It->second); | ||
m_KernelName2KernelIDs.erase(It); | ||
auto Name2IDIt = m_KernelName2KernelIDs.find(Name); | ||
if (Name2IDIt != m_KernelName2KernelIDs.end()) |
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.
When isn't that true?
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.
Nothing comes to mind, pretty sure this should be an assert. I'll make a follow up change for this.
Prior to this patch, symbol based info (e.g. kernel id, kernel assert usage or images containing an exported symbol) was deleted whenever an image referencing it was removed. This is incorrect since multiple images can contain the same symbol.
While unlikely to cause any problems now (since those images usually all get removed with one call to
removeImages
after another), this will cause issues once kernel name based kernel caches start getting cleaned up in the same manner.