ArmNN
 21.02
RegisterBackendCounters Class Reference

#include <RegisterBackendCounters.hpp>

Inheritance diagram for RegisterBackendCounters:
IRegisterBackendCounters

Public Member Functions

 RegisterBackendCounters (uint16_t currentMaxGlobalCounterID, const BackendId &backendId, ProfilingService &profilingService)
 
 ~RegisterBackendCounters ()=default
 
void RegisterCategory (const std::string &categoryName) override
 
uint16_t RegisterDevice (const std::string &deviceName, uint16_t cores=0, const Optional< std::string > &parentCategoryName=EmptyOptional()) override
 
uint16_t RegisterCounterSet (const std::string &counterSetName, uint16_t count=0, const Optional< std::string > &parentCategoryName=EmptyOptional()) override
 
uint16_t RegisterCounter (const uint16_t uid, const std::string &parentCategoryName, uint16_t counterClass, uint16_t interpolation, double multiplier, const std::string &name, const std::string &description, const Optional< std::string > &units=EmptyOptional(), const Optional< uint16_t > &numberOfCores=EmptyOptional(), const Optional< uint16_t > &deviceUid=EmptyOptional(), const Optional< uint16_t > &counterSetUid=EmptyOptional()) override
 
- Public Member Functions inherited from IRegisterBackendCounters
virtual ~IRegisterBackendCounters ()
 

Detailed Description

Definition at line 19 of file RegisterBackendCounters.hpp.

Constructor & Destructor Documentation

◆ RegisterBackendCounters()

RegisterBackendCounters ( uint16_t  currentMaxGlobalCounterID,
const BackendId backendId,
ProfilingService profilingService 
)
inline

Definition at line 23 of file RegisterBackendCounters.hpp.

References RegisterBackendCounters::RegisterCategory(), RegisterBackendCounters::RegisterCounter(), RegisterBackendCounters::RegisterCounterSet(), RegisterBackendCounters::RegisterDevice(), and RegisterBackendCounters::~RegisterBackendCounters().

25  : m_CurrentMaxGlobalCounterID(currentMaxGlobalCounterID),
26  m_BackendId(backendId),
27  m_ProfilingService(profilingService),
28  m_CounterDirectory(m_ProfilingService.GetCounterRegistry()) {}

◆ ~RegisterBackendCounters()

Member Function Documentation

◆ RegisterCategory()

void RegisterCategory ( const std::string &  categoryName)
overridevirtual

Implements IRegisterBackendCounters.

Definition at line 14 of file RegisterBackendCounters.cpp.

References ICounterRegistry::RegisterCategory().

Referenced by BOOST_AUTO_TEST_CASE(), and RegisterBackendCounters::RegisterBackendCounters().

15 {
16  m_CounterDirectory.RegisterCategory(categoryName);
17 }
virtual const Category * RegisterCategory(const std::string &categoryName)=0

◆ RegisterCounter()

uint16_t RegisterCounter ( const uint16_t  uid,
const std::string &  parentCategoryName,
uint16_t  counterClass,
uint16_t  interpolation,
double  multiplier,
const std::string &  name,
const std::string &  description,
const Optional< std::string > &  units = EmptyOptional(),
const Optional< uint16_t > &  numberOfCores = EmptyOptional(),
const Optional< uint16_t > &  deviceUid = EmptyOptional(),
const Optional< uint16_t > &  counterSetUid = EmptyOptional() 
)
overridevirtual

Implements IRegisterBackendCounters.

Definition at line 35 of file RegisterBackendCounters.cpp.

References ProfilingService::GetCounterMappingRegistry(), Counter::m_MaxCounterUid, Counter::m_Uid, ICounterRegistry::RegisterCounter(), and IRegisterCounterMapping::RegisterMapping().

Referenced by BOOST_AUTO_TEST_CASE(), and RegisterBackendCounters::RegisterBackendCounters().

46 {
47  ++m_CurrentMaxGlobalCounterID;
48  const Counter* counterPtr = m_CounterDirectory.RegisterCounter(m_BackendId,
49  m_CurrentMaxGlobalCounterID,
50  parentCategoryName,
51  counterClass,
52  interpolation,
53  multiplier,
54  name,
55  description,
56  units,
57  numberOfCores,
58  deviceUid,
59  counterSetUid);
60  m_CurrentMaxGlobalCounterID = counterPtr->m_MaxCounterUid;
61  // register mappings
62  IRegisterCounterMapping& counterIdMap = m_ProfilingService.GetCounterMappingRegistry();
63  uint16_t globalCounterId = counterPtr->m_Uid;
64  if (globalCounterId == counterPtr->m_MaxCounterUid)
65  {
66  counterIdMap.RegisterMapping(globalCounterId, uid, m_BackendId);
67  }
68  else
69  {
70  uint16_t backendCounterId = uid;
71  while (globalCounterId <= counterPtr->m_MaxCounterUid)
72  {
73  // register mapping
74  // globalCounterId -> backendCounterId, m_BackendId
75  counterIdMap.RegisterMapping(globalCounterId, backendCounterId, m_BackendId);
76  ++globalCounterId;
77  ++backendCounterId;
78  }
79  }
80  return m_CurrentMaxGlobalCounterID;
81 }
virtual void RegisterMapping(uint16_t globalCounterId, uint16_t backendCounterId, const armnn::BackendId &backendId)=0
virtual const Counter * RegisterCounter(const BackendId &backendId, const uint16_t uid, const std::string &parentCategoryName, uint16_t counterClass, uint16_t interpolation, double multiplier, const std::string &name, const std::string &description, const Optional< std::string > &units, const Optional< uint16_t > &numberOfCores, const Optional< uint16_t > &deviceUid, const Optional< uint16_t > &counterSetUid)=0
IRegisterCounterMapping & GetCounterMappingRegistry()

◆ RegisterCounterSet()

uint16_t RegisterCounterSet ( const std::string &  counterSetName,
uint16_t  count = 0,
const Optional< std::string > &  parentCategoryName = EmptyOptional() 
)
overridevirtual

Implements IRegisterBackendCounters.

Definition at line 27 of file RegisterBackendCounters.cpp.

References CounterSet::m_Uid, and ICounterRegistry::RegisterCounterSet().

Referenced by BOOST_AUTO_TEST_CASE(), and RegisterBackendCounters::RegisterBackendCounters().

30 {
31  const CounterSet* counterSetPtr = m_CounterDirectory.RegisterCounterSet(counterSetName, count, parentCategoryName);
32  return counterSetPtr->m_Uid;
33 }
virtual const CounterSet * RegisterCounterSet(const std::string &counterSetName, uint16_t count, const Optional< std::string > &parentCategoryName)=0

◆ RegisterDevice()

uint16_t RegisterDevice ( const std::string &  deviceName,
uint16_t  cores = 0,
const Optional< std::string > &  parentCategoryName = EmptyOptional() 
)
overridevirtual

Implements IRegisterBackendCounters.

Definition at line 19 of file RegisterBackendCounters.cpp.

References Device::m_Uid, and ICounterRegistry::RegisterDevice().

Referenced by BOOST_AUTO_TEST_CASE(), and RegisterBackendCounters::RegisterBackendCounters().

22 {
23  const Device* devicePtr = m_CounterDirectory.RegisterDevice(deviceName, cores, parentCategoryName);
24  return devicePtr->m_Uid;
25 }
virtual const Device * RegisterDevice(const std::string &deviceName, uint16_t cores, const Optional< std::string > &parentCategoryName)=0

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