From 3439e27f6d4bcc9ed952bbaaa2bbdf5ac9343e63 Mon Sep 17 00:00:00 2001
From: foreman
Date: Mon, 8 Jul 2019 18:14:01 -0400
Subject: [PATCH] P4 to Git Change 1960615 by gandryey@gera-win10 on 2019/07/08
18:05:10
SWDEV-79445 - HIP generic changes and code clean-up
- Correct elapsed time calculation. Use event start and end.
Affected files ...
... //depot/stg/opencl/drivers/opencl/api/hip/hip_event.cpp#13 edit
---
hipamd/api/hip/hip_event.cpp | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/hipamd/api/hip/hip_event.cpp b/hipamd/api/hip/hip_event.cpp
index 4d2eea3985..746d93a8b2 100644
--- a/hipamd/api/hip/hip_event.cpp
+++ b/hipamd/api/hip/hip_event.cpp
@@ -88,8 +88,12 @@ hipError_t Event::elapsedTime(Event& eStop, float& ms) {
return hipErrorNotReady;
}
- ms = static_cast(static_cast(eStop.event_->profilingInfo().submitted_ -
- event_->profilingInfo().submitted_))/1000000.f;
+ if (event_ != eStop.event_) {
+ ms = static_cast(static_cast(eStop.event_->profilingInfo().end_ -
+ event_->profilingInfo().start_))/1000000.f;
+ } else {
+ ms = 0.f;
+ }
return hipSuccess;
}