Skip to content

Commit 3e762e0

Browse files
Merge pull request #1884 from callumfare/callum/fix_printtrace
Enable PrintTrace when SYCL UR tracing is enabled
2 parents c805a71 + a2a053d commit 3e762e0

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)