Skip to content

Commit

Permalink
Merge pull request #1884 from callumfare/callum/fix_printtrace
Browse files Browse the repository at this point in the history
Enable PrintTrace when SYCL UR tracing is enabled
  • Loading branch information
omarahmed1111 authored Jul 31, 2024
2 parents c805a71 + a2a053d commit 3e762e0
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 != 0)) {
return true;
}
return false;
Expand Down

0 comments on commit 3e762e0

Please sign in to comment.