ONE - On-device Neural Engine
Loading...
Searching...
No Matches
onert::util::TracingCtx Class Reference

Class to maintain information about profiling per session. More...

#include <TracingCtx.h>

Public Member Functions

 TracingCtx (void)
 Create and store unique session id managed by this class.
 
uint32_t getSessionId () const
 
bool hasMultipleSessions () const
 Return true if more than 1 session exist.
 
void setSubgraphIndex (const ir::Graph *g, uint32_t index)
 Set subgraph index of a graph.
 
ir::SubgraphIndex getSubgraphIndex (const ir::Graph *g) const
 Get subgraph index of a graph.
 

Detailed Description

Class to maintain information about profiling per session.

Definition at line 35 of file TracingCtx.h.

Constructor & Destructor Documentation

◆ TracingCtx()

onert::util::TracingCtx::TracingCtx ( void  )
inline

Create and store unique session id managed by this class.

Note
This constructor can be called by multiple session running in parallely.

Definition at line 42 of file TracingCtx.h.

42{ decideSessionID(); }

Member Function Documentation

◆ getSessionId()

uint32_t onert::util::TracingCtx::getSessionId ( ) const
inline

Definition at line 44 of file TracingCtx.h.

44{ return _session_id; }

◆ getSubgraphIndex()

ir::SubgraphIndex onert::util::TracingCtx::getSubgraphIndex ( const ir::Graph g) const
inline

Get subgraph index of a graph.

Definition at line 61 of file TracingCtx.h.

61{ return _subgraph_indices.at(g); }

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

◆ hasMultipleSessions()

bool onert::util::TracingCtx::hasMultipleSessions ( ) const
inline

Return true if more than 1 session exist.

Note
This method is NOT thread-safe. Call this in thread-safe situation.

Definition at line 51 of file TracingCtx.h.

51{ return _next_session_id > 1; }

◆ setSubgraphIndex()

void onert::util::TracingCtx::setSubgraphIndex ( const ir::Graph g,
uint32_t  index 
)
inline

Set subgraph index of a graph.

Definition at line 56 of file TracingCtx.h.

56{ _subgraph_indices.emplace(g, index); }

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