ONE - On-device Neural Engine
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
onert::exec::ExecutionObservee Class Reference

Class that. More...

#include <ExecutionObservee.h>

Public Member Functions

 ExecutionObservee (const ExecObservers &observers, const ExecutionOptions &options)
 Register enabled observers.
 
void notifySubgraphBegin (ir::SubgraphIndex ind) const
 
void notifySubgraphEnd (ir::SubgraphIndex ind) const
 
void notifyJobBegin (IExecutor *executor, ir::SubgraphIndex subg_ind, ir::OperationIndex op_ind, const backend::Backend *backend) const
 
void notifyJobEnd (IExecutor *executor, ir::SubgraphIndex subg_ind, ir::OperationIndex op_ind, const backend::Backend *backend) const
 
bool isEmpty () const
 

Detailed Description

Class that.

Definition at line 33 of file ExecutionObservee.h.

Constructor & Destructor Documentation

◆ ExecutionObservee()

onert::exec::ExecutionObservee::ExecutionObservee ( const ExecObservers observers,
const ExecutionOptions options 
)

Register enabled observers.

Parameters
observerObservers generated by compiler

Definition at line 22 of file ExecutionObservee.cc.

24{
25 // TODO Use execution option
26 if (options.dump_minmax)
27 {
28 auto observer = observers.get(ObserverType::MINMAX_DUMP);
29 if (!observer)
30 throw std::runtime_error{"MinMaxRecorder is only supported on LinearExecutor, single model"};
31
32 _observers.emplace_back(observer);
33 }
34
35 if (options.trace)
36 {
37 auto observer = observers.get(ObserverType::TRACING);
38 if (!observer)
39 throw std::runtime_error{"Cannot find TracingObserver"};
40
41 _observers.emplace_back(observer);
42 }
43
44 if (options.profile)
45 {
46 auto observer = observers.get(ObserverType::PROFILE);
47 if (!observer)
48 throw std::runtime_error{
49 "Profiling is only supported on DataflowExecutor with heterogenous scheduler"};
50
51 _observers.emplace_back(observer);
52 }
53}

References onert::exec::ExecObservers::get(), onert::exec::MINMAX_DUMP, onert::exec::PROFILE, and onert::exec::TRACING.

Member Function Documentation

◆ isEmpty()

bool onert::exec::ExecutionObservee::isEmpty ( ) const
inline

Definition at line 48 of file ExecutionObservee.h.

48{ return _observers.size() == 0; }

Referenced by onert::exec::LinearExecutor::executeImpl().

◆ notifyJobBegin()

void onert::exec::ExecutionObservee::notifyJobBegin ( IExecutor executor,
ir::SubgraphIndex  subg_ind,
ir::OperationIndex  op_ind,
const backend::Backend backend 
) const

Definition at line 71 of file ExecutionObservee.cc.

74{
75 for (auto &&o : _observers)
76 {
77 o->handleJobBegin(executor, subg_ind, op_ind, backend);
78 }
79}

Referenced by onert::exec::DataflowExecutor::executeImpl(), onert::exec::LinearExecutor::executeImpl(), and onert::exec::ParallelExecutor::executeImpl().

◆ notifyJobEnd()

void onert::exec::ExecutionObservee::notifyJobEnd ( IExecutor executor,
ir::SubgraphIndex  subg_ind,
ir::OperationIndex  op_ind,
const backend::Backend backend 
) const

Definition at line 81 of file ExecutionObservee.cc.

84{
85 for (auto &&o : _observers)
86 {
87 o->handleJobEnd(executor, subg_ind, op_ind, backend);
88 }
89}

Referenced by onert::exec::DataflowExecutor::executeImpl(), onert::exec::LinearExecutor::executeImpl(), and onert::exec::ParallelExecutor::executeImpl().

◆ notifySubgraphBegin()

void onert::exec::ExecutionObservee::notifySubgraphBegin ( ir::SubgraphIndex  ind) const

Definition at line 55 of file ExecutionObservee.cc.

56{
57 for (auto &&o : _observers)
58 {
59 o->handleSubgraphBegin(ind);
60 }
61}

Referenced by onert::exec::DataflowExecutor::executeImpl(), onert::exec::LinearExecutor::executeImpl(), and onert::exec::ParallelExecutor::executeImpl().

◆ notifySubgraphEnd()

void onert::exec::ExecutionObservee::notifySubgraphEnd ( ir::SubgraphIndex  ind) const

Definition at line 63 of file ExecutionObservee.cc.

64{
65 for (auto &&o : _observers)
66 {
67 o->handleSubgraphEnd(ind);
68 }
69}

Referenced by onert::exec::DataflowExecutor::executeImpl(), onert::exec::LinearExecutor::executeImpl(), and onert::exec::ParallelExecutor::executeImpl().


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