ONE - On-device Neural Engine
Loading...
Searching...
No Matches
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 35 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 24 of file ExecutionObservee.cc.

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

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 50 of file ExecutionObservee.h.

50{ 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 73 of file ExecutionObservee.cc.

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

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 83 of file ExecutionObservee.cc.

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

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 57 of file ExecutionObservee.cc.

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

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 65 of file ExecutionObservee.cc.

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

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: