@@ -1867,33 +1867,34 @@ void ProgramManager::addImages(sycl_device_binaries DeviceBinary) {
1867
1867
m_BinImg2KernelIDs[Img.get ()].reset (new std::vector<kernel_id>);
1868
1868
1869
1869
for (sycl_offload_entry EntriesIt = EntriesB; EntriesIt != EntriesE;
1870
- ++EntriesIt) {
1870
+ EntriesIt = EntriesIt->Increment ()) {
1871
+
1872
+ auto name = EntriesIt->GetName ();
1871
1873
1872
1874
// Skip creating unique kernel ID if it is a service kernel.
1873
1875
// SYCL service kernels are identified by having
1874
1876
// __sycl_service_kernel__ in the mangled name, primarily as part of
1875
1877
// the namespace of the name type.
1876
- if (std::strstr (EntriesIt-> name , " __sycl_service_kernel__" )) {
1877
- m_ServiceKernels.insert (std::make_pair (EntriesIt-> name , Img.get ()));
1878
+ if (std::strstr (name, " __sycl_service_kernel__" )) {
1879
+ m_ServiceKernels.insert (std::make_pair (name, Img.get ()));
1878
1880
continue ;
1879
1881
}
1880
1882
1881
1883
// Skip creating unique kernel ID if it is an exported device
1882
1884
// function. Exported device functions appear in the offload entries
1883
1885
// among kernels, but are identifiable by being listed in properties.
1884
- if (m_ExportedSymbolImages.find (EntriesIt->name ) !=
1885
- m_ExportedSymbolImages.end ())
1886
+ if (m_ExportedSymbolImages.find (name) != m_ExportedSymbolImages.end ())
1886
1887
continue ;
1887
1888
1888
1889
// ... and create a unique kernel ID for the entry
1889
- auto It = m_KernelName2KernelIDs.find (EntriesIt-> name );
1890
+ auto It = m_KernelName2KernelIDs.find (name);
1890
1891
if (It == m_KernelName2KernelIDs.end ()) {
1891
1892
std::shared_ptr<detail::kernel_id_impl> KernelIDImpl =
1892
- std::make_shared<detail::kernel_id_impl>(EntriesIt-> name );
1893
+ std::make_shared<detail::kernel_id_impl>(name);
1893
1894
sycl::kernel_id KernelID =
1894
1895
detail::createSyclObjFromImpl<sycl::kernel_id>(KernelIDImpl);
1895
1896
1896
- It = m_KernelName2KernelIDs.emplace_hint (It, EntriesIt-> name , KernelID);
1897
+ It = m_KernelName2KernelIDs.emplace_hint (It, name, KernelID);
1897
1898
}
1898
1899
m_KernelIDs2BinImage.insert (std::make_pair (It->second , Img.get ()));
1899
1900
m_BinImg2KernelIDs[Img.get ()]->push_back (It->second );
@@ -2020,25 +2021,25 @@ void ProgramManager::removeImages(sycl_device_binaries DeviceBinary) {
2020
2021
2021
2022
// Unmap the unique kernel IDs for the offload entries
2022
2023
for (sycl_offload_entry EntriesIt = EntriesB; EntriesIt != EntriesE;
2023
- ++ EntriesIt) {
2024
+ EntriesIt = EntriesIt-> Increment () ) {
2024
2025
2025
2026
// Drop entry for service kernel
2026
- if (std::strstr (EntriesIt->name , " __sycl_service_kernel__" )) {
2027
- m_ServiceKernels.erase (EntriesIt->name );
2027
+ if (std::strstr (EntriesIt->GetName () , " __sycl_service_kernel__" )) {
2028
+ m_ServiceKernels.erase (EntriesIt->GetName () );
2028
2029
continue ;
2029
2030
}
2030
2031
2031
2032
// Exported device functions won't have a kernel ID
2032
- if (m_ExportedSymbolImages.find (EntriesIt->name ) !=
2033
+ if (m_ExportedSymbolImages.find (EntriesIt->GetName () ) !=
2033
2034
m_ExportedSymbolImages.end ()) {
2034
2035
continue ;
2035
2036
}
2036
2037
2037
2038
// remove everything associated with this KernelName
2038
- m_KernelUsesAssert.erase (EntriesIt->name );
2039
- m_KernelImplicitLocalArgPos.erase (EntriesIt->name );
2039
+ m_KernelUsesAssert.erase (EntriesIt->GetName () );
2040
+ m_KernelImplicitLocalArgPos.erase (EntriesIt->GetName () );
2040
2041
2041
- if (auto It = m_KernelName2KernelIDs.find (EntriesIt->name );
2042
+ if (auto It = m_KernelName2KernelIDs.find (EntriesIt->GetName () );
2042
2043
It != m_KernelName2KernelIDs.end ()) {
2043
2044
m_KernelName2KernelIDs.erase (It);
2044
2045
m_KernelIDs2BinImage.erase (It->second );
0 commit comments