Skip to content

[SYCL][PI][L0] Changes std:string to const char * for ZeCallCount #4018

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 29, 2021
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
8 changes: 4 additions & 4 deletions sycl/plugins/level_zero/pi_level_zero.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ static pi_result mapError(ze_result_t ZeResult) {
}

// This will count the calls to Level-Zero
static std::map<std::string, int> *ZeCallCount = nullptr;
static std::map<const char *, int> *ZeCallCount = nullptr;

// Trace a call to Level-Zero RT
#define ZE_CALL(ZeName, ZeArgs) \
Expand Down Expand Up @@ -1226,7 +1226,7 @@ pi_result piPlatformsGet(pi_uint32 NumEntries, pi_platform *Platforms,
ZeDebug = DebugModeValue;

if (ZeDebug & ZE_DEBUG_CALL_COUNT) {
ZeCallCount = new std::map<std::string, int>;
ZeCallCount = new std::map<const char *, int>;
}

if (NumEntries == 0 && Platforms != nullptr) {
Expand Down Expand Up @@ -6461,7 +6461,7 @@ pi_result piTearDown(void *PluginParameter) {
// one are allocating objects of that type, while the last element is known
// to deallocate objects of that type.
//
std::vector<std::vector<std::string>> CreateDestroySet = {
std::vector<std::vector<const char *>> CreateDestroySet = {
{"zeContextCreate", "zeContextDestroy"},
{"zeCommandQueueCreate", "zeCommandQueueDestroy"},
{"zeModuleCreate", "zeModuleDestroy"},
Expand Down Expand Up @@ -6501,7 +6501,7 @@ pi_result piTearDown(void *PluginParameter) {
for (const auto &Row : CreateDestroySet) {
int diff = 0;
for (auto I = Row.begin(); I != Row.end();) {
const auto &ZeName = I->c_str();
const char *ZeName = *I;
const auto &ZeCount = (*ZeCallCount)[*I];

bool First = (I == Row.begin());
Expand Down