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 24, 2024
1 parent 907f154 commit 5e38883
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 5e38883

Please sign in to comment.