Skip to content

Commit

Permalink
Fix duration on CPU
Browse files Browse the repository at this point in the history
  • Loading branch information
szellmann committed Dec 10, 2024
1 parent f29bd0c commit 3ccaaa4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions frame/Frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,6 @@ bool Frame::getProperty(
#elif defined(WITH_HIP)
HIP_SAFE_CALL(hipEventElapsedTime(&m_duration, m_eventStart, m_eventStop));
m_duration /= 1000.f;
#else
m_duration = std::chrono::duration<float>(m_eventStop - m_eventStart).count();
#endif
helium::writeToVoidP(ptr, m_duration);
return true;
Expand Down Expand Up @@ -347,12 +345,14 @@ void Frame::renderFrame()
}

#ifdef WITH_CUDA
CUDA_SAFE_CALL(cudaEventRecord(m_eventStop));
CUDA_SAFE_CALL(cudaEventRecord(m_eventStop));
#elif defined(WITH_HIP)
HIP_SAFE_CALL(hipEventRecord(m_eventStop));
HIP_SAFE_CALL(hipEventRecord(m_eventStop));
#else
state->renderingSemaphore.frameEnd();
m_eventStop = std::chrono::steady_clock::now();
// CPU: calculate directly in async function
m_duration = std::chrono::duration<float>(m_eventStop - m_eventStart).count();
});
#endif
}
Expand Down

0 comments on commit 3ccaaa4

Please sign in to comment.