diff --git a/projects/hip/vdi/hip_event.cpp b/projects/hip/vdi/hip_event.cpp index e3d556a52d..5c9d570ea1 100644 --- a/projects/hip/vdi/hip_event.cpp +++ b/projects/hip/vdi/hip_event.cpp @@ -86,12 +86,8 @@ hipError_t Event::elapsedTime(Event& eStop, float& ms) { return hipErrorNotReady; } - if (event_ != eStop.event_) { - ms = static_cast(static_cast(eStop.event_->profilingInfo().end_ - - event_->profilingInfo().start_))/1000000.f; - } else { - ms = 0.f; - } + ms = static_cast(static_cast(eStop.event_->profilingInfo().end_ - + event_->profilingInfo().start_))/1000000.f; return hipSuccess; } diff --git a/projects/hip/vdi/hip_module.cpp b/projects/hip/vdi/hip_module.cpp index bd5ccce47c..4a52b7d7df 100644 --- a/projects/hip/vdi/hip_module.cpp +++ b/projects/hip/vdi/hip_module.cpp @@ -324,12 +324,6 @@ hipError_t ihipModuleLaunchKernel(hipFunction_t f, } } - if(startEvent != nullptr) { - amd::Command* startCommand = new hip::TimerMarker(*queue); - startCommand->enqueue(); - eStart->addMarker(queue, startCommand); - } - amd::NDRangeKernelCommand* command = new amd::NDRangeKernelCommand( *queue, waitList, *kernel, ndrange, sharedMemBytes, params, gridId, numGrids, prevGridSum, allGridSum, firstDevice); @@ -345,11 +339,14 @@ hipError_t ihipModuleLaunchKernel(hipFunction_t f, command->enqueue(); + if(startEvent != nullptr) { + eStart->addMarker(queue, command); + command->retain(); + } if(stopEvent != nullptr) { eStop->addMarker(queue, command); command->retain(); } - command->release(); return hipSuccess;