diff --git a/sycl/source/detail/device_global_map.hpp b/sycl/source/detail/device_global_map.hpp index 256c48066ec87..1bcb7d37ad297 100644 --- a/sycl/source/detail/device_global_map.hpp +++ b/sycl/source/detail/device_global_map.hpp @@ -27,10 +27,17 @@ class DeviceGlobalMap { DeviceGlobalMap(bool OwnerControlledCleanup) : MOwnerControlledCleanup{OwnerControlledCleanup} {} + DeviceGlobalMap(const DeviceGlobalMap &) = delete; + DeviceGlobalMap &operator=(const DeviceGlobalMap &) = delete; + ~DeviceGlobalMap() { - if (!MOwnerControlledCleanup) - for (auto &DeviceGlobalIt : MDeviceGlobals) - DeviceGlobalIt.second->cleanup(); + try { + if (!MOwnerControlledCleanup) + for (auto &DeviceGlobalIt : MDeviceGlobals) + DeviceGlobalIt.second->cleanup(); + } catch (std::exception &e) { + __SYCL_REPORT_EXCEPTION_TO_STREAM("exception in ~DeviceGlobalMap", e); + } } void initializeEntries(const RTDeviceBinaryImage *Img) { diff --git a/sycl/source/detail/device_global_map_entry.hpp b/sycl/source/detail/device_global_map_entry.hpp index 1796e8d179db1..8c5e8a2d55767 100644 --- a/sycl/source/detail/device_global_map_entry.hpp +++ b/sycl/source/detail/device_global_map_entry.hpp @@ -67,14 +67,14 @@ struct DeviceGlobalMapEntry { // Constructor for only initializing ID and pointer. The other members will // be initialized later. DeviceGlobalMapEntry(std::string UniqueId, const void *DeviceGlobalPtr) - : MUniqueId(UniqueId), MDeviceGlobalPtr(DeviceGlobalPtr) {} + : MUniqueId(std::move(UniqueId)), MDeviceGlobalPtr(DeviceGlobalPtr) {} // Constructor for only initializing ID, type size, and device image scope // flag. The pointer to the device global will be initialized later. DeviceGlobalMapEntry(std::string UniqueId, const RTDeviceBinaryImage *Img, std::uint32_t DeviceGlobalTSize, bool IsDeviceImageScopeDecorated) - : MUniqueId(UniqueId), MImages{Img}, + : MUniqueId(std::move(UniqueId)), MImages{Img}, MImageIdentifiers{reinterpret_cast(Img)}, MDeviceGlobalTSize(DeviceGlobalTSize), MIsDeviceImageScopeDecorated(IsDeviceImageScopeDecorated) {} diff --git a/sycl/source/detail/property_set_io.hpp b/sycl/source/detail/property_set_io.hpp index 860c1ef27f50b..5865479ea9dca 100644 --- a/sycl/source/detail/property_set_io.hpp +++ b/sycl/source/detail/property_set_io.hpp @@ -30,7 +30,7 @@ static IntT stringViewToInt(const std::string_view &SV) { if (SV.empty()) return Result; - bool Negate = std::is_signed_v && SV[0] == '-'; + const bool Negate = std::is_signed_v && SV[0] == '-'; for (size_t I = static_cast(Negate); I < SV.size(); ++I) { const char CurrentC = SV[I]; diff --git a/xpti/include/xpti/xpti_trace_framework.hpp b/xpti/include/xpti/xpti_trace_framework.hpp index bccbc4f0f55ae..4122291cfe81f 100644 --- a/xpti/include/xpti/xpti_trace_framework.hpp +++ b/xpti/include/xpti/xpti_trace_framework.hpp @@ -1731,6 +1731,7 @@ class tracepoint_t { m_default_event_type = (uint16_t)xpti::trace_event_type_t::algorithm; m_default_activity_type = xpti::trace_activity_type_t::active; m_default_name = "Message"; // Likely never used + m_instID = 0; } /// The payload data structure that is prepared from code_location(), /// caller_callee string or kernel name/codepointer based on the opt-in flag.