11 namespace experimental
17 std::lock_guard<std::mutex> hold(m_Mutex);
20 m_StartTime = timeTaken.first;
21 m_EndTime = timeTaken.second;
22 m_NotificationQueue.push(m_InferenceId);
24 m_Condition.notify_all();
44 auto cb = std::make_unique<AsyncExecutionCallback>(m_NotificationQueue, m_Mutex, m_Condition);
46 m_Callbacks.insert({id, std::move(cb)});
48 return m_Callbacks.at(
id);
53 std::unique_lock<std::mutex> lock(m_Mutex);
55 m_Condition.wait(lock, [
this] {
return !m_NotificationQueue.empty(); });
58 m_NotificationQueue.pop();
60 std::shared_ptr<AsyncExecutionCallback> callback = m_Callbacks.at(
id);
61 m_Callbacks.erase(
id);
std::shared_ptr< AsyncExecutionCallback > GetNewCallback()
std::chrono::high_resolution_clock::time_point HighResolutionClock
Define a timer and associated inference ID for recording execution times.
void Notify(armnn::Status status, InferenceTimingPair timeTaken)
HighResolutionClock GetStartTime() const
Copyright (c) 2021 ARM Limited and Contributors.
HighResolutionClock GetEndTime() const
armnn::Status GetStatus() const
std::pair< HighResolutionClock, HighResolutionClock > InferenceTimingPair
std::shared_ptr< AsyncExecutionCallback > GetNotifiedCallback()