12 #include <condition_variable> 16 #include <unordered_map> 21 namespace experimental
32 #
if !defined(ARMNN_DISABLE_THREADS)
34 , std::condition_variable& condition
37 : m_NotificationQueue(notificationQueue)
38 #if !defined(ARMNN_DISABLE_THREADS)
40 , m_Condition(condition)
42 , m_InferenceId(++nextID)
60 std::queue<InferenceId>& m_NotificationQueue;
61 #if !defined(ARMNN_DISABLE_THREADS) 63 std::condition_variable& m_Condition;
79 std::shared_ptr<AsyncExecutionCallback> GetNewCallback();
80 std::shared_ptr<AsyncExecutionCallback> GetNotifiedCallback();
83 #if !defined(ARMNN_DISABLE_THREADS) 85 std::condition_variable m_Condition;
87 std::unordered_map<InferenceId, std::shared_ptr<AsyncExecutionCallback>> m_Callbacks;
88 std::queue<InferenceId> m_NotificationQueue;
~AsyncExecutionCallback()
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.
AsyncExecutionCallback(std::queue< InferenceId > ¬ificationQueue, std::mutex &mutex, std::condition_variable &condition)
InferenceId GetInferenceId()
HighResolutionClock GetEndTime() const
armnn::Status GetStatus() const
std::pair< HighResolutionClock, HighResolutionClock > InferenceTimingPair