diff options
author | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-10-02 12:50:57 +0100 |
---|---|---|
committer | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-10-07 10:34:54 +0100 |
commit | a84edee4702c112a6e004b1987acc11144e2d6dd (patch) | |
tree | 738ce957b2fa26423df188b0d370664d15c86665 /src/profiling/CounterDirectory.hpp | |
parent | d66d68b13fb309e8d4eac9435a58b89dd6a55158 (diff) | |
download | armnn-a84edee4702c112a6e004b1987acc11144e2d6dd.tar.gz |
IVGCVSW-3937 Initial ServiceProfiling refactoring
* Made the ServiceProfiling class a singleton
* Registered basic category and counters
* Code refactoring
* Updated unit tests accordingly
Signed-off-by: Matteo Martincigh <matteo.martincigh@arm.com>
Change-Id: I648a6202eead2a3016aac14d905511bd945a90cb
Diffstat (limited to 'src/profiling/CounterDirectory.hpp')
-rw-r--r-- | src/profiling/CounterDirectory.hpp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/profiling/CounterDirectory.hpp b/src/profiling/CounterDirectory.hpp index a756a9a7bd..bff5cfef98 100644 --- a/src/profiling/CounterDirectory.hpp +++ b/src/profiling/CounterDirectory.hpp @@ -66,6 +66,18 @@ public: const CounterSet* GetCounterSet(uint16_t uid) const override; const Counter* GetCounter(uint16_t uid) const override; + // Queries for profiling objects + bool IsCategoryRegistered(const std::string& categoryName) const; + bool IsDeviceRegistered(uint16_t deviceUid) const; + bool IsDeviceRegistered(const std::string& deviceName) const; + bool IsCounterSetRegistered(uint16_t counterSetUid) const; + bool IsCounterSetRegistered(const std::string& counterSetName) const; + bool IsCounterRegistered(uint16_t counterUid) const; + bool IsCounterRegistered(const std::string& counterName) const; + + // Clears all the counter directory contents + void Clear(); + private: // The profiling collections owned by the counter directory Categories m_Categories; @@ -80,14 +92,10 @@ private: CounterSetsIt FindCounterSet(uint16_t counterSetUid) const; CounterSetsIt FindCounterSet(const std::string& counterSetName) const; CountersIt FindCounter(uint16_t counterUid) const; - bool CheckIfCategoryIsRegistered(const std::string& categoryName) const; - bool CheckIfDeviceIsRegistered(uint16_t deviceUid) const; - bool CheckIfDeviceIsRegistered(const std::string& deviceName) const; - bool CheckIfCounterSetIsRegistered(uint16_t counterSetUid) const; - bool CheckIfCounterSetIsRegistered(const std::string& counterSetName) const; - uint16_t GetNumberOfCores(const Optional<uint16_t>& numberOfCores, - uint16_t deviceUid, - const CategoryPtr& parentCategory); + CountersIt FindCounter(const std::string& counterName) const; + uint16_t GetNumberOfCores(const Optional<uint16_t>& numberOfCores, + uint16_t deviceUid, + const CategoryPtr& parentCategory); }; } // namespace profiling |