Fix elapsed time calc for hipEventElapsedTime
If the start and stop events have same command internally then measure command end to command start Change-Id: Ie70cfa37c06c06573f0ed58dab2bbe4434c1724b
Este commit está contenido en:
@@ -90,9 +90,15 @@ hipError_t Event::elapsedTime(Event& eStop, float& ms) {
|
||||
return hipErrorNotReady;
|
||||
}
|
||||
|
||||
ms = static_cast<float>(static_cast<int64_t>(eStop.event_->profilingInfo().end_ -
|
||||
// For certain HIP Api's that take start and stop event
|
||||
// the command is the same
|
||||
if (event_ == eStop.event_) {
|
||||
ms = static_cast<float>(static_cast<int64_t>(eStop.event_->profilingInfo().end_ -
|
||||
event_->profilingInfo().start_))/1000000.f;
|
||||
} else {
|
||||
ms = static_cast<float>(static_cast<int64_t>(eStop.event_->profilingInfo().end_ -
|
||||
event_->profilingInfo().end_))/1000000.f;
|
||||
|
||||
}
|
||||
return hipSuccess;
|
||||
}
|
||||
|
||||
|
||||
Referencia en una nueva incidencia
Block a user