Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sycl/source/detail/program_manager/program_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ ProgramManager::createURProgram(const RTDeviceBinaryImage &Img,
{
std::lock_guard<std::mutex> Lock(MNativeProgramsMutex);
// associate the UR program with the image it was created for
NativePrograms[Res] = &Img;
NativePrograms.insert({Res, &Img});
}

Ctx->addDeviceGlobalInitializer(Res, {Device}, &Img);
Expand Down Expand Up @@ -840,7 +840,7 @@ ur_program_handle_t ProgramManager::getBuiltURProgram(

{
std::lock_guard<std::mutex> Lock(MNativeProgramsMutex);
NativePrograms[BuiltProgram.get()] = &Img;
NativePrograms.insert({BuiltProgram.get(), &Img});
for (RTDeviceBinaryImage *LinkedImg : DeviceImagesToLink) {
NativePrograms.insert({BuiltProgram.get(), LinkedImg});
}
Expand Down Expand Up @@ -2500,7 +2500,7 @@ device_image_plain ProgramManager::build(const device_image_plain &DeviceImage,

{
std::lock_guard<std::mutex> Lock(MNativeProgramsMutex);
NativePrograms[BuiltProgram.get()] = &Img;
NativePrograms.insert({BuiltProgram.get(), &Img});
}

ContextImpl->addDeviceGlobalInitializer(BuiltProgram.get(), Devs, &Img);
Expand Down
2 changes: 1 addition & 1 deletion sycl/source/detail/program_manager/program_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ class ProgramManager {
// the underlying program disposed of), so the map can't be used in any way
// other than binary image lookup with known live UrProgram as the key.
// NOTE: access is synchronized via the MNativeProgramsMutex
std::unordered_map<ur_program_handle_t, const RTDeviceBinaryImage *>
std::unordered_multimap<ur_program_handle_t, const RTDeviceBinaryImage *>
NativePrograms;

/// Protects NativePrograms that can be changed by class' methods.
Expand Down