From ffb3f24856d394cae74eed88e82c8707d14935fe Mon Sep 17 00:00:00 2001 From: Callum Fare Date: Tue, 23 Jul 2024 16:30:13 +0100 Subject: [PATCH] Enable PrintTrace when SYCL UR tracing is enabled --- source/ur/ur.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/ur/ur.cpp b/source/ur/ur.cpp index cff431069a..f9394f6f37 100644 --- a/source/ur/ur.cpp +++ b/source/ur/ur.cpp @@ -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;