diff --git a/sycl/plugins/unified_runtime/ur/adapters/level_zero/common.cpp b/sycl/plugins/unified_runtime/ur/adapters/level_zero/common.cpp index 3d9da756faf2a..9b32c5f9d58e3 100644 --- a/sycl/plugins/unified_runtime/ur/adapters/level_zero/common.cpp +++ b/sycl/plugins/unified_runtime/ur/adapters/level_zero/common.cpp @@ -90,7 +90,7 @@ bool setEnvVar(const char *name, const char *value) { ZeUSMImportExtension ZeUSMImport; // This will count the calls to Level-Zero -std::map *ZeCallCount = nullptr; +std::map *ZeCallCount = nullptr; inline void zeParseError(ze_result_t ZeError, const char *&ErrorString) { switch (ZeError) { diff --git a/sycl/plugins/unified_runtime/ur/adapters/level_zero/common.hpp b/sycl/plugins/unified_runtime/ur/adapters/level_zero/common.hpp index c11de1ca1f335..e8995593aac02 100644 --- a/sycl/plugins/unified_runtime/ur/adapters/level_zero/common.hpp +++ b/sycl/plugins/unified_runtime/ur/adapters/level_zero/common.hpp @@ -451,7 +451,7 @@ class ZeUSMImportExtension { extern ZeUSMImportExtension ZeUSMImport; // This will count the calls to Level-Zero -extern std::map *ZeCallCount; +extern std::map *ZeCallCount; // Some opencl extensions we know are supported by all Level Zero devices. constexpr char ZE_SUPPORTED_EXTENSIONS[] = diff --git a/sycl/plugins/unified_runtime/ur/adapters/level_zero/platform.cpp b/sycl/plugins/unified_runtime/ur/adapters/level_zero/platform.cpp index faf3e54fa83a4..e453f1b704370 100644 --- a/sycl/plugins/unified_runtime/ur/adapters/level_zero/platform.cpp +++ b/sycl/plugins/unified_runtime/ur/adapters/level_zero/platform.cpp @@ -32,6 +32,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urTearDown( delete PiPlatformsCacheMutex; bool LeakFound = false; + // Print the balance of various create/destroy native calls. // The idea is to verify if the number of create(+) and destroy(-) calls are // matched. @@ -43,7 +44,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urTearDown( // one are allocating objects of that type, while the last element is known // to deallocate objects of that type. // - std::vector> CreateDestroySet = { + std::vector> CreateDestroySet = { {"zeContextCreate", "zeContextDestroy"}, {"zeCommandQueueCreate", "zeCommandQueueDestroy"}, {"zeModuleCreate", "zeModuleDestroy"}, @@ -83,7 +84,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urTearDown( for (const auto &Row : CreateDestroySet) { int diff = 0; for (auto I = Row.begin(); I != Row.end();) { - const char *ZeName = *I; + const char *ZeName = (*I).c_str(); const auto &ZeCount = (*ZeCallCount)[*I]; bool First = (I == Row.begin()); @@ -137,7 +138,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urPlatformGet( try { std::call_once(ZeCallCountInitialized, []() { if (UrL0Debug & UR_L0_DEBUG_CALL_COUNT) { - ZeCallCount = new std::map; + ZeCallCount = new std::map; } }); } catch (const std::bad_alloc &) {