Skip to content

Commit

Permalink
Enable PrintTrace when SYCL UR tracing is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
callumfare committed Jul 23, 2024
1 parent d2b086a commit ffb3f24
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions source/ur/ur.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@

// Controls tracing UR calls from within the UR itself.
bool PrintTrace = [] {
const char *UrRet = std::getenv("SYCL_UR_TRACE");
const char *PiRet = std::getenv("SYCL_PI_TRACE");
const char *Trace = PiRet ? PiRet : nullptr;
const char *Trace = UrRet ? UrRet : (PiRet ? PiRet : nullptr);
const int TraceValue = Trace ? std::stoi(Trace) : 0;
if (TraceValue == -1 || TraceValue == 2) { // Means print all traces
if ((PiRet && (TraceValue == -1 || TraceValue == 2)) ||
(UrRet && TraceValue == 1)) {
return true;
}
return false;
Expand Down

0 comments on commit ffb3f24

Please sign in to comment.