diff --git a/rocclr/runtime/device/gpu/gpuprintf.cpp b/rocclr/runtime/device/gpu/gpuprintf.cpp index 38fa697648..57893512be 100644 --- a/rocclr/runtime/device/gpu/gpuprintf.cpp +++ b/rocclr/runtime/device/gpu/gpuprintf.cpp @@ -680,7 +680,6 @@ PrintfDbgHSA::output( std::vector::const_iterator ita; uint sb = 0; uint sbt = 0; - size_t idx = 1; // parse the debug buffer while (sbt < offsetSize) { @@ -693,6 +692,7 @@ PrintfDbgHSA::output( sb += *ita; } + size_t idx = 1; // There's something in the debug buffer outputDbgBuffer(info, dbgBufferPtr, idx);