From 7bfd38a721360183f3392f9ab35db18a0dd7fef8 Mon Sep 17 00:00:00 2001 From: Nikhil Raj Date: Fri, 19 Aug 2022 15:23:36 +0100 Subject: Update Doxygen for 22.08 Release Signed-off-by: Nikhil Raj Change-Id: I4789fe868e0492839be1482e5cee3642ed90d756 --- 22.08/_async_execution_callback_8cpp_source.xhtml | 125 ++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 22.08/_async_execution_callback_8cpp_source.xhtml (limited to '22.08/_async_execution_callback_8cpp_source.xhtml') diff --git a/22.08/_async_execution_callback_8cpp_source.xhtml b/22.08/_async_execution_callback_8cpp_source.xhtml new file mode 100644 index 0000000000..dee81df3c8 --- /dev/null +++ b/22.08/_async_execution_callback_8cpp_source.xhtml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + +ArmNN: src/armnn/AsyncExecutionCallback.cpp Source File + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  22.08 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
AsyncExecutionCallback.cpp
+
+
+Go to the documentation of this file.
1 //
2 // Copyright © 2021 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
7 
8 namespace armnn
9 {
10 
11 namespace experimental
12 {
13 
15 {
16  {
17 #if !defined(ARMNN_DISABLE_THREADS)
18  std::lock_guard<std::mutex> hold(m_Mutex);
19 #endif
20  // store results and mark as notified
21  m_Status = status;
22  m_StartTime = timeTaken.first;
23  m_EndTime = timeTaken.second;
24  m_NotificationQueue.push(m_InferenceId);
25  }
26 #if !defined(ARMNN_DISABLE_THREADS)
27  m_Condition.notify_all();
28 #endif
29 }
30 
32 {
33  return m_Status;
34 }
35 
37 {
38  return m_StartTime;
39 }
40 
42 {
43  return m_EndTime;
44 }
45 
46 std::shared_ptr<AsyncExecutionCallback> AsyncCallbackManager::GetNewCallback()
47 {
48  auto cb = std::make_unique<AsyncExecutionCallback>(m_NotificationQueue
49 #if !defined(ARMNN_DISABLE_THREADS)
50  , m_Mutex
51  , m_Condition
52 #endif
53  );
54  InferenceId id = cb->GetInferenceId();
55  m_Callbacks.insert({id, std::move(cb)});
56 
57  return m_Callbacks.at(id);
58 }
59 
60 std::shared_ptr<AsyncExecutionCallback> AsyncCallbackManager::GetNotifiedCallback()
61 {
62 #if !defined(ARMNN_DISABLE_THREADS)
63  std::unique_lock<std::mutex> lock(m_Mutex);
64 
65  m_Condition.wait(lock, [this] { return !m_NotificationQueue.empty(); });
66 #endif
67  InferenceId id = m_NotificationQueue.front();
68  m_NotificationQueue.pop();
69 
70  std::shared_ptr<AsyncExecutionCallback> callback = m_Callbacks.at(id);
71  m_Callbacks.erase(id);
72  return callback;
73 }
74 
75 } // namespace experimental
76 
77 } // namespace armnn
std::shared_ptr< AsyncExecutionCallback > GetNewCallback()
+
std::chrono::high_resolution_clock::time_point HighResolutionClock
Define a timer and associated inference ID for recording execution times.
Definition: Types.hpp:382
+
void Notify(armnn::Status status, InferenceTimingPair timeTaken)
+ +
Copyright (c) 2021 ARM Limited and Contributors.
+
Status
enumeration
Definition: Types.hpp:42
+ + + + +
std::pair< HighResolutionClock, HighResolutionClock > InferenceTimingPair
Definition: Types.hpp:383
+
std::shared_ptr< AsyncExecutionCallback > GetNotifiedCallback()
+
+
+ + + + -- cgit v1.2.1