Skip to content

Commit a2a053d

Browse files
callumfareomarahmed1111
authored andcommitted
Enable PrintTrace when SYCL UR tracing is enabled
1 parent 1b4a8b8 commit a2a053d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

source/ur/ur.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@
1414

1515
// Controls tracing UR calls from within the UR itself.
1616
bool PrintTrace = [] {
17+
const char *UrRet = std::getenv("SYCL_UR_TRACE");
1718
const char *PiRet = std::getenv("SYCL_PI_TRACE");
18-
const char *Trace = PiRet ? PiRet : nullptr;
19+
const char *Trace = UrRet ? UrRet : (PiRet ? PiRet : nullptr);
1920
const int TraceValue = Trace ? std::stoi(Trace) : 0;
20-
if (TraceValue == -1 || TraceValue == 2) { // Means print all traces
21+
if ((PiRet && (TraceValue == -1 || TraceValue == 2)) ||
22+
(UrRet && TraceValue != 0)) {
2123
return true;
2224
}
2325
return false;

0 commit comments

Comments
 (0)