-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL] Make SYCL RT compatible with the new offload entry type #17109
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
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
254245f
[SYCL] Make SYCL RT compatible with the new offload entry type
uditagarwal97 deb4cc2
Merge remote-tracking branch 'upstream/sycl' into new_offload_entry
uditagarwal97 d7accea
Fix offload entry iteratoe when using old vs. new offload entry format
uditagarwal97 23bbab4
Fix iterator increment
uditagarwal97 ecf90ce
Fix warning
uditagarwal97 8907ff3
Fix more warnings
uditagarwal97 3f05144
clang format
uditagarwal97 fbfacf1
Merge remote-tracking branch 'upstream/sycl' into new_offload_entry
uditagarwal97 5cbe3bc
Merge remote-tracking branch 'upstream/sycl' into new_offload_entry
uditagarwal97 7d5c150
Revert "[SYCL] Use legacy offload entry type for now"
uditagarwal97 bc61a95
Fix how we detect newer/older version of the struct
uditagarwal97 374a4bc
Fix test failures
uditagarwal97 e75c615
Fix driver LIT failure
uditagarwal97 330eb76
Merge remote-tracking branch 'upstream/sycl' into new_offload_entry
uditagarwal97 8d70601
Address reviews
uditagarwal97 4365f4a
Apply suggestions from code review
uditagarwal97 658c408
Merge remote-tracking branch 'upstream/sycl' into new_offload_entry
uditagarwal97 9ec3116
Adress reviews
uditagarwal97 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1867,33 +1867,34 @@ void ProgramManager::addImages(sycl_device_binaries DeviceBinary) { | |
m_BinImg2KernelIDs[Img.get()].reset(new std::vector<kernel_id>); | ||
|
||
for (sycl_offload_entry EntriesIt = EntriesB; EntriesIt != EntriesE; | ||
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. will the iterator work when the input binary is using legacy entry format? sizeof entries are different. |
||
++EntriesIt) { | ||
EntriesIt = EntriesIt->Increment()) { | ||
|
||
auto name = EntriesIt->GetName(); | ||
|
||
// Skip creating unique kernel ID if it is a service kernel. | ||
// SYCL service kernels are identified by having | ||
// __sycl_service_kernel__ in the mangled name, primarily as part of | ||
// the namespace of the name type. | ||
if (std::strstr(EntriesIt->name, "__sycl_service_kernel__")) { | ||
m_ServiceKernels.insert(std::make_pair(EntriesIt->name, Img.get())); | ||
if (std::strstr(name, "__sycl_service_kernel__")) { | ||
m_ServiceKernels.insert(std::make_pair(name, Img.get())); | ||
continue; | ||
} | ||
|
||
// Skip creating unique kernel ID if it is an exported device | ||
// function. Exported device functions appear in the offload entries | ||
// among kernels, but are identifiable by being listed in properties. | ||
if (m_ExportedSymbolImages.find(EntriesIt->name) != | ||
m_ExportedSymbolImages.end()) | ||
if (m_ExportedSymbolImages.find(name) != m_ExportedSymbolImages.end()) | ||
continue; | ||
|
||
// ... and create a unique kernel ID for the entry | ||
auto It = m_KernelName2KernelIDs.find(EntriesIt->name); | ||
auto It = m_KernelName2KernelIDs.find(name); | ||
if (It == m_KernelName2KernelIDs.end()) { | ||
std::shared_ptr<detail::kernel_id_impl> KernelIDImpl = | ||
std::make_shared<detail::kernel_id_impl>(EntriesIt->name); | ||
std::make_shared<detail::kernel_id_impl>(name); | ||
sycl::kernel_id KernelID = | ||
detail::createSyclObjFromImpl<sycl::kernel_id>(KernelIDImpl); | ||
|
||
It = m_KernelName2KernelIDs.emplace_hint(It, EntriesIt->name, KernelID); | ||
It = m_KernelName2KernelIDs.emplace_hint(It, name, KernelID); | ||
} | ||
m_KernelIDs2BinImage.insert(std::make_pair(It->second, Img.get())); | ||
m_BinImg2KernelIDs[Img.get()]->push_back(It->second); | ||
|
@@ -2020,25 +2021,25 @@ 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 = EntriesIt->Increment()) { | ||
|
||
// Drop entry for service kernel | ||
if (std::strstr(EntriesIt->name, "__sycl_service_kernel__")) { | ||
m_ServiceKernels.erase(EntriesIt->name); | ||
if (std::strstr(EntriesIt->GetName(), "__sycl_service_kernel__")) { | ||
m_ServiceKernels.erase(EntriesIt->GetName()); | ||
continue; | ||
} | ||
|
||
// Exported device functions won't have a kernel ID | ||
if (m_ExportedSymbolImages.find(EntriesIt->name) != | ||
if (m_ExportedSymbolImages.find(EntriesIt->GetName()) != | ||
m_ExportedSymbolImages.end()) { | ||
continue; | ||
} | ||
|
||
// remove everything associated with this KernelName | ||
m_KernelUsesAssert.erase(EntriesIt->name); | ||
m_KernelImplicitLocalArgPos.erase(EntriesIt->name); | ||
m_KernelUsesAssert.erase(EntriesIt->GetName()); | ||
m_KernelImplicitLocalArgPos.erase(EntriesIt->GetName()); | ||
|
||
if (auto It = m_KernelName2KernelIDs.find(EntriesIt->name); | ||
if (auto It = m_KernelName2KernelIDs.find(EntriesIt->GetName()); | ||
It != m_KernelName2KernelIDs.end()) { | ||
m_KernelName2KernelIDs.erase(It); | ||
m_KernelIDs2BinImage.erase(It->second); | ||
|
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.