From c84b3479f8737c9aa081627f903f38f9b7e1b5b2 Mon Sep 17 00:00:00 2001
From: foreman
Date: Mon, 19 Oct 2015 17:41:21 -0400
Subject: [PATCH] P4 to Git Change 1201249 by jatang@jatang-opencl-hsa-stg2 on
2015/10/19 16:47:00
SWDEV-78799 - Fix a division by 0 error.
Occasionally the profiling duration of some light weight kernel is 0, and would cause division by 0 error to the WLAlgorithmSmooth algorithm. We can just skip collecting this duration for the adaption algorithm.
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuwavelimiter.cpp#11 edit
[ROCm/clr commit: b06ee3a1a9fa10f4bbf9b846d5affd1c68cdc7b4]
---
projects/clr/rocclr/runtime/device/gpu/gpuwavelimiter.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/projects/clr/rocclr/runtime/device/gpu/gpuwavelimiter.cpp b/projects/clr/rocclr/runtime/device/gpu/gpuwavelimiter.cpp
index 7fcc0140bb..7ae0fa9a57 100644
--- a/projects/clr/rocclr/runtime/device/gpu/gpuwavelimiter.cpp
+++ b/projects/clr/rocclr/runtime/device/gpu/gpuwavelimiter.cpp
@@ -135,7 +135,7 @@ void WLAlgorithmSmooth::outputTrace() {
void WLAlgorithmSmooth::callback(ulong duration) {
dumper_.addData(duration, currWaves_, static_cast(state_));
- if (!enable_) {
+ if (!enable_ || (duration == 0)) {
return;
}