diff options
author | Jim Flynn <jim.flynn@arm.com> | 2020-03-19 17:03:14 +0000 |
---|---|---|
committer | Jim Flynn <jim.flynn@arm.com> | 2020-03-19 17:03:14 +0000 |
commit | 0e2bab81442ee6cc2b94e4f7881ed0c5c6af65e7 (patch) | |
tree | b0af08b5a0b74149fca422151127ac6310385399 /src/profiling/SendCounterPacket.hpp | |
parent | 8c3259fa007d43fcc5ea56fe6928526dbe79f3c0 (diff) | |
download | armnn-0e2bab81442ee6cc2b94e4f7881ed0c5c6af65e7.tar.gz |
Creating gh-pages documentation for ArmNN
Signed-off-by: Jim Flynn <jim.flynn@arm.com>
Diffstat (limited to 'src/profiling/SendCounterPacket.hpp')
-rw-r--r-- | src/profiling/SendCounterPacket.hpp | 92 |
1 files changed, 0 insertions, 92 deletions
diff --git a/src/profiling/SendCounterPacket.hpp b/src/profiling/SendCounterPacket.hpp deleted file mode 100644 index 1880a2a47d..0000000000 --- a/src/profiling/SendCounterPacket.hpp +++ /dev/null @@ -1,92 +0,0 @@ -// -// Copyright © 2017 Arm Ltd. All rights reserved. -// SPDX-License-Identifier: MIT -// - -#pragma once - -#include "IBufferManager.hpp" -#include "ICounterDirectory.hpp" -#include "ISendCounterPacket.hpp" -#include "ProfilingUtils.hpp" - -#include <type_traits> - -namespace armnn -{ - -namespace profiling -{ - -class SendCounterPacket : public ISendCounterPacket -{ -public: - using CategoryRecord = std::vector<uint32_t>; - using DeviceRecord = std::vector<uint32_t>; - using CounterSetRecord = std::vector<uint32_t>; - using EventRecord = std::vector<uint32_t>; - using IndexValuePairsVector = std::vector<CounterValue>; - - SendCounterPacket(IBufferManager& buffer) - : m_BufferManager(buffer) - {} - - void SendStreamMetaDataPacket() override; - - void SendCounterDirectoryPacket(const ICounterDirectory& counterDirectory) override; - - void SendPeriodicCounterCapturePacket(uint64_t timestamp, const IndexValuePairsVector& values) override; - - void SendPeriodicCounterSelectionPacket(uint32_t capturePeriod, - const std::vector<uint16_t>& selectedCounterIds) override; - - static const unsigned int PIPE_MAGIC = 0x45495434; - -private: - template <typename ExceptionType> - void CancelOperationAndThrow(const std::string& errorMessage) - { - // Throw a runtime exception with the given error message - throw ExceptionType(errorMessage); - } - - template <typename ExceptionType> - void CancelOperationAndThrow(IPacketBufferPtr& writerBuffer, const std::string& errorMessage) - { - if (std::is_same<ExceptionType, armnn::profiling::BufferExhaustion>::value) - { - m_BufferManager.FlushReadList(); - } - - if (writerBuffer != nullptr) - { - // Cancel the operation - m_BufferManager.Release(writerBuffer); - } - - // Throw a runtime exception with the given error message - throw ExceptionType(errorMessage); - } - - IBufferManager& m_BufferManager; - -protected: - // Helper methods, protected for testing - bool CreateCategoryRecord(const CategoryPtr& category, - const Counters& counters, - CategoryRecord& categoryRecord, - std::string& errorMessage); - bool CreateDeviceRecord(const DevicePtr& device, - DeviceRecord& deviceRecord, - std::string& errorMessage); - bool CreateCounterSetRecord(const CounterSetPtr& counterSet, - CounterSetRecord& counterSetRecord, - std::string& errorMessage); - bool CreateEventRecord(const CounterPtr& counter, - EventRecord& eventRecord, - std::string& errorMessage); -}; - -} // namespace profiling - -} // namespace armnn |