File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed
sycl/source/detail/program_manager Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -1822,6 +1822,7 @@ ProgramManager::kernelImplicitLocalArgPos(KernelNameStrRefT KernelName) const {
18221822
18231823DeviceKernelInfo &ProgramManager::getOrCreateDeviceKernelInfo (
18241824 const CompileTimeKernelInfoTy &Info) {
1825+ std::lock_guard<std::mutex> Guard (m_DeviceKernelInfoMapMutex);
18251826 auto Result =
18261827 m_DeviceKernelInfoMap.try_emplace (KernelNameStrT{Info.Name .data ()}, Info);
18271828 Result.first ->second .setCompileTimeInfoIfNeeded (Info);
@@ -1830,6 +1831,7 @@ DeviceKernelInfo &ProgramManager::getOrCreateDeviceKernelInfo(
18301831
18311832DeviceKernelInfo &
18321833ProgramManager::getOrCreateDeviceKernelInfo (KernelNameStrRefT KernelName) {
1834+ std::lock_guard<std::mutex> Guard (m_DeviceKernelInfoMapMutex);
18331835 auto Result = m_DeviceKernelInfoMap.try_emplace (
18341836 KernelName, CompileTimeKernelInfoTy{std::string_view (KernelName)});
18351837 return Result.first ->second ;
Original file line number Diff line number Diff line change @@ -540,6 +540,9 @@ class ProgramManager {
540540 // by caching the pointers when possible.
541541 std::unordered_map<KernelNameStrT, DeviceKernelInfo> m_DeviceKernelInfoMap;
542542
543+ // Protects m_DeviceKernelInfoMap.
544+ std::mutex m_DeviceKernelInfoMapMutex;
545+
543546 // Sanitizer type used in device image
544547 SanitizerType m_SanitizerFoundInImage;
545548
You can’t perform that action at this time.
0 commit comments