ArmNN
 21.11
AsyncExecutionCallback Class Referencefinal

#include <AsyncExecutionCallback.hpp>

Inheritance diagram for AsyncExecutionCallback:
IAsyncExecutionCallback

Public Member Functions

 AsyncExecutionCallback (std::queue< InferenceId > &notificationQueue, std::mutex &mutex, std::condition_variable &condition)
 
 ~AsyncExecutionCallback ()
 
void Notify (armnn::Status status, InferenceTimingPair timeTaken)
 
InferenceId GetInferenceId ()
 
armnn::Status GetStatus () const
 
HighResolutionClock GetStartTime () const
 
HighResolutionClock GetEndTime () const
 
- Public Member Functions inherited from IAsyncExecutionCallback
virtual ~IAsyncExecutionCallback ()
 

Detailed Description

Definition at line 25 of file AsyncExecutionCallback.hpp.

Constructor & Destructor Documentation

◆ AsyncExecutionCallback()

AsyncExecutionCallback ( std::queue< InferenceId > &  notificationQueue,
std::mutex &  mutex,
std::condition_variable &  condition 
)
inline

Definition at line 31 of file AsyncExecutionCallback.hpp.

34  : m_NotificationQueue(notificationQueue)
35  , m_Mutex(mutex)
36  , m_Condition(condition)
37  , m_InferenceId(++nextID)
38  {}

◆ ~AsyncExecutionCallback()

Definition at line 40 of file AsyncExecutionCallback.hpp.

References AsyncExecutionCallback::Notify().

41  {}

Member Function Documentation

◆ GetEndTime()

HighResolutionClock GetEndTime ( ) const

Definition at line 37 of file AsyncExecutionCallback.cpp.

Referenced by AsyncExecutionCallback::GetInferenceId().

38 {
39  return m_EndTime;
40 }

◆ GetInferenceId()

InferenceId GetInferenceId ( )
inline

◆ GetStartTime()

HighResolutionClock GetStartTime ( ) const

Definition at line 32 of file AsyncExecutionCallback.cpp.

Referenced by AsyncExecutionCallback::GetInferenceId().

33 {
34  return m_StartTime;
35 }

◆ GetStatus()

armnn::Status GetStatus ( ) const

Definition at line 27 of file AsyncExecutionCallback.cpp.

Referenced by AsyncExecutionCallback::GetInferenceId().

28 {
29  return m_Status;
30 }

◆ Notify()

void Notify ( armnn::Status  status,
InferenceTimingPair  timeTaken 
)
virtual

Implements IAsyncExecutionCallback.

Definition at line 14 of file AsyncExecutionCallback.cpp.

Referenced by AsyncExecutionCallback::~AsyncExecutionCallback().

15 {
16  {
17  std::lock_guard<std::mutex> hold(m_Mutex);
18  // store results and mark as notified
19  m_Status = status;
20  m_StartTime = timeTaken.first;
21  m_EndTime = timeTaken.second;
22  m_NotificationQueue.push(m_InferenceId);
23  }
24  m_Condition.notify_all();
25 }

The documentation for this class was generated from the following files: