diff --git a/rocclr/runtime/device/rocm/rocprintf.cpp b/rocclr/runtime/device/rocm/rocprintf.cpp index 8efbe57ba8..69566b699c 100644 --- a/rocclr/runtime/device/rocm/rocprintf.cpp +++ b/rocclr/runtime/device/rocm/rocprintf.cpp @@ -440,7 +440,6 @@ bool PrintfDbg::output(VirtualGPU& gpu, bool printfEnabled, std::vector::const_iterator ita; uint sb = 0; uint sbt = 0; - size_t idx = 1; // parse the debug buffer while (sbt < offsetSize) { @@ -452,6 +451,7 @@ bool PrintfDbg::output(VirtualGPU& gpu, bool printfEnabled, sb += *ita; } + size_t idx = 1; // There's something in the debug buffer outputDbgBuffer(info, dbgBufferPtr, idx);