From 48b44a5b6f2f29dac2c85374c177b7c92f193dff Mon Sep 17 00:00:00 2001 From: Eric Huang Date: Thu, 23 Jan 2020 14:25:14 -0500 Subject: [PATCH] kfdtest: fix infinite loop in sdma multicopy when variable interval become zero, the loop of while (timeConsumption >= interval) will be a infinite loop. The fix is to avoid that case. Change-Id: I8fd07296925300bace5ab7d3da86482b6d8b0d03 Signed-off-by: Eric Huang [ROCm/ROCR-Runtime commit: 634b30119afd18f2614606bda3264315676e6820] --- projects/rocr-runtime/tests/kfdtest/src/KFDTestUtilQueue.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/projects/rocr-runtime/tests/kfdtest/src/KFDTestUtilQueue.cpp b/projects/rocr-runtime/tests/kfdtest/src/KFDTestUtilQueue.cpp index 92283f71fb..8f9b857a70 100644 --- a/projects/rocr-runtime/tests/kfdtest/src/KFDTestUtilQueue.cpp +++ b/projects/rocr-runtime/tests/kfdtest/src/KFDTestUtilQueue.cpp @@ -422,6 +422,9 @@ void sdma_multicopy_report(std::vector &array, HSAuint64 countPe begin = array[base].timeBegin; end = array[base + countPerGroup - 1].timeEnd; + if (begin == 0 && end == 0) + continue; + if (timeConsumptionMax < end - begin) timeConsumptionMax = end - begin;