Skip to content
Merged
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
13 changes: 11 additions & 2 deletions sycl/plugins/level_zero/pi_level_zero.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1529,8 +1529,17 @@ pi_result piPlatformsGet(pi_uint32 NumEntries, pi_platform *Platforms,
PrintPiTrace = true;
}

if (ZeDebug & ZE_DEBUG_CALL_COUNT) {
ZeCallCount = new std::map<const char *, int>;
static std::once_flag ZeCallCountInitialized;
try {
std::call_once(ZeCallCountInitialized, []() {
if (ZeDebug & ZE_DEBUG_CALL_COUNT) {
ZeCallCount = new std::map<const char *, int>;
}
});
} catch (const std::bad_alloc &) {
return PI_OUT_OF_HOST_MEMORY;
} catch (...) {
return PI_ERROR_UNKNOWN;
}

if (NumEntries == 0 && Platforms != nullptr) {
Expand Down