From 5aa9fd7ac6bf8dad576fa4a0a32aa3dae98d11ab Mon Sep 17 00:00:00 2001 From: Cathal Corbett Date: Fri, 25 Feb 2022 15:33:28 +0000 Subject: IVGCVSW-6704 Change the namespace from armnn::profiling to arm::pipe * Updated ABI version to 29 due to being the first ABI break in 22.05 !android-nn-driver:7226 Signed-off-by: Cathal Corbett Change-Id: I9c50007dcd5b5e792757e7bd1213606df5ffec36 --- .../ActivateTimelineReportingCommandHandler.cpp | 12 +- .../ActivateTimelineReportingCommandHandler.hpp | 12 +- src/profiling/BufferManager.cpp | 8 +- src/profiling/BufferManager.hpp | 8 +- src/profiling/CommandHandler.cpp | 10 +- src/profiling/CommandHandler.hpp | 8 +- .../ConnectionAcknowledgedCommandHandler.cpp | 14 +- .../ConnectionAcknowledgedCommandHandler.hpp | 15 +- src/profiling/CounterDirectory.cpp | 24 +- src/profiling/CounterDirectory.hpp | 26 +- src/profiling/CounterIdMap.cpp | 8 +- src/profiling/CounterIdMap.hpp | 8 +- .../DeactivateTimelineReportingCommandHandler.cpp | 12 +- .../DeactivateTimelineReportingCommandHandler.hpp | 9 +- src/profiling/DirectoryCaptureCommandHandler.cpp | 74 ++-- src/profiling/DirectoryCaptureCommandHandler.hpp | 10 +- src/profiling/FileOnlyProfilingConnection.cpp | 10 +- src/profiling/FileOnlyProfilingConnection.hpp | 8 +- src/profiling/Holder.cpp | 8 +- src/profiling/Holder.hpp | 8 +- src/profiling/IBufferManager.hpp | 8 +- src/profiling/IConsumer.hpp | 8 +- src/profiling/ICounterDirectory.hpp | 12 +- src/profiling/ICounterRegistry.hpp | 22 +- src/profiling/ICounterValues.hpp | 8 +- src/profiling/INotifyBackends.hpp | 8 +- src/profiling/IPacketBuffer.hpp | 8 +- src/profiling/IPeriodicCounterCapture.hpp | 8 +- src/profiling/IProfilingConnection.hpp | 8 +- src/profiling/IProfilingConnectionFactory.hpp | 8 +- src/profiling/IProfilingService.hpp | 8 +- src/profiling/IProfilingServiceStatus.hpp | 8 +- src/profiling/IReportStructure.hpp | 8 +- src/profiling/ISendCounterPacket.hpp | 8 +- src/profiling/ISendThread.hpp | 8 +- src/profiling/NullProfilingConnection.hpp | 8 +- src/profiling/PacketBuffer.cpp | 8 +- src/profiling/PacketBuffer.hpp | 8 +- .../PerJobCounterSelectionCommandHandler.cpp | 8 +- .../PerJobCounterSelectionCommandHandler.hpp | 10 +- src/profiling/PeriodicCounterCapture.cpp | 10 +- src/profiling/PeriodicCounterCapture.hpp | 13 +- .../PeriodicCounterSelectionCommandHandler.cpp | 12 +- .../PeriodicCounterSelectionCommandHandler.hpp | 18 +- .../ProfilingConnectionDumpToFileDecorator.cpp | 10 +- .../ProfilingConnectionDumpToFileDecorator.hpp | 8 +- src/profiling/ProfilingConnectionFactory.cpp | 8 +- src/profiling/ProfilingConnectionFactory.hpp | 8 +- src/profiling/ProfilingService.cpp | 40 +-- src/profiling/ProfilingService.hpp | 26 +- src/profiling/ProfilingStateMachine.cpp | 8 +- src/profiling/ProfilingStateMachine.hpp | 10 +- src/profiling/ProfilingUtils.cpp | 69 +--- src/profiling/ProfilingUtils.hpp | 8 +- src/profiling/RegisterBackendCounters.cpp | 20 +- src/profiling/RegisterBackendCounters.hpp | 25 +- .../RequestCounterDirectoryCommandHandler.cpp | 12 +- .../RequestCounterDirectoryCommandHandler.hpp | 8 +- src/profiling/SendCounterPacket.cpp | 16 +- src/profiling/SendCounterPacket.hpp | 10 +- src/profiling/SendThread.cpp | 16 +- src/profiling/SendThread.hpp | 8 +- src/profiling/SendTimelinePacket.cpp | 14 +- src/profiling/SendTimelinePacket.hpp | 17 +- src/profiling/SocketProfilingConnection.cpp | 8 +- src/profiling/SocketProfilingConnection.hpp | 8 +- src/profiling/TimelinePacketWriterFactory.cpp | 8 +- src/profiling/TimelinePacketWriterFactory.hpp | 8 +- src/profiling/TimelineUtilityMethods.cpp | 32 +- src/profiling/TimelineUtilityMethods.hpp | 8 +- src/profiling/backends/BackendProfiling.cpp | 9 +- src/profiling/backends/BackendProfiling.hpp | 14 +- src/profiling/test/BufferTests.cpp | 10 +- .../test/FileOnlyProfilingDecoratorTests.cpp | 4 +- src/profiling/test/PrintPacketHeaderHandler.cpp | 8 +- src/profiling/test/PrintPacketHeaderHandler.hpp | 8 +- ...ProfilingConnectionDumpToFileDecoratorTests.cpp | 12 +- src/profiling/test/ProfilingGuidTest.cpp | 6 +- src/profiling/test/ProfilingMocks.hpp | 30 +- src/profiling/test/ProfilingTestUtils.cpp | 6 +- src/profiling/test/ProfilingTestUtils.hpp | 12 +- src/profiling/test/ProfilingTests.cpp | 379 ++++++++++----------- src/profiling/test/ProfilingTests.hpp | 22 +- .../test/RequestCountersPacketHandler.cpp | 8 +- .../test/RequestCountersPacketHandler.hpp | 8 +- src/profiling/test/SendCounterPacketTests.cpp | 90 ++--- src/profiling/test/SendCounterPacketTests.hpp | 8 +- src/profiling/test/SendTimelinePacketTests.cpp | 8 +- src/profiling/test/TestTimelinePacketHandler.cpp | 10 +- src/profiling/test/TestTimelinePacketHandler.hpp | 8 +- src/profiling/test/TimelineModel.cpp | 22 +- src/profiling/test/TimelineModel.hpp | 8 +- src/profiling/test/TimelinePacketTests.cpp | 12 +- src/profiling/test/TimelineUtilityMethodsTests.cpp | 22 +- 94 files changed, 807 insertions(+), 855 deletions(-) (limited to 'src/profiling') diff --git a/src/profiling/ActivateTimelineReportingCommandHandler.cpp b/src/profiling/ActivateTimelineReportingCommandHandler.cpp index 77df76f2fe..7f949d361a 100644 --- a/src/profiling/ActivateTimelineReportingCommandHandler.cpp +++ b/src/profiling/ActivateTimelineReportingCommandHandler.cpp @@ -9,10 +9,10 @@ #include #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { void ActivateTimelineReportingCommandHandler::operator()(const arm::pipe::Packet& packet) @@ -30,7 +30,7 @@ void ActivateTimelineReportingCommandHandler::operator()(const arm::pipe::Packet case ProfilingState::Uninitialised: case ProfilingState::NotConnected: case ProfilingState::WaitingForAck: - throw RuntimeException(fmt::format( + throw armnn::RuntimeException(fmt::format( "Activate Timeline Reporting Command Handler invoked while in a wrong state: {}", GetProfilingStateName(currentState))); case ProfilingState::Active: @@ -56,11 +56,11 @@ void ActivateTimelineReportingCommandHandler::operator()(const arm::pipe::Packet break; default: - throw RuntimeException(fmt::format("Unknown profiling service state: {}", + throw armnn::RuntimeException(fmt::format("Unknown profiling service state: {}", static_cast(currentState))); } } -} // namespace profiling +} // namespace pipe -} // namespace armnn \ No newline at end of file +} // namespace arm \ No newline at end of file diff --git a/src/profiling/ActivateTimelineReportingCommandHandler.hpp b/src/profiling/ActivateTimelineReportingCommandHandler.hpp index a40115084b..2564b88bee 100644 --- a/src/profiling/ActivateTimelineReportingCommandHandler.hpp +++ b/src/profiling/ActivateTimelineReportingCommandHandler.hpp @@ -16,10 +16,10 @@ #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class ActivateTimelineReportingCommandHandler : public arm::pipe::CommandHandlerFunctor @@ -30,7 +30,7 @@ public: uint32_t version, SendTimelinePacket& sendTimelinePacket, ProfilingStateMachine& profilingStateMachine, - Optional reportStructure, + armnn::Optional reportStructure, std::atomic& timelineReporting, INotifyBackends& notifyBackends) : CommandHandlerFunctor(familyId, packetId, version), @@ -49,9 +49,9 @@ private: std::atomic& m_TimelineReporting; INotifyBackends& m_BackendNotifier; - Optional m_ReportStructure; + armnn::Optional m_ReportStructure; }; -} // namespace profiling +} // namespace pipe -} // namespace armnn \ No newline at end of file +} // namespace arm \ No newline at end of file diff --git a/src/profiling/BufferManager.cpp b/src/profiling/BufferManager.cpp index be60f2788d..42e32009e4 100644 --- a/src/profiling/BufferManager.cpp +++ b/src/profiling/BufferManager.cpp @@ -6,10 +6,10 @@ #include "BufferManager.hpp" #include "PacketBuffer.hpp" -namespace armnn +namespace arm { -namespace profiling +namespace pipe { BufferManager::BufferManager(unsigned int numberOfBuffers, unsigned int maxPacketSize) @@ -161,6 +161,6 @@ void BufferManager::FlushReadList() } } -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/BufferManager.hpp b/src/profiling/BufferManager.hpp index 4bc7725721..0ab3e0e534 100644 --- a/src/profiling/BufferManager.hpp +++ b/src/profiling/BufferManager.hpp @@ -13,10 +13,10 @@ #include #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class BufferManager : public IBufferManager @@ -71,6 +71,6 @@ private: IConsumer* m_Consumer = nullptr; }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/CommandHandler.cpp b/src/profiling/CommandHandler.cpp index 9f536445e9..f709b2826c 100644 --- a/src/profiling/CommandHandler.cpp +++ b/src/profiling/CommandHandler.cpp @@ -8,10 +8,10 @@ #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { void CommandHandler::Start(IProfilingConnection& profilingConnection) @@ -85,7 +85,7 @@ void CommandHandler::HandleCommands(IProfilingConnection& profilingConnection) m_KeepRunning.store(false); } } - catch (const Exception& e) + catch (const armnn::Exception& e) { // Log the error and continue ARMNN_LOG(warning) << "An error has occurred when handling a command: " << e.what(); @@ -104,6 +104,6 @@ void CommandHandler::HandleCommands(IProfilingConnection& profilingConnection) m_IsRunning.store(false); } -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/CommandHandler.hpp b/src/profiling/CommandHandler.hpp index b2c9725a34..b097f9ef20 100644 --- a/src/profiling/CommandHandler.hpp +++ b/src/profiling/CommandHandler.hpp @@ -13,10 +13,10 @@ #include #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class CommandHandler @@ -56,6 +56,6 @@ private: arm::pipe::PacketVersionResolver& m_PacketVersionResolver; }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/ConnectionAcknowledgedCommandHandler.cpp b/src/profiling/ConnectionAcknowledgedCommandHandler.cpp index c61c091bc4..63ca741374 100644 --- a/src/profiling/ConnectionAcknowledgedCommandHandler.cpp +++ b/src/profiling/ConnectionAcknowledgedCommandHandler.cpp @@ -10,10 +10,10 @@ #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { void ConnectionAcknowledgedCommandHandler::operator()(const arm::pipe::Packet& packet) @@ -23,7 +23,7 @@ void ConnectionAcknowledgedCommandHandler::operator()(const arm::pipe::Packet& p { case ProfilingState::Uninitialised: case ProfilingState::NotConnected: - throw RuntimeException(fmt::format("Connection Acknowledged Command Handler invoked while in an " + throw armnn::RuntimeException(fmt::format("Connection Acknowledged Command Handler invoked while in an " "wrong state: {}", GetProfilingStateName(currentState))); case ProfilingState::WaitingForAck: @@ -54,7 +54,7 @@ void ConnectionAcknowledgedCommandHandler::operator()(const arm::pipe::Packet& p // Enable profiling on the backend and assert that it returns true if(!backendContext.second->EnableProfiling(true)) { - throw BackendProfilingException( + throw armnn::BackendProfilingException( "Unable to enable profiling on Backend Id: " + backendContext.first.Get()); } } @@ -67,12 +67,12 @@ void ConnectionAcknowledgedCommandHandler::operator()(const arm::pipe::Packet& p case ProfilingState::Active: return; // NOP default: - throw RuntimeException(fmt::format("Unknown profiling service state: {}", + throw armnn::RuntimeException(fmt::format("Unknown profiling service state: {}", static_cast(currentState))); } } -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/ConnectionAcknowledgedCommandHandler.hpp b/src/profiling/ConnectionAcknowledgedCommandHandler.hpp index bad61b485f..5bb3c95cf5 100644 --- a/src/profiling/ConnectionAcknowledgedCommandHandler.hpp +++ b/src/profiling/ConnectionAcknowledgedCommandHandler.hpp @@ -14,16 +14,16 @@ #include #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class ConnectionAcknowledgedCommandHandler final : public arm::pipe::CommandHandlerFunctor { -typedef const std::unordered_map>& +typedef const std::unordered_map>& BackendProfilingContexts; public: @@ -35,7 +35,8 @@ public: ISendTimelinePacket& sendTimelinePacket, ProfilingStateMachine& profilingStateMachine, IProfilingServiceStatus& profilingServiceStatus, - Optional backendProfilingContexts = EmptyOptional()) + armnn::Optional backendProfilingContexts = + armnn::EmptyOptional()) : CommandHandlerFunctor(familyId, packetId, version) , m_CounterDirectory(counterDirectory) , m_SendCounterPacket(sendCounterPacket) @@ -59,11 +60,11 @@ private: ISendTimelinePacket& m_SendTimelinePacket; ProfilingStateMachine& m_StateMachine; IProfilingServiceStatus& m_ProfilingServiceStatus; - Optional m_BackendProfilingContext; + armnn::Optional m_BackendProfilingContext; std::atomic m_TimelineEnabled; }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/CounterDirectory.cpp b/src/profiling/CounterDirectory.cpp index 9ef379a04e..5a7d8c6165 100644 --- a/src/profiling/CounterDirectory.cpp +++ b/src/profiling/CounterDirectory.cpp @@ -14,10 +14,10 @@ #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { const Category* CounterDirectory::RegisterCategory(const std::string& categoryName) @@ -52,7 +52,7 @@ const Category* CounterDirectory::RegisterCategory(const std::string& categoryNa const Device* CounterDirectory::RegisterDevice(const std::string& deviceName, uint16_t cores, - const Optional& parentCategoryName) + const armnn::Optional& parentCategoryName) { // Check that the given device name is valid if (deviceName.empty() || @@ -113,7 +113,7 @@ const Device* CounterDirectory::RegisterDevice(const std::string& deviceName, const CounterSet* CounterDirectory::RegisterCounterSet(const std::string& counterSetName, uint16_t count, - const Optional& parentCategoryName) + const armnn::Optional& parentCategoryName) { // Check that the given counter set name is valid if (counterSetName.empty() || @@ -178,7 +178,7 @@ const CounterSet* CounterDirectory::RegisterCounterSet(const std::string& counte return counterSetPtr; } -const Counter* CounterDirectory::RegisterCounter(const BackendId& backendId, +const Counter* CounterDirectory::RegisterCounter(const armnn::BackendId& backendId, const uint16_t uid, const std::string& parentCategoryName, uint16_t counterClass, @@ -186,10 +186,10 @@ const Counter* CounterDirectory::RegisterCounter(const BackendId& backendId, double multiplier, const std::string& name, const std::string& description, - const Optional& units, - const Optional& numberOfCores, - const Optional& deviceUid, - const Optional& counterSetUid) + const armnn::Optional& units, + const armnn::Optional& numberOfCores, + const armnn::Optional& deviceUid, + const armnn::Optional& counterSetUid) { IgnoreUnused(backendId); @@ -502,7 +502,7 @@ CountersIt CounterDirectory::FindCounter(const std::string& counterName) const }); } -uint16_t CounterDirectory::GetNumberOfCores(const Optional& numberOfCores, +uint16_t CounterDirectory::GetNumberOfCores(const armnn::Optional& numberOfCores, uint16_t deviceUid) { // To get the number of cores, apply the following rules: @@ -544,6 +544,6 @@ uint16_t CounterDirectory::GetNumberOfCores(const Optional& numberOfCo return 0; } -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/CounterDirectory.hpp b/src/profiling/CounterDirectory.hpp index a6e788ee1f..ee9b52e8cd 100644 --- a/src/profiling/CounterDirectory.hpp +++ b/src/profiling/CounterDirectory.hpp @@ -14,10 +14,10 @@ #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class CounterDirectory final : public ICounterDirectory, public ICounterRegistry @@ -30,11 +30,13 @@ public: const Category* RegisterCategory (const std::string& categoryName) override; const Device* RegisterDevice (const std::string& deviceName, uint16_t cores = 0, - const Optional& parentCategoryName = EmptyOptional()) override; + const armnn::Optional& parentCategoryName + = armnn::EmptyOptional()) override; const CounterSet* RegisterCounterSet(const std::string& counterSetName, uint16_t count = 0, - const Optional& parentCategoryName = EmptyOptional()) override; - const Counter* RegisterCounter(const BackendId& backendId, + const armnn::Optional& parentCategoryName + = armnn::EmptyOptional()) override; + const Counter* RegisterCounter(const armnn::BackendId& backendId, const uint16_t uid, const std::string& parentCategoryName, uint16_t counterClass, @@ -42,10 +44,10 @@ public: double multiplier, const std::string& name, const std::string& description, - const Optional& units = EmptyOptional(), - const Optional& numberOfCores = EmptyOptional(), - const Optional& deviceUid = EmptyOptional(), - const Optional& counterSetUid = EmptyOptional()) override; + const armnn::Optional& units = armnn::EmptyOptional(), + const armnn::Optional& numberOfCores = armnn::EmptyOptional(), + const armnn::Optional& deviceUid = armnn::EmptyOptional(), + const armnn::Optional& counterSetUid = armnn::EmptyOptional()) override; // Getters for counts uint16_t GetCategoryCount() const override { return armnn::numeric_cast(m_Categories.size()); } @@ -92,10 +94,10 @@ private: CounterSetsIt FindCounterSet(const std::string& counterSetName) const; CountersIt FindCounter(uint16_t counterUid) const; CountersIt FindCounter(const std::string& counterName) const; - uint16_t GetNumberOfCores(const Optional& numberOfCores, + uint16_t GetNumberOfCores(const armnn::Optional& numberOfCores, uint16_t deviceUid); }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/CounterIdMap.cpp b/src/profiling/CounterIdMap.cpp index 862600538b..bb575705ed 100644 --- a/src/profiling/CounterIdMap.cpp +++ b/src/profiling/CounterIdMap.cpp @@ -7,9 +7,9 @@ #include #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { void CounterIdMap::RegisterMapping(uint16_t globalCounterId, @@ -52,5 +52,5 @@ const std::pair& CounterIdMap::GetBackendId(uint16_t return it->second; } -} // namespace profiling -} // namespace armnn +} // namespace pipe +} // namespace arm diff --git a/src/profiling/CounterIdMap.hpp b/src/profiling/CounterIdMap.hpp index 5c1a6ea609..7a3c3614ee 100644 --- a/src/profiling/CounterIdMap.hpp +++ b/src/profiling/CounterIdMap.hpp @@ -7,9 +7,9 @@ #include "armnn/BackendId.hpp" #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class ICounterMappings @@ -47,5 +47,5 @@ private: std::map, uint16_t> m_BackendCounterIdMap; }; -} // namespace profiling -} // namespace armnn +} // namespace pipe +} // namespace arm diff --git a/src/profiling/DeactivateTimelineReportingCommandHandler.cpp b/src/profiling/DeactivateTimelineReportingCommandHandler.cpp index 37d46c05dc..d9aa7fda45 100644 --- a/src/profiling/DeactivateTimelineReportingCommandHandler.cpp +++ b/src/profiling/DeactivateTimelineReportingCommandHandler.cpp @@ -9,10 +9,10 @@ #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { void DeactivateTimelineReportingCommandHandler::operator()(const arm::pipe::Packet& packet) @@ -24,7 +24,7 @@ void DeactivateTimelineReportingCommandHandler::operator()(const arm::pipe::Pack case ProfilingState::Uninitialised: case ProfilingState::NotConnected: case ProfilingState::WaitingForAck: - throw RuntimeException(fmt::format( + throw armnn::RuntimeException(fmt::format( "Deactivate Timeline Reporting Command Handler invoked while in a wrong state: {}", GetProfilingStateName(currentState))); case ProfilingState::Active: @@ -42,12 +42,12 @@ void DeactivateTimelineReportingCommandHandler::operator()(const arm::pipe::Pack break; default: - throw RuntimeException(fmt::format("Unknown profiling service state: {}", + throw armnn::RuntimeException(fmt::format("Unknown profiling service state: {}", static_cast(currentState))); } } -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/DeactivateTimelineReportingCommandHandler.hpp b/src/profiling/DeactivateTimelineReportingCommandHandler.hpp index 822e92c425..4d0473ff78 100644 --- a/src/profiling/DeactivateTimelineReportingCommandHandler.hpp +++ b/src/profiling/DeactivateTimelineReportingCommandHandler.hpp @@ -7,14 +7,15 @@ #include "ProfilingStateMachine.hpp" #include "INotifyBackends.hpp" +#include "ProfilingStateMachine.hpp" #include #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class DeactivateTimelineReportingCommandHandler : public arm::pipe::CommandHandlerFunctor @@ -41,6 +42,6 @@ private: INotifyBackends& m_BackendNotifier; }; -} // namespace profiling +} // namespace pipe -} // namespace armnn \ No newline at end of file +} // namespace arm \ No newline at end of file diff --git a/src/profiling/DirectoryCaptureCommandHandler.cpp b/src/profiling/DirectoryCaptureCommandHandler.cpp index 60463a10c3..75e1aebeb7 100644 --- a/src/profiling/DirectoryCaptureCommandHandler.cpp +++ b/src/profiling/DirectoryCaptureCommandHandler.cpp @@ -11,10 +11,10 @@ #include #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { // Utils @@ -40,37 +40,37 @@ void DirectoryCaptureCommandHandler::ParseData(const arm::pipe::Packet& packet) // 0:15 [16] reserved: all zeros offset += uint16_t_size; // 16:31 [16] device_records_count: number of entries in the device_records_pointer_table - deviceRecordCount = profiling::ReadUint16(data, offset); + deviceRecordCount = ReadUint16(data, offset); offset += uint16_t_size; // Body header word 1: // 0:31 [32] device_records_pointer_table_offset: offset to the device_records_pointer_table // The offset is always zero here, as the device record pointer table field is always the first item in the pool - const uint32_t deviceRecordsPointerTableOffset = profiling::ReadUint32(data, offset); + const uint32_t deviceRecordsPointerTableOffset = ReadUint32(data, offset); offset += uint32_t_size; // Body header word 2: // 0:15 [16] reserved: all zeros offset += uint16_t_size; // 16:31 [16] counter_set_count: number of entries in the counter_set_pointer_table - counterSetRecordCount = profiling::ReadUint16(data, offset); + counterSetRecordCount = ReadUint16(data, offset); offset += uint16_t_size; // Body header word 3: // 0:31 [32] counter_set_pointer_table_offset: offset to the counter_set_pointer_table - const uint32_t counterPointerTableSetOffset = profiling::ReadUint32(data, offset); + const uint32_t counterPointerTableSetOffset = ReadUint32(data, offset); offset += uint32_t_size; // Body header word 4: // 0:15 [16] reserved: all zeros offset += uint16_t_size; // 16:31 [16] categories_count: number of entries in the categories_pointer_table - categoryRecordCount = profiling::ReadUint16(data, offset); + categoryRecordCount = ReadUint16(data, offset); offset += uint16_t_size; // Body header word 5: // 0:31 [32] categories_pointer_table_offset: offset to the categories_pointer_table - const uint32_t categoriesPointerTableOffset = profiling::ReadUint32(data, offset); + const uint32_t categoriesPointerTableOffset = ReadUint32(data, offset); offset += uint32_t_size; std::vector deviceRecordOffsets(deviceRecordCount); @@ -80,21 +80,21 @@ void DirectoryCaptureCommandHandler::ParseData(const arm::pipe::Packet& packet) offset = deviceRecordsPointerTableOffset; for (uint32_t i = 0; i < deviceRecordCount; ++i) { - deviceRecordOffsets[i] = profiling::ReadUint32(data, offset); + deviceRecordOffsets[i] = ReadUint32(data, offset); offset += uint32_t_size; } offset = counterPointerTableSetOffset; for (uint32_t i = 0; i < counterSetRecordCount; ++i) { - counterSetOffsets[i] = profiling::ReadUint32(data, offset); + counterSetOffsets[i] = ReadUint32(data, offset); offset += uint32_t_size; } offset = categoriesPointerTableOffset; for (uint32_t i = 0; i < categoryRecordCount; ++i) { - categoryOffsets[i] = profiling::ReadUint32(data, offset); + categoryOffsets[i] = ReadUint32(data, offset); offset += uint32_t_size; } @@ -104,15 +104,15 @@ void DirectoryCaptureCommandHandler::ParseData(const arm::pipe::Packet& packet) uint32_t deviceRecordOffset = offset + deviceRecordOffsets[deviceIndex]; // Device record word 0: // 0:15 [16] cores: the number of individual streams of counters for one or more cores of some device - uint16_t deviceCores = profiling::ReadUint16(data, deviceRecordOffset); + uint16_t deviceCores = ReadUint16(data, deviceRecordOffset); // 16:31 [16] deviceUid: the unique identifier for the device deviceRecordOffset += uint16_t_size; - uint16_t deviceUid = profiling::ReadUint16(data, deviceRecordOffset); + uint16_t deviceUid = ReadUint16(data, deviceRecordOffset); deviceRecordOffset += uint16_t_size; // Device record word 1: // Offset from the beginning of the device record pool to the name field. - uint32_t nameOffset = profiling::ReadUint32(data, deviceRecordOffset); + uint32_t nameOffset = ReadUint32(data, deviceRecordOffset); deviceRecordOffset = deviceRecordsPointerTableOffset + nameOffset; @@ -128,11 +128,11 @@ void DirectoryCaptureCommandHandler::ParseData(const arm::pipe::Packet& packet) // Counter set record word 0: // 0:15 [16] count: the number of counters which can be active in this set at any one time - uint16_t counterSetCount = profiling::ReadUint16(data, counterSetOffset); + uint16_t counterSetCount = ReadUint16(data, counterSetOffset); counterSetOffset += uint16_t_size; // 16:31 [16] deviceUid: the unique identifier for the counter_set - uint16_t counterSetUid = profiling::ReadUint16(data, counterSetOffset); + uint16_t counterSetUid = ReadUint16(data, counterSetOffset); counterSetOffset += uint16_t_size; // Counter set record word 1: @@ -162,17 +162,17 @@ void DirectoryCaptureCommandHandler::ReadCategoryRecords(const unsigned char* co // 0:15 Reserved, value 0x0000. categoryRecordOffset += uint16_t_size; // 16:31 Number of events belonging to this category. - uint32_t eventCount = profiling::ReadUint16(data, categoryRecordOffset); + uint32_t eventCount = ReadUint16(data, categoryRecordOffset); categoryRecordOffset += uint16_t_size; // Category record word 2 // 0:31 Offset from the beginning of the category data pool to the event_pointer_table - uint32_t eventPointerTableOffset = profiling::ReadUint32(data, categoryRecordOffset); + uint32_t eventPointerTableOffset = ReadUint32(data, categoryRecordOffset); categoryRecordOffset += uint32_t_size; // Category record word 3 // 0:31 Offset from the beginning of the category data pool to the name field. - uint32_t nameOffset = profiling::ReadUint32(data, categoryRecordOffset); + uint32_t nameOffset = ReadUint32(data, categoryRecordOffset); categoryRecordOffset += uint32_t_size; std::vector eventRecordsOffsets(eventCount); @@ -182,7 +182,7 @@ void DirectoryCaptureCommandHandler::ReadCategoryRecords(const unsigned char* co for (uint32_t eventIndex = 0; eventIndex < eventCount; ++eventIndex) { eventRecordsOffsets[eventIndex] = - profiling::ReadUint32(data, eventPointerTableOffset + uint32_t_size * eventIndex); + ReadUint32(data, eventPointerTableOffset + uint32_t_size * eventIndex); } const std::vector& eventRecords = @@ -218,34 +218,34 @@ std::vector DirectoryCaptureCommandHandler::ReadEve // Event record word 0: // 0:15 [16] count_uid: unique ID for the counter. Must be unique across all counters in all categories - eventRecords[i].m_CounterUid = profiling::ReadUint16(data, eventRecordOffset); + eventRecords[i].m_CounterUid = ReadUint16(data, eventRecordOffset); eventRecordOffset += uint16_t_size; // 16:31 [16] max_counter_uid: if the device this event is associated with has more than one core and there // is one of these counters per core this value will be set to // (counter_uid + cores (from device_record)) - 1. // If there is only a single core then this value will be the same as // the counter_uid value - eventRecords[i].m_MaxCounterUid = profiling::ReadUint16(data, eventRecordOffset); + eventRecords[i].m_MaxCounterUid = ReadUint16(data, eventRecordOffset); eventRecordOffset += uint16_t_size; // Event record word 1: // 0:15 [16] counter_set: UID of the counter_set this event is associated with. Set to zero if the event // is NOT associated with a counter_set - eventRecords[i].m_CounterSetUid = profiling::ReadUint16(data, eventRecordOffset); + eventRecords[i].m_CounterSetUid = ReadUint16(data, eventRecordOffset); eventRecordOffset += uint16_t_size; // 16:31 [16] device: UID of the device this event is associated with. Set to zero if the event is NOT // associated with a device - eventRecords[i].m_DeviceUid = profiling::ReadUint16(data, eventRecordOffset); + eventRecords[i].m_DeviceUid = ReadUint16(data, eventRecordOffset); eventRecordOffset += uint16_t_size; // Event record word 2: // 0:15 [16] interpolation: type describing how to interpolate each data point in a stream of data points - eventRecords[i].m_CounterInterpolation = profiling::ReadUint16(data, eventRecordOffset); + eventRecords[i].m_CounterInterpolation = ReadUint16(data, eventRecordOffset); eventRecordOffset += uint16_t_size; // 16:31 [16] class: type describing how to treat each data point in a stream of data points - eventRecords[i].m_CounterClass = profiling::ReadUint16(data, eventRecordOffset); + eventRecords[i].m_CounterClass = ReadUint16(data, eventRecordOffset); eventRecordOffset += uint16_t_size; // Event record word 3-4: @@ -253,9 +253,9 @@ std::vector DirectoryCaptureCommandHandler::ReadEve // those values as if they are fixed point numbers. Zero is not a valid value uint32_t multiplier[2] = { 0u, 0u }; - multiplier[0] = profiling::ReadUint32(data, eventRecordOffset); + multiplier[0] = ReadUint32(data, eventRecordOffset); eventRecordOffset += uint32_t_size; - multiplier[1] = profiling::ReadUint32(data, eventRecordOffset); + multiplier[1] = ReadUint32(data, eventRecordOffset); eventRecordOffset += uint32_t_size; std::memcpy(&eventRecords[i].m_CounterMultiplier, &multiplier, sizeof(multiplier)); @@ -264,21 +264,21 @@ std::vector DirectoryCaptureCommandHandler::ReadEve // 0:31 [32] name_eventRecordOffset: eventRecordOffset from the // beginning of the event record pool to the name field // The eventRecordOffset is always zero here, as the name field is always the first item in the pool - uint32_t nameOffset = profiling::ReadUint32(data, eventRecordOffset); + uint32_t nameOffset = ReadUint32(data, eventRecordOffset); eventRecordOffset += uint32_t_size; // Event record word 6: // 0:31 [32] description_eventRecordOffset: eventRecordOffset from the // beginning of the event record pool to the description field // The size of the name buffer in bytes - uint32_t descriptionOffset = profiling::ReadUint32(data, eventRecordOffset); + uint32_t descriptionOffset = ReadUint32(data, eventRecordOffset); eventRecordOffset += uint32_t_size; // Event record word 7: // 0:31 [32] units_eventRecordOffset: (optional) eventRecordOffset from the // beginning of the event record pool to the units field. // An eventRecordOffset value of zero indicates this field is not provided - uint32_t unitsOffset = profiling::ReadUint32(data, eventRecordOffset); + uint32_t unitsOffset = ReadUint32(data, eventRecordOffset); eventRecords[i].m_CounterName = GetStringNameFromBuffer(data, offset + eventRecordsOffsets[i] + @@ -290,7 +290,7 @@ std::vector DirectoryCaptureCommandHandler::ReadEve descriptionOffset + uint32_t_size); - eventRecords[i].m_CounterUnits = unitsOffset == 0 ? Optional() : + eventRecords[i].m_CounterUnits = unitsOffset == 0 ? armnn::Optional() : GetStringNameFromBuffer(data, eventRecordsOffsets[i] + offset + unitsOffset + uint32_t_size); } @@ -313,7 +313,7 @@ void DirectoryCaptureCommandHandler::operator()(const arm::pipe::Packet& packet) if (!m_QuietOperation) { - armnn::profiling::PrintCounterDirectory(m_CounterDirectory); + PrintCounterDirectory(m_CounterDirectory); } } @@ -325,18 +325,18 @@ const ICounterDirectory& DirectoryCaptureCommandHandler::GetCounterDirectory() c std::string DirectoryCaptureCommandHandler::GetStringNameFromBuffer(const unsigned char* const data, uint32_t offset) { std::string deviceName; - uint8_t nextChar = profiling::ReadUint8(data, offset); + uint8_t nextChar = ReadUint8(data, offset); while (isprint(nextChar)) { deviceName += static_cast(nextChar); offset++; - nextChar = profiling::ReadUint8(data, offset); + nextChar = ReadUint8(data, offset); } return deviceName; } -} // namespace profiling +} // namespace pipe -} // namespace armnn \ No newline at end of file +} // namespace arm \ No newline at end of file diff --git a/src/profiling/DirectoryCaptureCommandHandler.hpp b/src/profiling/DirectoryCaptureCommandHandler.hpp index 90ae1d400d..8a5241ff84 100644 --- a/src/profiling/DirectoryCaptureCommandHandler.hpp +++ b/src/profiling/DirectoryCaptureCommandHandler.hpp @@ -11,10 +11,10 @@ #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { struct CounterDirectoryEventRecord @@ -26,7 +26,7 @@ struct CounterDirectoryEventRecord std::string m_CounterName; uint16_t m_CounterSetUid; uint16_t m_CounterUid; - Optional m_CounterUnits; + armnn::Optional m_CounterUnits; uint16_t m_DeviceUid; uint16_t m_MaxCounterUid; }; @@ -80,6 +80,6 @@ private: std::atomic m_AlreadyParsed; }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/FileOnlyProfilingConnection.cpp b/src/profiling/FileOnlyProfilingConnection.cpp index 3b3d7a8284..ee9b8b1701 100644 --- a/src/profiling/FileOnlyProfilingConnection.cpp +++ b/src/profiling/FileOnlyProfilingConnection.cpp @@ -14,10 +14,10 @@ #include #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { std::vector StreamMetaDataProcessor::GetHeadersAccepted() @@ -145,7 +145,7 @@ arm::pipe::Packet FileOnlyProfilingConnection::ReadPacket(uint32_t timeout) void FileOnlyProfilingConnection::Fail(const std::string& errorMessage) { Close(); - throw RuntimeException(errorMessage); + throw armnn::RuntimeException(errorMessage); } /// Adds a local packet handler to the FileOnlyProfilingConnection. Invoking this will start @@ -303,6 +303,6 @@ void FileOnlyProfilingConnection::DispatchPacketToHandlers(const arm::pipe::Pack } } -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/FileOnlyProfilingConnection.hpp b/src/profiling/FileOnlyProfilingConnection.hpp index 6204f913f4..9f992d080e 100644 --- a/src/profiling/FileOnlyProfilingConnection.hpp +++ b/src/profiling/FileOnlyProfilingConnection.hpp @@ -20,10 +20,10 @@ #include #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { // forward declaration @@ -128,6 +128,6 @@ private: int m_Timeout; }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/Holder.cpp b/src/profiling/Holder.cpp index a366898377..06600807f0 100644 --- a/src/profiling/Holder.cpp +++ b/src/profiling/Holder.cpp @@ -6,10 +6,10 @@ #include #include "Holder.hpp" -namespace armnn +namespace arm { -namespace profiling +namespace pipe { CaptureData& CaptureData::operator=(const CaptureData& other) @@ -83,6 +83,6 @@ void Holder::SetCaptureData(uint32_t capturePeriod, } -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/Holder.hpp b/src/profiling/Holder.hpp index 8a89cdac58..612f8dc02e 100644 --- a/src/profiling/Holder.hpp +++ b/src/profiling/Holder.hpp @@ -10,10 +10,10 @@ #include #include "ProfilingUtils.hpp" -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class CaptureData @@ -63,6 +63,6 @@ private: CaptureData m_CaptureData; }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/IBufferManager.hpp b/src/profiling/IBufferManager.hpp index 01ecb8222d..6aec43f643 100644 --- a/src/profiling/IBufferManager.hpp +++ b/src/profiling/IBufferManager.hpp @@ -12,10 +12,10 @@ #define MAX_METADATA_PACKET_LENGTH 4096 -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class IBufferManager @@ -38,6 +38,6 @@ public: virtual void FlushReadList() = 0; }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/IConsumer.hpp b/src/profiling/IConsumer.hpp index f00f17458b..7a7e5efc64 100644 --- a/src/profiling/IConsumer.hpp +++ b/src/profiling/IConsumer.hpp @@ -5,10 +5,10 @@ #pragma once -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class IConsumer @@ -20,7 +20,7 @@ public: virtual void SetReadyToRead() = 0; }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/ICounterDirectory.hpp b/src/profiling/ICounterDirectory.hpp index 4492f854bf..f902f9160b 100644 --- a/src/profiling/ICounterDirectory.hpp +++ b/src/profiling/ICounterDirectory.hpp @@ -13,10 +13,10 @@ #include #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { // Forward declarations @@ -94,7 +94,7 @@ class Counter final { public: // Constructors - Counter(BackendId backendId, + Counter(armnn::BackendId backendId, uint16_t counterUid, uint16_t maxCounterUid, uint16_t counterClass, @@ -119,7 +119,7 @@ public: {} // Fields - BackendId m_BackendId; + armnn::BackendId m_BackendId; uint16_t m_Uid; uint16_t m_MaxCounterUid; uint16_t m_Class; @@ -158,6 +158,6 @@ public: virtual const Counter* GetCounter(uint16_t uid) const = 0; }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/ICounterRegistry.hpp b/src/profiling/ICounterRegistry.hpp index 83bc33587c..1d257b82db 100644 --- a/src/profiling/ICounterRegistry.hpp +++ b/src/profiling/ICounterRegistry.hpp @@ -8,10 +8,10 @@ #include #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class ICounterRegistry @@ -24,13 +24,13 @@ public: virtual const Device* RegisterDevice (const std::string& deviceName, uint16_t cores, - const Optional& parentCategoryName) = 0; + const armnn::Optional& parentCategoryName) = 0; virtual const CounterSet* RegisterCounterSet(const std::string& counterSetName, uint16_t count, - const Optional& parentCategoryName) = 0; + const armnn::Optional& parentCategoryName) = 0; - virtual const Counter* RegisterCounter(const BackendId& backendId, + virtual const Counter* RegisterCounter(const armnn::BackendId& backendId, const uint16_t uid, const std::string& parentCategoryName, uint16_t counterClass, @@ -38,13 +38,13 @@ public: double multiplier, const std::string& name, const std::string& description, - const Optional& units, - const Optional& numberOfCores, - const Optional& deviceUid, - const Optional& counterSetUid) = 0; + const armnn::Optional& units, + const armnn::Optional& numberOfCores, + const armnn::Optional& deviceUid, + const armnn::Optional& counterSetUid) = 0; }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/ICounterValues.hpp b/src/profiling/ICounterValues.hpp index 09c26b6722..f49ddf47bb 100644 --- a/src/profiling/ICounterValues.hpp +++ b/src/profiling/ICounterValues.hpp @@ -7,10 +7,10 @@ #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class IReadCounterValues @@ -41,6 +41,6 @@ public: virtual ~IReadWriteCounterValues() {} }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/INotifyBackends.hpp b/src/profiling/INotifyBackends.hpp index 217ebdef1c..4fa25b70b3 100644 --- a/src/profiling/INotifyBackends.hpp +++ b/src/profiling/INotifyBackends.hpp @@ -5,10 +5,10 @@ #pragma once -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class INotifyBackends @@ -18,7 +18,7 @@ public: virtual void NotifyBackendsForTimelineReporting() = 0; }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/IPacketBuffer.hpp b/src/profiling/IPacketBuffer.hpp index 15687a81e9..02c40e4ab1 100644 --- a/src/profiling/IPacketBuffer.hpp +++ b/src/profiling/IPacketBuffer.hpp @@ -7,10 +7,10 @@ #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class IReadOnlyPacketBuffer // interface used by the read thread @@ -43,6 +43,6 @@ public: using IPacketBufferPtr = std::unique_ptr; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/IPeriodicCounterCapture.hpp b/src/profiling/IPeriodicCounterCapture.hpp index bec41dce11..f96d01496e 100644 --- a/src/profiling/IPeriodicCounterCapture.hpp +++ b/src/profiling/IPeriodicCounterCapture.hpp @@ -5,9 +5,9 @@ #pragma once -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class IPeriodicCounterCapture @@ -19,5 +19,5 @@ public: virtual void Stop() = 0; }; -} // namespace profiling -} // namespace armnn +} // namespace pipe +} // namespace arm diff --git a/src/profiling/IProfilingConnection.hpp b/src/profiling/IProfilingConnection.hpp index 7ed714c1a3..988503294a 100644 --- a/src/profiling/IProfilingConnection.hpp +++ b/src/profiling/IProfilingConnection.hpp @@ -11,10 +11,10 @@ #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class IProfilingConnection @@ -31,6 +31,6 @@ public: virtual arm::pipe::Packet ReadPacket(uint32_t timeout) = 0; }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/IProfilingConnectionFactory.hpp b/src/profiling/IProfilingConnectionFactory.hpp index 9b0eda0334..1599914bac 100644 --- a/src/profiling/IProfilingConnectionFactory.hpp +++ b/src/profiling/IProfilingConnectionFactory.hpp @@ -11,10 +11,10 @@ #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class IProfilingConnectionFactory @@ -28,6 +28,6 @@ public: virtual IProfilingConnectionPtr GetProfilingConnection(const ProfilingOptions& options) const = 0; }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/IProfilingService.hpp b/src/profiling/IProfilingService.hpp index ebdfb39c63..c2e824e6f5 100644 --- a/src/profiling/IProfilingService.hpp +++ b/src/profiling/IProfilingService.hpp @@ -12,10 +12,10 @@ #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class IProfilingService : public IProfilingGuidGenerator, public IProfilingServiceStatus @@ -29,7 +29,7 @@ public: virtual CaptureData GetCaptureData() = 0; }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/IProfilingServiceStatus.hpp b/src/profiling/IProfilingServiceStatus.hpp index 1d272463ae..3366bdd445 100644 --- a/src/profiling/IProfilingServiceStatus.hpp +++ b/src/profiling/IProfilingServiceStatus.hpp @@ -11,10 +11,10 @@ #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class IProfilingServiceStatus @@ -25,6 +25,6 @@ public: virtual ~IProfilingServiceStatus() {}; }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/IReportStructure.hpp b/src/profiling/IReportStructure.hpp index 1ae049733f..82a84ff6cf 100644 --- a/src/profiling/IReportStructure.hpp +++ b/src/profiling/IReportStructure.hpp @@ -5,10 +5,10 @@ #pragma once -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class IReportStructure @@ -18,7 +18,7 @@ public: virtual void ReportStructure() = 0; }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/ISendCounterPacket.hpp b/src/profiling/ISendCounterPacket.hpp index d87a042d76..0e3ae6faf2 100644 --- a/src/profiling/ISendCounterPacket.hpp +++ b/src/profiling/ISendCounterPacket.hpp @@ -8,10 +8,10 @@ #include #include "ICounterDirectory.hpp" -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class ISendCounterPacket @@ -35,7 +35,7 @@ public: const std::vector& selectedCounterIds) = 0; }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/ISendThread.hpp b/src/profiling/ISendThread.hpp index c5e05b183c..af76a25c56 100644 --- a/src/profiling/ISendThread.hpp +++ b/src/profiling/ISendThread.hpp @@ -7,10 +7,10 @@ #include "IProfilingConnection.hpp" -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class ISendThread @@ -25,7 +25,7 @@ public: virtual void Stop(bool rethrowSendThreadExceptions = true) = 0; }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/NullProfilingConnection.hpp b/src/profiling/NullProfilingConnection.hpp index a72d7bfb82..ef09794ec5 100644 --- a/src/profiling/NullProfilingConnection.hpp +++ b/src/profiling/NullProfilingConnection.hpp @@ -9,10 +9,10 @@ #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class NullProfilingConnection : public IProfilingConnection @@ -36,6 +36,6 @@ class NullProfilingConnection : public IProfilingConnection }; -} // namespace profiling +} // namespace pipe -} // namespace armnn \ No newline at end of file +} // namespace arm \ No newline at end of file diff --git a/src/profiling/PacketBuffer.cpp b/src/profiling/PacketBuffer.cpp index 6010493002..fa3e9582f4 100644 --- a/src/profiling/PacketBuffer.cpp +++ b/src/profiling/PacketBuffer.cpp @@ -7,10 +7,10 @@ #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { PacketBuffer::PacketBuffer(unsigned int maxSize) @@ -62,6 +62,6 @@ void PacketBuffer::Destroy() m_MaxSize = 0; } -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/PacketBuffer.hpp b/src/profiling/PacketBuffer.hpp index 02fe3b99d8..3fa5c608fe 100644 --- a/src/profiling/PacketBuffer.hpp +++ b/src/profiling/PacketBuffer.hpp @@ -9,10 +9,10 @@ #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class PacketBuffer : public IPacketBuffer @@ -42,6 +42,6 @@ private: std::unique_ptr m_Data; }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/PerJobCounterSelectionCommandHandler.cpp b/src/profiling/PerJobCounterSelectionCommandHandler.cpp index 9e2f0626d3..c90b6c837c 100644 --- a/src/profiling/PerJobCounterSelectionCommandHandler.cpp +++ b/src/profiling/PerJobCounterSelectionCommandHandler.cpp @@ -8,10 +8,10 @@ #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { void PerJobCounterSelectionCommandHandler::operator()(const arm::pipe::Packet& packet) @@ -44,6 +44,6 @@ void PerJobCounterSelectionCommandHandler::operator()(const arm::pipe::Packet& p } } -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/PerJobCounterSelectionCommandHandler.hpp b/src/profiling/PerJobCounterSelectionCommandHandler.hpp index eef8421900..1d088e495f 100644 --- a/src/profiling/PerJobCounterSelectionCommandHandler.hpp +++ b/src/profiling/PerJobCounterSelectionCommandHandler.hpp @@ -10,10 +10,10 @@ #include #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class PerJobCounterSelectionCommandHandler : public arm::pipe::CommandHandlerFunctor @@ -28,13 +28,13 @@ public: , m_StateMachine(profilingStateMachine) {} - void operator()(const arm::pipe::Packet& packet) override; + void operator()(const Packet& packet) override; private: const ProfilingStateMachine& m_StateMachine; }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/PeriodicCounterCapture.cpp b/src/profiling/PeriodicCounterCapture.cpp index d914e85cfb..11ad6511fe 100644 --- a/src/profiling/PeriodicCounterCapture.cpp +++ b/src/profiling/PeriodicCounterCapture.cpp @@ -9,10 +9,10 @@ #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { void PeriodicCounterCapture::Start() @@ -105,7 +105,7 @@ void PeriodicCounterCapture::Capture(IReadCounterValues& readCounterValues) { counterValue = readCounterValues.GetDeltaCounterValue(requestedId); } - catch (const Exception& e) + catch (const armnn::Exception& e) { // Report the error and continue ARMNN_LOG(warning) << "An error has occurred when getting a counter value: " @@ -134,6 +134,6 @@ void PeriodicCounterCapture::Capture(IReadCounterValues& readCounterValues) while (m_KeepRunning.load()); } -} // namespace profiling +} // namespace pipe -} // namespace armnn \ No newline at end of file +} // namespace arm \ No newline at end of file diff --git a/src/profiling/PeriodicCounterCapture.hpp b/src/profiling/PeriodicCounterCapture.hpp index b7b1a20e1c..c442f425d4 100644 --- a/src/profiling/PeriodicCounterCapture.hpp +++ b/src/profiling/PeriodicCounterCapture.hpp @@ -19,10 +19,10 @@ #include #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class PeriodicCounterCapture final : public IPeriodicCounterCapture @@ -33,8 +33,7 @@ public: IReadCounterValues& readCounterValue, const ICounterMappings& counterIdMap, const std::unordered_map>& - backendProfilingContexts) + std::shared_ptr>& backendProfilingContexts) : m_CaptureDataHolder(data) , m_IsRunning(false) , m_KeepRunning(false) @@ -63,9 +62,9 @@ private: ISendCounterPacket& m_SendCounterPacket; const ICounterMappings& m_CounterIdMap; const std::unordered_map>& m_BackendProfilingContexts; + std::shared_ptr>& m_BackendProfilingContexts; }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/PeriodicCounterSelectionCommandHandler.cpp b/src/profiling/PeriodicCounterSelectionCommandHandler.cpp index f94cb31f62..ae2aa0b94c 100644 --- a/src/profiling/PeriodicCounterSelectionCommandHandler.cpp +++ b/src/profiling/PeriodicCounterSelectionCommandHandler.cpp @@ -13,10 +13,10 @@ #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { void PeriodicCounterSelectionCommandHandler::ParseData(const arm::pipe::Packet& packet, CaptureData& captureData) @@ -65,7 +65,7 @@ void PeriodicCounterSelectionCommandHandler::operator()(const arm::pipe::Packet& case ProfilingState::Uninitialised: case ProfilingState::NotConnected: case ProfilingState::WaitingForAck: - throw RuntimeException(fmt::format("Periodic Counter Selection Command Handler invoked while in " + throw armnn::RuntimeException(fmt::format("Periodic Counter Selection Command Handler invoked while in " "an wrong state: {}", GetProfilingStateName(currentState))); case ProfilingState::Active: @@ -161,7 +161,7 @@ void PeriodicCounterSelectionCommandHandler::operator()(const arm::pipe::Packet& break; } default: - throw RuntimeException(fmt::format("Unknown profiling service state: {}", + throw armnn::RuntimeException(fmt::format("Unknown profiling service state: {}", static_cast(currentState))); } } @@ -228,6 +228,6 @@ std::set PeriodicCounterSelectionCommandHandler::ProcessBacken return activeBackends; } -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/PeriodicCounterSelectionCommandHandler.hpp b/src/profiling/PeriodicCounterSelectionCommandHandler.hpp index ec67391b9c..e8cdf0e5aa 100644 --- a/src/profiling/PeriodicCounterSelectionCommandHandler.hpp +++ b/src/profiling/PeriodicCounterSelectionCommandHandler.hpp @@ -21,10 +21,10 @@ #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { @@ -35,8 +35,8 @@ public: PeriodicCounterSelectionCommandHandler(uint32_t familyId, uint32_t packetId, uint32_t version, - const std::unordered_map>& + const std::unordered_map>& backendProfilingContexts, const ICounterMappings& counterIdMap, Holder& captureDataHolder, @@ -65,8 +65,8 @@ public: private: std::unordered_map> m_BackendCounterMap; - const std::unordered_map>& m_BackendProfilingContexts; + const std::unordered_map>& m_BackendProfilingContexts; const ICounterMappings& m_CounterIdMap; Holder& m_CaptureDataHolder; const uint16_t m_MaxArmCounterId; @@ -81,7 +81,7 @@ private: const uint32_t capturePeriod, const std::vector counterIds) { - Optional errorMsg = + armnn::Optional errorMsg = m_BackendProfilingContexts.at(backendId)->ActivateCounters(capturePeriod, counterIds); if(errorMsg.has_value()) @@ -97,7 +97,7 @@ private: }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/ProfilingConnectionDumpToFileDecorator.cpp b/src/profiling/ProfilingConnectionDumpToFileDecorator.cpp index f00d7fa965..fff26d435b 100644 --- a/src/profiling/ProfilingConnectionDumpToFileDecorator.cpp +++ b/src/profiling/ProfilingConnectionDumpToFileDecorator.cpp @@ -10,10 +10,10 @@ #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { ProfilingConnectionDumpToFileDecorator::ProfilingConnectionDumpToFileDecorator( @@ -154,9 +154,9 @@ bool ProfilingConnectionDumpToFileDecorator::DumpOutgoingToFile(const unsigned c void ProfilingConnectionDumpToFileDecorator::Fail(const std::string& errorMessage) { Close(); - throw RuntimeException(errorMessage); + throw armnn::RuntimeException(errorMessage); } -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/ProfilingConnectionDumpToFileDecorator.hpp b/src/profiling/ProfilingConnectionDumpToFileDecorator.hpp index bf79adc603..2cbd98f9d1 100644 --- a/src/profiling/ProfilingConnectionDumpToFileDecorator.hpp +++ b/src/profiling/ProfilingConnectionDumpToFileDecorator.hpp @@ -16,10 +16,10 @@ #include #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class ProfilingConnectionDumpToFileDecorator : public IProfilingConnection @@ -58,6 +58,6 @@ private: bool m_IgnoreFileErrors; }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/ProfilingConnectionFactory.cpp b/src/profiling/ProfilingConnectionFactory.cpp index fe42de493b..93ecff2e99 100644 --- a/src/profiling/ProfilingConnectionFactory.cpp +++ b/src/profiling/ProfilingConnectionFactory.cpp @@ -9,10 +9,10 @@ #include "ProfilingConnectionDumpToFileDecorator.hpp" #include "SocketProfilingConnection.hpp" -namespace armnn +namespace arm { -namespace profiling +namespace pipe { std::unique_ptr ProfilingConnectionFactory::GetProfilingConnection( @@ -56,6 +56,6 @@ std::unique_ptr ProfilingConnectionFactory::GetProfilingCo } } -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/ProfilingConnectionFactory.hpp b/src/profiling/ProfilingConnectionFactory.hpp index f767ed07c2..441a31a0b8 100644 --- a/src/profiling/ProfilingConnectionFactory.hpp +++ b/src/profiling/ProfilingConnectionFactory.hpp @@ -7,10 +7,10 @@ #include "IProfilingConnectionFactory.hpp" -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class ProfilingConnectionFactory final : public IProfilingConnectionFactory @@ -22,6 +22,6 @@ public: IProfilingConnectionPtr GetProfilingConnection(const ProfilingOptions& options) const override; }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/ProfilingService.cpp b/src/profiling/ProfilingService.cpp index c7ebee2ccf..cef8a6d9ea 100644 --- a/src/profiling/ProfilingService.cpp +++ b/src/profiling/ProfilingService.cpp @@ -15,10 +15,10 @@ #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { ProfilingGuidGenerator ProfilingService::m_GuidGenerator; @@ -38,7 +38,7 @@ void ProfilingService::ResetGuidGenerator() m_GuidGenerator.Reset(); } -void ProfilingService::ResetExternalProfilingOptions(const armnn::profiling::ProfilingOptions& options, +void ProfilingService::ResetExternalProfilingOptions(const arm::pipe::ProfilingOptions& options, bool resetProfilingService) { // Update the profiling options @@ -60,7 +60,7 @@ bool ProfilingService::IsProfilingEnabled() const } ProfilingState ProfilingService::ConfigureProfilingService( - const armnn::profiling::ProfilingOptions& options, + const ProfilingOptions& options, bool resetProfilingService) { ResetExternalProfilingOptions(options, resetProfilingService); @@ -147,7 +147,7 @@ void ProfilingService::Update() ARMNN_ASSERT(m_ProfilingConnectionFactory); m_ProfilingConnection = m_ProfilingConnectionFactory->GetProfilingConnection(m_Options); } - catch (const Exception& e) + catch (const armnn::Exception& e) { ARMNN_LOG(warning) << "An error has occurred when creating the profiling connection: " << e.what(); @@ -185,7 +185,7 @@ void ProfilingService::Update() break; default: - throw RuntimeException(fmt::format("Unknown profiling service state: {}", + throw armnn::RuntimeException(fmt::format("Unknown profiling service state: {}", static_cast(currentState))); } } @@ -205,14 +205,14 @@ void ProfilingService::Disconnect() break; default: - throw RuntimeException(fmt::format("Unknown profiling service state: {}", - static_cast(currentState))); + throw armnn::RuntimeException(fmt::format("Unknown profiling service state: {}", + static_cast(currentState))); } } // Store a profiling context returned from a backend that support profiling, and register its counters -void ProfilingService::AddBackendProfilingContext(const BackendId backendId, - std::shared_ptr profilingContext) +void ProfilingService::AddBackendProfilingContext(const armnn::BackendId backendId, + std::shared_ptr profilingContext) { ARMNN_ASSERT(profilingContext != nullptr); // Register the backend counters @@ -279,7 +279,7 @@ CaptureData ProfilingService::GetCaptureData() void ProfilingService::SetCaptureData(uint32_t capturePeriod, const std::vector& counterIds, - const std::set& activeBackends) + const std::set& activeBackends) { m_Holder.SetCaptureData(capturePeriod, counterIds, activeBackends); } @@ -344,7 +344,7 @@ void ProfilingService::Initialize() { const Counter* loadedNetworksCounter = m_CounterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, - armnn::profiling::NETWORK_LOADS, + NETWORK_LOADS, "ArmNN_Runtime", 0, 0, @@ -360,7 +360,7 @@ void ProfilingService::Initialize() { const Counter* unloadedNetworksCounter = m_CounterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, - armnn::profiling::NETWORK_UNLOADS, + NETWORK_UNLOADS, "ArmNN_Runtime", 0, 0, @@ -376,7 +376,7 @@ void ProfilingService::Initialize() { const Counter* registeredBackendsCounter = m_CounterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, - armnn::profiling::REGISTERED_BACKENDS, + REGISTERED_BACKENDS, "ArmNN_Runtime", 0, 0, @@ -389,14 +389,14 @@ void ProfilingService::Initialize() // Due to backends being registered before the profiling service becomes active, // we need to set the counter to the correct value here - SetCounterValue(armnn::profiling::REGISTERED_BACKENDS, static_cast(BackendRegistryInstance().Size())); + SetCounterValue(REGISTERED_BACKENDS, static_cast(armnn::BackendRegistryInstance().Size())); } // Register a counter for the number of registered backends if (!m_CounterDirectory.IsCounterRegistered("Backends unregistered")) { const Counter* unregisteredBackendsCounter = m_CounterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, - armnn::profiling::UNREGISTERED_BACKENDS, + UNREGISTERED_BACKENDS, "ArmNN_Runtime", 0, 0, @@ -412,7 +412,7 @@ void ProfilingService::Initialize() { const Counter* inferencesRunCounter = m_CounterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, - armnn::profiling::INFERENCES_RUN, + INFERENCES_RUN, "ArmNN_Runtime", 0, 0, @@ -456,7 +456,7 @@ void ProfilingService::Reset() // ...finally reset the profiling state machine m_StateMachine.Reset(); m_BackendProfilingContexts.clear(); - m_MaxGlobalCounterId = armnn::profiling::MAX_ARMNN_COUNTER; + m_MaxGlobalCounterId = MAX_ARMNN_COUNTER; } void ProfilingService::Stop() @@ -541,6 +541,6 @@ ProfilingService::~ProfilingService() { Stop(); } -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/ProfilingService.hpp b/src/profiling/ProfilingService.hpp index af480f3c5e..ab71b0c768 100644 --- a/src/profiling/ProfilingService.hpp +++ b/src/profiling/ProfilingService.hpp @@ -35,10 +35,10 @@ #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { // Static constants describing ArmNN's counter UID's static const uint16_t NETWORK_LOADS = 0; @@ -55,10 +55,10 @@ public: using IProfilingConnectionPtr = std::unique_ptr; using CounterIndices = std::vector*>; using CounterValues = std::list>; - using BackendProfilingContext = std::unordered_map>; + using BackendProfilingContext = std::unordered_map>; - ProfilingService(Optional reportStructure = EmptyOptional()) + ProfilingService(armnn::Optional reportStructure = armnn::EmptyOptional()) : m_Options() , m_TimelineReporting(false) , m_CounterDirectory() @@ -126,7 +126,7 @@ public: m_StateMachine, *this) , m_TimelinePacketWriterFactory(m_BufferManager) - , m_MaxGlobalCounterId(armnn::profiling::INFERENCES_RUN) + , m_MaxGlobalCounterId(INFERENCES_RUN) , m_ServiceActive(false) { // Register the "Connection Acknowledged" command handler @@ -149,9 +149,9 @@ public: ~ProfilingService(); // Resets the profiling options, optionally clears the profiling service entirely - void ResetExternalProfilingOptions(const armnn::profiling::ProfilingOptions& options, + void ResetExternalProfilingOptions(const ProfilingOptions& options, bool resetProfilingService = false); - ProfilingState ConfigureProfilingService(const armnn::profiling::ProfilingOptions& options, + ProfilingState ConfigureProfilingService(const ProfilingOptions& options, bool resetProfilingService = false); @@ -162,8 +162,8 @@ public: void Disconnect(); // Store a profiling context returned from a backend that support profiling. - void AddBackendProfilingContext(const BackendId backendId, - std::shared_ptr profilingContext); + void AddBackendProfilingContext(const armnn::BackendId backendId, + std::shared_ptr profilingContext); // Enable the recording of timeline events and entities void NotifyBackendsForTimelineReporting() override; @@ -185,7 +185,7 @@ public: CaptureData GetCaptureData() override; void SetCaptureData(uint32_t capturePeriod, const std::vector& counterIds, - const std::set& activeBackends); + const std::set& activeBackends); // Setters for the profiling service state void SetCounterValue(uint16_t counterUid, uint32_t value) override; @@ -311,6 +311,6 @@ protected: } }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/ProfilingStateMachine.cpp b/src/profiling/ProfilingStateMachine.cpp index 58fac969ab..a53b978b63 100644 --- a/src/profiling/ProfilingStateMachine.cpp +++ b/src/profiling/ProfilingStateMachine.cpp @@ -9,10 +9,10 @@ #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { namespace @@ -90,6 +90,6 @@ void ProfilingStateMachine::Reset() m_State.store(ProfilingState::Uninitialised); } -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/ProfilingStateMachine.hpp b/src/profiling/ProfilingStateMachine.hpp index cbc65ec8b0..2980556ca8 100644 --- a/src/profiling/ProfilingStateMachine.hpp +++ b/src/profiling/ProfilingStateMachine.hpp @@ -9,10 +9,10 @@ #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { enum class ProfilingState @@ -35,7 +35,7 @@ public: bool IsOneOfStates(ProfilingState state1) { - IgnoreUnused(state1); + armnn::IgnoreUnused(state1); return false; } @@ -68,7 +68,7 @@ constexpr char const* GetProfilingStateName(ProfilingState state) } } -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/ProfilingUtils.cpp b/src/profiling/ProfilingUtils.cpp index f00f15667b..36578684ca 100644 --- a/src/profiling/ProfilingUtils.cpp +++ b/src/profiling/ProfilingUtils.cpp @@ -19,10 +19,10 @@ #include #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { namespace @@ -39,7 +39,7 @@ void ThrowIfCantGenerateNextUid(uint16_t uid, uint16_t cores = 0) // running multiple parallel workloads and will not provide multiple streams of data for each event) if (uid == std::numeric_limits::max()) { - throw RuntimeException("Generating the next UID for profiling would result in an overflow"); + throw armnn::RuntimeException("Generating the next UID for profiling would result in an overflow"); } break; default: // cores > 1 @@ -47,7 +47,7 @@ void ThrowIfCantGenerateNextUid(uint16_t uid, uint16_t cores = 0) // allowed value for a counter UID is consequently: uint16_t_max - cores + 1 if (uid >= std::numeric_limits::max() - cores + 1) { - throw RuntimeException("Generating the next UID for profiling would result in an overflow"); + throw armnn::RuntimeException("Generating the next UID for profiling would result in an overflow"); } break; } @@ -139,31 +139,6 @@ void WriteUint8(const IPacketBufferPtr& packetBuffer, unsigned int offset, uint8 WriteUint8(packetBuffer->GetWritableData(), offset, value); } -void WriteBytes(unsigned char* buffer, unsigned int offset, const void* value, unsigned int valueSize) -{ - arm::pipe::WriteBytes(buffer, offset, value, valueSize); -} - -void WriteUint64(unsigned char* buffer, unsigned int offset, uint64_t value) -{ - arm::pipe::WriteUint64(buffer, offset, value); -} - -void WriteUint32(unsigned char* buffer, unsigned int offset, uint32_t value) -{ - arm::pipe::WriteUint32(buffer, offset, value); -} - -void WriteUint16(unsigned char* buffer, unsigned int offset, uint16_t value) -{ - arm::pipe::WriteUint16(buffer, offset, value); -} - -void WriteUint8(unsigned char* buffer, unsigned int offset, uint8_t value) -{ - arm::pipe::WriteUint8(buffer, offset, value); -} - void ReadBytes(const IPacketBufferPtr& packetBuffer, unsigned int offset, unsigned int valueSize, uint8_t outValue[]) { ARMNN_ASSERT(packetBuffer); @@ -199,31 +174,6 @@ uint8_t ReadUint8(const IPacketBufferPtr& packetBuffer, unsigned int offset) return ReadUint8(packetBuffer->GetReadableData(), offset); } -void ReadBytes(const unsigned char* buffer, unsigned int offset, unsigned int valueSize, uint8_t outValue[]) -{ - arm::pipe::ReadBytes(buffer, offset, valueSize, outValue); -} - -uint64_t ReadUint64(const unsigned char* buffer, unsigned int offset) -{ - return arm::pipe::ReadUint64(buffer, offset); -} - -uint32_t ReadUint32(const unsigned char* buffer, unsigned int offset) -{ - return arm::pipe::ReadUint32(buffer, offset); -} - -uint16_t ReadUint16(const unsigned char* buffer, unsigned int offset) -{ - return arm::pipe::ReadUint16(buffer, offset); -} - -uint8_t ReadUint8(const unsigned char* buffer, unsigned int offset) -{ - return arm::pipe::ReadUint8(buffer, offset); -} - std::string GetSoftwareInfo() { return std::string("ArmNN"); @@ -724,11 +674,6 @@ TimelinePacketStatus WriteTimelineEventBinary(uint64_t timestamp, return TimelinePacketStatus::Ok; } -std::string CentreAlignFormatting(const std::string& stringToPass, const int spacingWidth) -{ - return arm::pipe::CentreAlignFormatting(stringToPass, spacingWidth); -} - void PrintDeviceDetails(const std::pair>& devicePair) { std::string body; @@ -904,7 +849,7 @@ void PrintCounterDirectory(ICounterDirectory& counterDirectory) uint64_t GetTimestamp() { #if USE_CLOCK_MONOTONIC_RAW - using clock = MonotonicClockRaw; + using clock = armnn::MonotonicClockRaw; #else using clock = std::chrono::steady_clock; #endif @@ -942,9 +887,9 @@ arm::pipe::Packet ReceivePacket(const unsigned char* buffer, uint32_t length) return arm::pipe::Packet(metadataIdentifier, dataLength, packetData); } -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm namespace std { diff --git a/src/profiling/ProfilingUtils.hpp b/src/profiling/ProfilingUtils.hpp index b9c8327b0d..e37e109094 100644 --- a/src/profiling/ProfilingUtils.hpp +++ b/src/profiling/ProfilingUtils.hpp @@ -22,10 +22,10 @@ #include #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { constexpr unsigned int ThreadIdSize = sizeof(int); // Is platform dependent @@ -150,9 +150,9 @@ uint64_t GetTimestamp(); arm::pipe::Packet ReceivePacket(const unsigned char* buffer, uint32_t length); -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm namespace std { diff --git a/src/profiling/RegisterBackendCounters.cpp b/src/profiling/RegisterBackendCounters.cpp index 035a2ca8a9..dcafe3b226 100644 --- a/src/profiling/RegisterBackendCounters.cpp +++ b/src/profiling/RegisterBackendCounters.cpp @@ -5,10 +5,10 @@ #include "RegisterBackendCounters.hpp" -namespace armnn +namespace arm { -namespace profiling +namespace pipe { void RegisterBackendCounters::RegisterCategory(const std::string& categoryName) @@ -18,7 +18,7 @@ void RegisterBackendCounters::RegisterCategory(const std::string& categoryName) uint16_t RegisterBackendCounters::RegisterDevice(const std::string& deviceName, uint16_t cores, - const Optional& parentCategoryName) + const armnn::Optional& parentCategoryName) { const Device* devicePtr = m_CounterDirectory.RegisterDevice(deviceName, cores, parentCategoryName); return devicePtr->m_Uid; @@ -26,7 +26,7 @@ uint16_t RegisterBackendCounters::RegisterDevice(const std::string& deviceName, uint16_t RegisterBackendCounters::RegisterCounterSet(const std::string& counterSetName, uint16_t count, - const Optional& parentCategoryName) + const armnn::Optional& parentCategoryName) { const CounterSet* counterSetPtr = m_CounterDirectory.RegisterCounterSet(counterSetName, count, parentCategoryName); return counterSetPtr->m_Uid; @@ -39,10 +39,10 @@ uint16_t RegisterBackendCounters::RegisterCounter(const uint16_t uid, double multiplier, const std::string& name, const std::string& description, - const Optional& units, - const Optional& numberOfCores, - const Optional& deviceUid, - const Optional& counterSetUid) + const armnn::Optional& units, + const armnn::Optional& numberOfCores, + const armnn::Optional& deviceUid, + const armnn::Optional& counterSetUid) { ++m_CurrentMaxGlobalCounterID; const Counter* counterPtr = m_CounterDirectory.RegisterCounter(m_BackendId, @@ -80,6 +80,6 @@ uint16_t RegisterBackendCounters::RegisterCounter(const uint16_t uid, return m_CurrentMaxGlobalCounterID; } -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/RegisterBackendCounters.hpp b/src/profiling/RegisterBackendCounters.hpp index f81f487472..f25feb5306 100644 --- a/src/profiling/RegisterBackendCounters.hpp +++ b/src/profiling/RegisterBackendCounters.hpp @@ -10,10 +10,10 @@ #include "CounterDirectory.hpp" #include "ProfilingService.hpp" -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class RegisterBackendCounters : public IRegisterBackendCounters @@ -21,7 +21,7 @@ class RegisterBackendCounters : public IRegisterBackendCounters public: RegisterBackendCounters( - uint16_t currentMaxGlobalCounterID, const BackendId& backendId, ProfilingService& profilingService) + uint16_t currentMaxGlobalCounterID, const armnn::BackendId& backendId, ProfilingService& profilingService) : m_CurrentMaxGlobalCounterID(currentMaxGlobalCounterID), m_BackendId(backendId), m_ProfilingService(profilingService), @@ -33,11 +33,12 @@ public: uint16_t RegisterDevice(const std::string& deviceName, uint16_t cores = 0, - const Optional& parentCategoryName = EmptyOptional()) override; + const armnn::Optional& parentCategoryName = armnn::EmptyOptional()) override; uint16_t RegisterCounterSet(const std::string& counterSetName, uint16_t count = 0, - const Optional& parentCategoryName = EmptyOptional()) override; + const armnn::Optional& parentCategoryName + = armnn::EmptyOptional()) override; uint16_t RegisterCounter(const uint16_t uid, const std::string& parentCategoryName, @@ -46,18 +47,18 @@ public: double multiplier, const std::string& name, const std::string& description, - const Optional& units = EmptyOptional(), - const Optional& numberOfCores = EmptyOptional(), - const Optional& deviceUid = EmptyOptional(), - const Optional& counterSetUid = EmptyOptional()) override; + const armnn::Optional& units = armnn::EmptyOptional(), + const armnn::Optional& numberOfCores = armnn::EmptyOptional(), + const armnn::Optional& deviceUid = armnn::EmptyOptional(), + const armnn::Optional& counterSetUid = armnn::EmptyOptional()) override; private: uint16_t m_CurrentMaxGlobalCounterID; - const BackendId& m_BackendId; + const armnn::BackendId& m_BackendId; ProfilingService& m_ProfilingService; ICounterRegistry& m_CounterDirectory; }; -} // namespace profiling +} // namespace pipe -} // namespace armnn \ No newline at end of file +} // namespace arm \ No newline at end of file diff --git a/src/profiling/RequestCounterDirectoryCommandHandler.cpp b/src/profiling/RequestCounterDirectoryCommandHandler.cpp index f86470b77d..601f8541ff 100644 --- a/src/profiling/RequestCounterDirectoryCommandHandler.cpp +++ b/src/profiling/RequestCounterDirectoryCommandHandler.cpp @@ -7,10 +7,10 @@ #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { void RequestCounterDirectoryCommandHandler::operator()(const arm::pipe::Packet& packet) @@ -21,7 +21,7 @@ void RequestCounterDirectoryCommandHandler::operator()(const arm::pipe::Packet& case ProfilingState::Uninitialised: case ProfilingState::NotConnected: case ProfilingState::WaitingForAck: - throw RuntimeException(fmt::format("Request Counter Directory Comand Handler invoked while in an " + throw armnn::RuntimeException(fmt::format("Request Counter Directory Comand Handler invoked while in an " "wrong state: {}", GetProfilingStateName(currentState))); case ProfilingState::Active: @@ -40,11 +40,11 @@ void RequestCounterDirectoryCommandHandler::operator()(const arm::pipe::Packet& break; default: - throw RuntimeException(fmt::format("Unknown profiling service state: {}", + throw armnn::RuntimeException(fmt::format("Unknown profiling service state: {}", static_cast(currentState))); } } -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/RequestCounterDirectoryCommandHandler.hpp b/src/profiling/RequestCounterDirectoryCommandHandler.hpp index 18577b2851..ee2874dfda 100644 --- a/src/profiling/RequestCounterDirectoryCommandHandler.hpp +++ b/src/profiling/RequestCounterDirectoryCommandHandler.hpp @@ -12,10 +12,10 @@ #include #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class RequestCounterDirectoryCommandHandler : public arm::pipe::CommandHandlerFunctor @@ -45,6 +45,6 @@ private: const ProfilingStateMachine& m_StateMachine; }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/SendCounterPacket.cpp b/src/profiling/SendCounterPacket.cpp index b0bfeb5677..38417e8ecd 100644 --- a/src/profiling/SendCounterPacket.cpp +++ b/src/profiling/SendCounterPacket.cpp @@ -18,10 +18,10 @@ #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { void SendCounterPacket::SendStreamMetaDataPacket() @@ -164,7 +164,7 @@ void SendCounterPacket::SendStreamMetaDataPacket() } catch(...) { - CancelOperationAndThrow(writeBuffer, "Error processing packet."); + CancelOperationAndThrow(writeBuffer, "Error processing packet."); } m_BufferManager.Commit(writeBuffer, totalSize, false); @@ -584,7 +584,7 @@ void SendCounterPacket::SendCounterDirectoryPacket(const ICounterDirectory& coun std::string errorMessage; if (!CreateDeviceRecord(device, deviceRecord, errorMessage)) { - CancelOperationAndThrow(errorMessage); + CancelOperationAndThrow(errorMessage); } // Update the total size in words of the device records @@ -619,7 +619,7 @@ void SendCounterPacket::SendCounterDirectoryPacket(const ICounterDirectory& coun std::string errorMessage; if (!CreateCounterSetRecord(counterSet, counterSetRecord, errorMessage)) { - CancelOperationAndThrow(errorMessage); + CancelOperationAndThrow(errorMessage); } // Update the total size in words of the counter set records @@ -654,7 +654,7 @@ void SendCounterPacket::SendCounterDirectoryPacket(const ICounterDirectory& coun std::string errorMessage; if (!CreateCategoryRecord(category, counterDirectory.GetCounters(), categoryRecord, errorMessage)) { - CancelOperationAndThrow(errorMessage); + CancelOperationAndThrow(errorMessage); } // Update the total size in words of the category records @@ -918,6 +918,6 @@ void SendCounterPacket::SendPeriodicCounterSelectionPacket(uint32_t capturePerio m_BufferManager.Commit(writeBuffer, totalSize); } -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/SendCounterPacket.hpp b/src/profiling/SendCounterPacket.hpp index ddf8b2424d..db893c026a 100644 --- a/src/profiling/SendCounterPacket.hpp +++ b/src/profiling/SendCounterPacket.hpp @@ -12,10 +12,10 @@ #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class SendCounterPacket : public ISendCounterPacket @@ -51,7 +51,7 @@ private: template void CancelOperationAndThrow(IPacketBufferPtr& writerBuffer, const std::string& errorMessage) { - if (std::is_same::value) + if (std::is_same::value) { m_BufferManager.FlushReadList(); } @@ -85,6 +85,6 @@ protected: std::string& errorMessage); }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/SendThread.cpp b/src/profiling/SendThread.cpp index 1a0e35976e..41385c5cc8 100644 --- a/src/profiling/SendThread.cpp +++ b/src/profiling/SendThread.cpp @@ -14,15 +14,15 @@ #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { -SendThread::SendThread(armnn::profiling::ProfilingStateMachine& profilingStateMachine, - armnn::profiling::IBufferManager& buffer, - armnn::profiling::ISendCounterPacket& sendCounterPacket, +SendThread::SendThread(ProfilingStateMachine& profilingStateMachine, + IBufferManager& buffer, + ISendCounterPacket& sendCounterPacket, int timeout) : m_StateMachine(profilingStateMachine) , m_BufferManager(buffer) @@ -128,7 +128,7 @@ void SendThread::Send(IProfilingConnection& profilingConnection) // An exception should be thrown here, save it to be rethrown later from the main thread so that // it can be caught by the consumer m_SendThreadException = - std::make_exception_ptr(RuntimeException("The send thread should not be running with the " + std::make_exception_ptr(armnn::RuntimeException("The send thread should not be running with the " "profiling service not yet initialized or connected")); return; @@ -270,6 +270,6 @@ bool SendThread::WaitForPacketSent(uint32_t timeout = 1000) return timedOut; } -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/SendThread.hpp b/src/profiling/SendThread.hpp index af1a72bce5..6512c8aac6 100644 --- a/src/profiling/SendThread.hpp +++ b/src/profiling/SendThread.hpp @@ -20,10 +20,10 @@ #include #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class SendThread : public ISendThread, public IConsumer @@ -70,6 +70,6 @@ private: }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/SendTimelinePacket.cpp b/src/profiling/SendTimelinePacket.cpp index 11e3d2f489..e44e5aa37c 100644 --- a/src/profiling/SendTimelinePacket.cpp +++ b/src/profiling/SendTimelinePacket.cpp @@ -5,10 +5,10 @@ #include "SendTimelinePacket.hpp" -namespace armnn +namespace arm { -namespace profiling +namespace pipe { void SendTimelinePacket::Commit() @@ -142,9 +142,9 @@ void SendTimelinePacket::SendTimelineMessageDirectoryPackage() TimelinePacketStatus result = WriteTimelineMessageDirectoryPackage(&m_WriteBuffer->GetWritableData()[m_Offset], m_RemainingBufferSize, numberOfBytesWritten); - if (result != armnn::profiling::TimelinePacketStatus::Ok) + if (result != TimelinePacketStatus::Ok) { - throw RuntimeException("Error processing TimelineMessageDirectoryPackage", CHECK_LOCATION()); + throw armnn::RuntimeException("Error processing TimelineMessageDirectoryPackage", CHECK_LOCATION()); } // Commit the message @@ -154,10 +154,10 @@ void SendTimelinePacket::SendTimelineMessageDirectoryPackage() } catch (...) { - throw RuntimeException("Error processing TimelineMessageDirectoryPackage", CHECK_LOCATION()); + throw armnn::RuntimeException("Error processing TimelineMessageDirectoryPackage", CHECK_LOCATION()); } } -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/SendTimelinePacket.hpp b/src/profiling/SendTimelinePacket.hpp index fc9cf6fd25..f915dafea7 100644 --- a/src/profiling/SendTimelinePacket.hpp +++ b/src/profiling/SendTimelinePacket.hpp @@ -13,10 +13,10 @@ #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class SendTimelinePacket : public ISendTimelinePacket @@ -97,7 +97,8 @@ void SendTimelinePacket::ForwardWriteBinaryFunction(Func& func, Params&& ... par continue; case TimelinePacketStatus::Error: - throw RuntimeException("Error processing while sending TimelineBinaryPacket", CHECK_LOCATION()); + throw armnn::RuntimeException("Error processing while sending TimelineBinaryPacket", CHECK_LOCATION + ()); default: m_Offset += numberOfBytesWritten; @@ -106,7 +107,7 @@ void SendTimelinePacket::ForwardWriteBinaryFunction(Func& func, Params&& ... par } } } - catch (const RuntimeException& ex) + catch (const armnn::RuntimeException& ex) { // don't swallow in the catch all block throw ex; @@ -116,16 +117,16 @@ void SendTimelinePacket::ForwardWriteBinaryFunction(Func& func, Params&& ... par // ditto throw ex; } - catch (const Exception& ex) + catch (const armnn::Exception& ex) { throw ex; } catch ( ... ) { - throw RuntimeException("Unknown Exception thrown while sending TimelineBinaryPacket", CHECK_LOCATION()); + throw armnn::RuntimeException("Unknown Exception thrown while sending TimelineBinaryPacket", CHECK_LOCATION()); } } -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/SocketProfilingConnection.cpp b/src/profiling/SocketProfilingConnection.cpp index 9de425b62c..4787136685 100644 --- a/src/profiling/SocketProfilingConnection.cpp +++ b/src/profiling/SocketProfilingConnection.cpp @@ -12,9 +12,9 @@ #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { SocketProfilingConnection::SocketProfilingConnection() @@ -220,5 +220,5 @@ arm::pipe::Packet SocketProfilingConnection::ReceivePacket() return arm::pipe::Packet(metadataIdentifier, dataLength, packetData); } -} // namespace profiling -} // namespace armnn +} // namespace pipe +} // namespace arm diff --git a/src/profiling/SocketProfilingConnection.hpp b/src/profiling/SocketProfilingConnection.hpp index 8d9cb20935..31b17aa8fe 100644 --- a/src/profiling/SocketProfilingConnection.hpp +++ b/src/profiling/SocketProfilingConnection.hpp @@ -10,9 +10,9 @@ #pragma once -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class SocketProfilingConnection : public IProfilingConnection @@ -39,5 +39,5 @@ private: arm::pipe::PollFd m_Socket[1]{}; }; -} // namespace profiling -} // namespace armnn +} // namespace pipe +} // namespace arm diff --git a/src/profiling/TimelinePacketWriterFactory.cpp b/src/profiling/TimelinePacketWriterFactory.cpp index b1de629fae..78eda79ef0 100644 --- a/src/profiling/TimelinePacketWriterFactory.cpp +++ b/src/profiling/TimelinePacketWriterFactory.cpp @@ -7,10 +7,10 @@ #include "SendTimelinePacket.hpp" -namespace armnn +namespace arm { -namespace profiling +namespace pipe { std::unique_ptr TimelinePacketWriterFactory::GetSendTimelinePacket() const @@ -18,6 +18,6 @@ std::unique_ptr TimelinePacketWriterFactory::GetSendTimelin return std::make_unique(m_BufferManager); } -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/TimelinePacketWriterFactory.hpp b/src/profiling/TimelinePacketWriterFactory.hpp index a1e9945303..00550ee381 100644 --- a/src/profiling/TimelinePacketWriterFactory.hpp +++ b/src/profiling/TimelinePacketWriterFactory.hpp @@ -10,10 +10,10 @@ #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class TimelinePacketWriterFactory @@ -27,6 +27,6 @@ private: IBufferManager& m_BufferManager; }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/TimelineUtilityMethods.cpp b/src/profiling/TimelineUtilityMethods.cpp index 7f8c25d066..bc8e7b6ce8 100644 --- a/src/profiling/TimelineUtilityMethods.cpp +++ b/src/profiling/TimelineUtilityMethods.cpp @@ -9,10 +9,10 @@ #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { std::unique_ptr TimelineUtilityMethods::GetTimelineUtils(ProfilingService& profilingService) @@ -114,7 +114,7 @@ ProfilingDynamicGuid TimelineUtilityMethods::CreateNamedTypedEntity(const std::s } // Generate dynamic GUID of the entity - ProfilingDynamicGuid entityGuid = profiling::ProfilingService::GetNextGuid(); + ProfilingDynamicGuid entityGuid = ProfilingService::GetNextGuid(); CreateNamedTypedEntity(entityGuid, name, type); @@ -177,7 +177,7 @@ ProfilingStaticGuid TimelineUtilityMethods::DeclareLabel(const std::string& labe } // Generate a static GUID for the given label name - ProfilingStaticGuid labelGuid = profiling::ProfilingService::GetStaticId(labelName); + ProfilingStaticGuid labelGuid = ProfilingService::GetStaticId(labelName); // Send the new label to the external profiling service, this call throws in case of error m_SendTimelinePacket->SendTimelineLabelBinaryPacket(labelGuid, labelName); @@ -200,7 +200,7 @@ void TimelineUtilityMethods::MarkEntityWithLabel(ProfilingGuid entityGuid, ProfilingStaticGuid labelGuid = DeclareLabel(labelName); // Generate a GUID for the label relationship - ProfilingDynamicGuid relationshipGuid = profiling::ProfilingService::GetNextGuid(); + ProfilingDynamicGuid relationshipGuid = ProfilingService::GetNextGuid(); // Send the new label link to the external profiling service, this call throws in case of error m_SendTimelinePacket->SendTimelineRelationshipBinaryPacket(ProfilingRelationshipType::LabelLink, @@ -214,7 +214,7 @@ void TimelineUtilityMethods::MarkEntityWithType(ProfilingGuid entityGuid, ProfilingStaticGuid typeNameGuid) { // Generate a GUID for the label relationship - ProfilingDynamicGuid relationshipGuid = profiling::ProfilingService::GetNextGuid(); + ProfilingDynamicGuid relationshipGuid = ProfilingService::GetNextGuid(); // Send the new label link to the external profiling service, this call throws in case of error m_SendTimelinePacket->SendTimelineRelationshipBinaryPacket(ProfilingRelationshipType::LabelLink, @@ -256,7 +256,7 @@ ProfilingDynamicGuid TimelineUtilityMethods::CreateNamedTypedChildEntity(Profili ProfilingDynamicGuid childEntityGuid = CreateNamedTypedEntity(entityName, entityType); // Generate a GUID for the retention link relationship - ProfilingDynamicGuid retentionLinkGuid = profiling::ProfilingService::GetNextGuid(); + ProfilingDynamicGuid retentionLinkGuid = ProfilingService::GetNextGuid(); // Send the new retention link to the external profiling service, this call throws in case of error m_SendTimelinePacket->SendTimelineRelationshipBinaryPacket(ProfilingRelationshipType::RetentionLink, @@ -291,7 +291,7 @@ void TimelineUtilityMethods::CreateNamedTypedChildEntity(ProfilingGuid childEnti CreateNamedTypedEntity(childEntityGuid, entityName, entityType); // Generate a GUID for the retention link relationship - ProfilingDynamicGuid retentionLinkGuid = profiling::ProfilingService::GetNextGuid(); + ProfilingDynamicGuid retentionLinkGuid = ProfilingService::GetNextGuid(); // Send the new retention link to the external profiling service, this call throws in case of error m_SendTimelinePacket->SendTimelineRelationshipBinaryPacket(ProfilingRelationshipType::RetentionLink, @@ -317,7 +317,7 @@ void TimelineUtilityMethods::CreateNamedTypedChildEntity(ProfilingGuid childEnti CreateNamedTypedEntity(childEntityGuid, entityName, typeGuid); // Generate a GUID for the retention link relationship - ProfilingDynamicGuid retentionLinkGuid = profiling::ProfilingService::GetNextGuid(); + ProfilingDynamicGuid retentionLinkGuid = ProfilingService::GetNextGuid(); // Send the new retention link to the external profiling service, this call throws in case of error m_SendTimelinePacket->SendTimelineRelationshipBinaryPacket(ProfilingRelationshipType::RetentionLink, @@ -333,7 +333,7 @@ ProfilingDynamicGuid TimelineUtilityMethods::CreateRelationship(ProfilingRelatio ProfilingGuid relationshipCategory) { // Generate a GUID for the relationship - ProfilingDynamicGuid relationshipGuid = profiling::ProfilingService::GetNextGuid(); + ProfilingDynamicGuid relationshipGuid = ProfilingService::GetNextGuid(); // Send the new retention link to the external profiling service, this call throws in case of error m_SendTimelinePacket->SendTimelineRelationshipBinaryPacket(relationshipType, @@ -349,7 +349,7 @@ ProfilingDynamicGuid TimelineUtilityMethods::CreateConnectionRelationship(Profil ProfilingGuid tailGuid) { // Generate a GUID for the relationship - ProfilingDynamicGuid relationshipGuid = profiling::ProfilingService::GetNextGuid(); + ProfilingDynamicGuid relationshipGuid = ProfilingService::GetNextGuid(); // Send the new retention link to the external profiling service, this call throws in case of error m_SendTimelinePacket->SendTimelineRelationshipBinaryPacket(relationshipType, @@ -378,13 +378,13 @@ ProfilingDynamicGuid TimelineUtilityMethods::RecordEvent(ProfilingGuid entityGui int threadId = armnnUtils::Threads::GetCurrentThreadId(); // Generate a GUID for the event - ProfilingDynamicGuid eventGuid = profiling::ProfilingService::GetNextGuid(); + ProfilingDynamicGuid eventGuid = ProfilingService::GetNextGuid(); // Send the new timeline event to the external profiling service, this call throws in case of error m_SendTimelinePacket->SendTimelineEventBinaryPacket(timestamp, threadId, eventGuid); // Generate a GUID for the execution link - ProfilingDynamicGuid executionLinkId = profiling::ProfilingService::GetNextGuid(); + ProfilingDynamicGuid executionLinkId = ProfilingService::GetNextGuid(); // Send the new execution link to the external profiling service, this call throws in case of error m_SendTimelinePacket->SendTimelineRelationshipBinaryPacket(ProfilingRelationshipType::ExecutionLink, @@ -399,7 +399,7 @@ ProfilingDynamicGuid TimelineUtilityMethods::RecordEvent(ProfilingGuid entityGui ProfilingDynamicGuid TimelineUtilityMethods::RecordWorkloadInferenceAndStartOfLifeEvent(ProfilingGuid workloadGuid, ProfilingGuid inferenceGuid) { - ProfilingDynamicGuid workloadInferenceGuid = profiling::ProfilingService::GetNextGuid(); + ProfilingDynamicGuid workloadInferenceGuid = ProfilingService::GetNextGuid(); CreateTypedEntity(workloadInferenceGuid, LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID); CreateRelationship(ProfilingRelationshipType::RetentionLink, inferenceGuid, @@ -418,6 +418,6 @@ void TimelineUtilityMethods::RecordEndOfLifeEvent(ProfilingGuid entityGuid) RecordEvent(entityGuid, LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS); } -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/TimelineUtilityMethods.hpp b/src/profiling/TimelineUtilityMethods.hpp index 80d5e8dffe..d0c96587b4 100644 --- a/src/profiling/TimelineUtilityMethods.hpp +++ b/src/profiling/TimelineUtilityMethods.hpp @@ -10,10 +10,10 @@ #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class TimelineUtilityMethods @@ -95,6 +95,6 @@ private: std::unique_ptr m_SendTimelinePacket; }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/backends/BackendProfiling.cpp b/src/profiling/backends/BackendProfiling.cpp index 135174b478..6c0f9b1b5c 100644 --- a/src/profiling/backends/BackendProfiling.cpp +++ b/src/profiling/backends/BackendProfiling.cpp @@ -6,10 +6,10 @@ #include "BackendProfiling.hpp" #include "RegisterBackendCounters.hpp" -namespace armnn +namespace arm { -namespace profiling +namespace pipe { std::unique_ptr @@ -92,5 +92,6 @@ bool BackendProfiling::IsProfilingEnabled() const return m_ProfilingService.IsProfilingEnabled(); } -} // namespace profiling -} // namespace armnn +} // namespace pipe + +} // namespace arm diff --git a/src/profiling/backends/BackendProfiling.hpp b/src/profiling/backends/BackendProfiling.hpp index 5bf4655dd9..82678a162f 100644 --- a/src/profiling/backends/BackendProfiling.hpp +++ b/src/profiling/backends/BackendProfiling.hpp @@ -8,10 +8,10 @@ #include "ProfilingService.hpp" #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class BackendProfiling : public IBackendProfiling @@ -19,7 +19,7 @@ class BackendProfiling : public IBackendProfiling public: BackendProfiling(const ProfilingOptions& options, ProfilingService& profilingService, - const BackendId& backendId) + const armnn::BackendId& backendId) : m_Options(options), m_ProfilingService(profilingService), m_BackendId(backendId) {} @@ -45,7 +45,9 @@ public: private: ProfilingOptions m_Options; ProfilingService& m_ProfilingService; - BackendId m_BackendId; + armnn::BackendId m_BackendId; }; -} // namespace profiling -} // namespace armnn + +} // namespace pipe + +} // namespace arm diff --git a/src/profiling/test/BufferTests.cpp b/src/profiling/test/BufferTests.cpp index e3abe862e4..c4714d6ad4 100644 --- a/src/profiling/test/BufferTests.cpp +++ b/src/profiling/test/BufferTests.cpp @@ -13,7 +13,7 @@ #include -using namespace armnn::profiling; +using namespace arm::pipe; TEST_SUITE("BufferTests") { @@ -383,8 +383,8 @@ TEST_CASE("ReadSwTraceMessageExceptionTest0") unsigned int uint32_t_size = sizeof(uint32_t); unsigned int offset = uint32_t_size; - CHECK_THROWS_AS(arm::pipe::ReadSwTraceMessage(packetBuffer->GetReadableData(), offset, packetBuffer->GetSize()), - arm::pipe::ProfilingException); + CHECK_THROWS_AS(ReadSwTraceMessage(packetBuffer->GetReadableData(), offset, packetBuffer->GetSize()), + ProfilingException); } @@ -405,8 +405,8 @@ TEST_CASE("ReadSwTraceMessageExceptionTest1") unsigned int uint32_t_size = sizeof(uint32_t); unsigned int offset = uint32_t_size; - CHECK_THROWS_AS(arm::pipe::ReadSwTraceMessage(packetBuffer->GetReadableData(), offset, packetBuffer->GetSize()), - arm::pipe::ProfilingException); + CHECK_THROWS_AS(ReadSwTraceMessage(packetBuffer->GetReadableData(), offset, packetBuffer->GetSize()), + ProfilingException); } diff --git a/src/profiling/test/FileOnlyProfilingDecoratorTests.cpp b/src/profiling/test/FileOnlyProfilingDecoratorTests.cpp index 03767c0a2a..5c5ee8a0e4 100644 --- a/src/profiling/test/FileOnlyProfilingDecoratorTests.cpp +++ b/src/profiling/test/FileOnlyProfilingDecoratorTests.cpp @@ -19,7 +19,7 @@ #include #include -using namespace armnn::profiling; +using namespace arm::pipe; using namespace armnn; using namespace std::chrono_literals; @@ -32,7 +32,7 @@ class FileOnlyHelperService : public ProfilingService { return ProfilingService::WaitForPacketSent(m_ProfilingService, timeout); } - armnn::profiling::ProfilingService m_ProfilingService; + ProfilingService m_ProfilingService; }; TEST_SUITE("FileOnlyProfilingDecoratorTests") diff --git a/src/profiling/test/PrintPacketHeaderHandler.cpp b/src/profiling/test/PrintPacketHeaderHandler.cpp index f85a7b1fcb..393153424d 100644 --- a/src/profiling/test/PrintPacketHeaderHandler.cpp +++ b/src/profiling/test/PrintPacketHeaderHandler.cpp @@ -8,10 +8,10 @@ #include #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { std::vector PrintPacketHeaderHandler::GetHeadersAccepted() @@ -27,6 +27,6 @@ void PrintPacketHeaderHandler::HandlePacket(const arm::pipe::Packet& packet) std::cout << ss.str() << std::endl; }; -} // namespace profiling +} // namespace pipe -} // namespace armnn \ No newline at end of file +} // namespace arm \ No newline at end of file diff --git a/src/profiling/test/PrintPacketHeaderHandler.hpp b/src/profiling/test/PrintPacketHeaderHandler.hpp index 397da0b8ea..a05e733c07 100644 --- a/src/profiling/test/PrintPacketHeaderHandler.hpp +++ b/src/profiling/test/PrintPacketHeaderHandler.hpp @@ -9,10 +9,10 @@ #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class PrintPacketHeaderHandler : public ILocalPacketHandler @@ -22,6 +22,6 @@ class PrintPacketHeaderHandler : public ILocalPacketHandler virtual void HandlePacket(const arm::pipe::Packet& packet); }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/test/ProfilingConnectionDumpToFileDecoratorTests.cpp b/src/profiling/test/ProfilingConnectionDumpToFileDecoratorTests.cpp index a851e940b4..3c4800a361 100644 --- a/src/profiling/test/ProfilingConnectionDumpToFileDecoratorTests.cpp +++ b/src/profiling/test/ProfilingConnectionDumpToFileDecoratorTests.cpp @@ -14,7 +14,7 @@ #include -using namespace armnn::profiling; +using namespace arm::pipe; namespace { @@ -32,7 +32,7 @@ public: { // populate packet data and construct packet std::memcpy(m_PacketData.get(), g_DataPtr, g_DataLength); - m_Packet = std::make_unique(0u, g_DataLength, m_PacketData); + m_Packet = std::make_unique(0u, g_DataLength, m_PacketData); } ~DummyProfilingConnection() = default; @@ -54,7 +54,7 @@ public: return true; } - arm::pipe::Packet ReadPacket(uint32_t timeout) override + Packet ReadPacket(uint32_t timeout) override { armnn::IgnoreUnused(timeout); return std::move(*m_Packet); @@ -63,7 +63,7 @@ public: private: bool m_Open; std::unique_ptr m_PacketData; - std::unique_ptr m_Packet; + std::unique_ptr m_Packet; }; std::vector ReadDumpFile(const std::string& dumpFileName) @@ -105,8 +105,8 @@ TEST_CASE("DumpIncomingValidFile") ProfilingConnectionDumpToFileDecorator decorator(std::make_unique(), options, false); // NOTE: unique_ptr is needed here because operator=() is deleted for Packet - std::unique_ptr packet; - CHECK_NOTHROW(packet = std::make_unique(decorator.ReadPacket(0))); + std::unique_ptr packet; + CHECK_NOTHROW(packet = std::make_unique(decorator.ReadPacket(0))); decorator.Close(); diff --git a/src/profiling/test/ProfilingGuidTest.cpp b/src/profiling/test/ProfilingGuidTest.cpp index 30cfae82ca..0537badc33 100644 --- a/src/profiling/test/ProfilingGuidTest.cpp +++ b/src/profiling/test/ProfilingGuidTest.cpp @@ -14,7 +14,7 @@ #include #include -using namespace armnn::profiling; +using namespace arm::pipe; TEST_SUITE("ProfilingGuidTests") { @@ -93,10 +93,10 @@ TEST_CASE("StaticGuidGeneratorCollisionTest") // If we're running on a 32bit system it is more likely to get a GUID clash over 1 million executions. // We can generally detect this when the GUID turns out to be MIN_STATIC_GUID. Output a warning // message rather than error in this case. - if (guid == ProfilingGuid(armnn::profiling::MIN_STATIC_GUID)) + if (guid == ProfilingGuid(MIN_STATIC_GUID)) { WARN("MIN_STATIC_GUID returned more than once from GenerateStaticId."); - } + } else { FAIL(fmt::format("GUID collision occurred: {} -> {}", str, guid)); diff --git a/src/profiling/test/ProfilingMocks.hpp b/src/profiling/test/ProfilingMocks.hpp index 491f057599..5e7d31a914 100644 --- a/src/profiling/test/ProfilingMocks.hpp +++ b/src/profiling/test/ProfilingMocks.hpp @@ -27,10 +27,10 @@ #include #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class MockProfilingConnection : public IProfilingConnection @@ -131,7 +131,7 @@ public: arm::pipe::Packet ReadPacket(uint32_t timeout) override { - IgnoreUnused(timeout); + armnn::IgnoreUnused(timeout); // Simulate a delay in the reading process. The default timeout is way too long. std::this_thread::sleep_for(std::chrono::milliseconds(5)); @@ -165,7 +165,7 @@ class MockProfilingConnectionFactory : public IProfilingConnectionFactory public: IProfilingConnectionPtr GetProfilingConnection(const ProfilingOptions& options) const override { - IgnoreUnused(options); + armnn::IgnoreUnused(options); return std::make_unique(); } }; @@ -404,7 +404,7 @@ public: void SendCounterDirectoryPacket(const ICounterDirectory& counterDirectory) override { - IgnoreUnused(counterDirectory); + armnn::IgnoreUnused(counterDirectory); std::string message("SendCounterDirectoryPacket"); unsigned int reserved = 0; @@ -416,7 +416,7 @@ public: void SendPeriodicCounterCapturePacket(uint64_t timestamp, const std::vector& values) override { - IgnoreUnused(timestamp, values); + armnn::IgnoreUnused(timestamp, values); std::string message("SendPeriodicCounterCapturePacket"); unsigned int reserved = 0; @@ -428,7 +428,7 @@ public: void SendPeriodicCounterSelectionPacket(uint32_t capturePeriod, const std::vector& selectedCounterIds) override { - IgnoreUnused(capturePeriod, selectedCounterIds); + armnn::IgnoreUnused(capturePeriod, selectedCounterIds); std::string message("SendPeriodicCounterSelectionPacket"); unsigned int reserved = 0; @@ -505,7 +505,7 @@ public: return counterSetPtr; } - const Counter* RegisterCounter(const BackendId& backendId, + const Counter* RegisterCounter(const armnn::BackendId& backendId, const uint16_t uid, const std::string& parentCategoryName, uint16_t counterClass, @@ -518,7 +518,7 @@ public: const armnn::Optional& deviceUid = armnn::EmptyOptional(), const armnn::Optional& counterSetUid = armnn::EmptyOptional()) { - IgnoreUnused(backendId); + armnn::IgnoreUnused(backendId); // Get the number of cores from the argument only uint16_t deviceCores = numberOfCores.has_value() ? numberOfCores.value() : 0; @@ -602,19 +602,19 @@ public: const Device* GetDevice(uint16_t uid) const override { - IgnoreUnused(uid); + armnn::IgnoreUnused(uid); return nullptr; // Not used by the unit tests } const CounterSet* GetCounterSet(uint16_t uid) const override { - IgnoreUnused(uid); + armnn::IgnoreUnused(uid); return nullptr; // Not used by the unit tests } const Counter* GetCounter(uint16_t uid) const override { - IgnoreUnused(uid); + armnn::IgnoreUnused(uid); return nullptr; // Not used by the unit tests } @@ -698,9 +698,9 @@ class MockProfilingServiceStatus : public IProfilingServiceStatus { public: void NotifyProfilingServiceActive() override {} - void WaitForProfilingServiceActivation(unsigned int timeout) override { IgnoreUnused(timeout); } + void WaitForProfilingServiceActivation(unsigned int timeout) override { armnn::IgnoreUnused(timeout); } }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/test/ProfilingTestUtils.cpp b/src/profiling/test/ProfilingTestUtils.cpp index a03a3ba28a..154234667e 100644 --- a/src/profiling/test/ProfilingTestUtils.cpp +++ b/src/profiling/test/ProfilingTestUtils.cpp @@ -125,7 +125,7 @@ ProfilingGuid VerifyTimelineLabelBinaryPacketData(Optional guid, } else { - armnn::profiling::ProfilingService profilingService; + ProfilingService profilingService; CHECK(readProfilingGuid == profilingService.GetStaticId(label)); } @@ -373,7 +373,7 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) GetProfilingService(&runtime).ResetExternalProfilingOptions( ConvertExternalProfilingOptions(options.m_ProfilingOptions), false); - profiling::ProfilingServiceRuntimeHelper profilingServiceHelper(GetProfilingService(&runtime)); + ProfilingServiceRuntimeHelper profilingServiceHelper(GetProfilingService(&runtime)); profilingServiceHelper.ForceTransitionToState(ProfilingState::NotConnected); profilingServiceHelper.ForceTransitionToState(ProfilingState::WaitingForAck); profilingServiceHelper.ForceTransitionToState(ProfilingState::Active); @@ -442,7 +442,7 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId) armnn::NetworkId netId; CHECK(runtime.LoadNetwork(netId, std::move(optNet)) == Status::Success); - profiling::BufferManager& bufferManager = profilingServiceHelper.GetProfilingBufferManager(); + BufferManager& bufferManager = profilingServiceHelper.GetProfilingBufferManager(); auto readableBuffer = bufferManager.GetReadableBuffer(); // Profiling is enabled, the post-optimisation structure should be created diff --git a/src/profiling/test/ProfilingTestUtils.hpp b/src/profiling/test/ProfilingTestUtils.hpp index 6be35a96be..810a34c3e2 100644 --- a/src/profiling/test/ProfilingTestUtils.hpp +++ b/src/profiling/test/ProfilingTestUtils.hpp @@ -16,7 +16,7 @@ #include using namespace armnn; -using namespace armnn::profiling; +using namespace arm::pipe; const static uint32_t bodyHeaderSize = 6; @@ -63,10 +63,10 @@ void VerifyPostOptimisationStructureTestImpl(armnn::BackendId backendId); bool CompareOutput(std::vector output, std::vector expectedOutput); -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class ProfilingServiceRuntimeHelper : public ProfilingService @@ -80,7 +80,7 @@ public: { return GetBufferManager(m_ProfilingService); } - armnn::profiling::ProfilingService& m_ProfilingService; + ProfilingService& m_ProfilingService; void ForceTransitionToState(ProfilingState newState) { @@ -88,7 +88,7 @@ public: } }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/test/ProfilingTests.cpp b/src/profiling/test/ProfilingTests.cpp index 12a0105563..cba6ebd475 100644 --- a/src/profiling/test/ProfilingTests.cpp +++ b/src/profiling/test/ProfilingTests.cpp @@ -51,7 +51,7 @@ #include -using namespace armnn::profiling; +using namespace arm::pipe; using PacketType = MockProfilingConnection::PacketType; TEST_SUITE("ExternalProfiling") @@ -530,7 +530,7 @@ TEST_CASE("CheckProfilingStateMachine") ProfilingStateMachine profilingState15(ProfilingState::Active); CHECK_THROWS_AS(profilingState15.TransitionToState(ProfilingState::Uninitialised), armnn::Exception); - ProfilingStateMachine profilingState16(armnn::profiling::ProfilingState::Active); + ProfilingStateMachine profilingState16(ProfilingState::Active); CHECK_THROWS_AS(profilingState16.TransitionToState(ProfilingState::WaitingForAck), armnn::Exception); ProfilingStateMachine profilingState17(ProfilingState::Uninitialised); @@ -657,7 +657,7 @@ TEST_CASE("CaptureDataMethods") TEST_CASE("CheckProfilingServiceDisabled") { ProfilingOptions options; - armnn::profiling::ProfilingService profilingService; + ProfilingService profilingService; profilingService.ResetExternalProfilingOptions(options, true); CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); profilingService.Update(); @@ -667,7 +667,7 @@ TEST_CASE("CheckProfilingServiceDisabled") TEST_CASE("CheckProfilingServiceCounterDirectory") { ProfilingOptions options; - armnn::profiling::ProfilingService profilingService; + ProfilingService profilingService; profilingService.ResetExternalProfilingOptions(options, true); const ICounterDirectory& counterDirectory0 = profilingService.GetCounterDirectory(); @@ -691,7 +691,7 @@ TEST_CASE("CheckProfilingServiceCounterValues") { ProfilingOptions options; options.m_EnableProfiling = true; - armnn::profiling::ProfilingService profilingService; + ProfilingService profilingService; profilingService.ResetExternalProfilingOptions(options, true); profilingService.Update(); @@ -702,7 +702,7 @@ TEST_CASE("CheckProfilingServiceCounterValues") std::vector writers; CHECK(!counters.empty()); - uint16_t inferencesRun = armnn::profiling::INFERENCES_RUN; + uint16_t inferencesRun = INFERENCES_RUN; // Test GetAbsoluteCounterValue for (int i = 0; i < 4; ++i) @@ -838,13 +838,13 @@ TEST_CASE("CheckCounterDirectoryRegisterCategory") // Register a category with an invalid name const Category* noCategory = nullptr; - CHECK_THROWS_AS(noCategory = counterDirectory.RegisterCategory(""), armnn::InvalidArgumentException); + CHECK_THROWS_AS(noCategory = counterDirectory.RegisterCategory(""), arm::pipe::InvalidArgumentException); CHECK(counterDirectory.GetCategoryCount() == 0); CHECK(!noCategory); // Register a category with an invalid name CHECK_THROWS_AS(noCategory = counterDirectory.RegisterCategory("invalid category"), - armnn::InvalidArgumentException); + arm::pipe::InvalidArgumentException); CHECK(counterDirectory.GetCategoryCount() == 0); CHECK(!noCategory); @@ -871,7 +871,7 @@ TEST_CASE("CheckCounterDirectoryRegisterCategory") // Register a category already registered const Category* anotherCategory = nullptr; CHECK_THROWS_AS(anotherCategory = counterDirectory.RegisterCategory(categoryName), - armnn::InvalidArgumentException); + arm::pipe::InvalidArgumentException); CHECK(counterDirectory.GetCategoryCount() == 1); CHECK(!anotherCategory); @@ -898,7 +898,7 @@ TEST_CASE("CheckCounterDirectoryRegisterCategory") const Category* categoryInvalidDeviceName = nullptr; CHECK_THROWS_AS(categoryInvalidDeviceName = counterDirectory.RegisterCategory(categoryWoDeviceName), - armnn::InvalidArgumentException); + arm::pipe::InvalidArgumentException); CHECK(counterDirectory.GetCategoryCount() == 2); CHECK(!categoryInvalidDeviceName); @@ -961,12 +961,12 @@ TEST_CASE("CheckCounterDirectoryRegisterDevice") // Register a device with an invalid name const Device* noDevice = nullptr; - CHECK_THROWS_AS(noDevice = counterDirectory.RegisterDevice(""), armnn::InvalidArgumentException); + CHECK_THROWS_AS(noDevice = counterDirectory.RegisterDevice(""), arm::pipe::InvalidArgumentException); CHECK(counterDirectory.GetDeviceCount() == 0); CHECK(!noDevice); // Register a device with an invalid name - CHECK_THROWS_AS(noDevice = counterDirectory.RegisterDevice("inv@lid nam€"), armnn::InvalidArgumentException); + CHECK_THROWS_AS(noDevice = counterDirectory.RegisterDevice("inv@lid nam€"), arm::pipe::InvalidArgumentException); CHECK(counterDirectory.GetDeviceCount() == 0); CHECK(!noDevice); @@ -992,7 +992,7 @@ TEST_CASE("CheckCounterDirectoryRegisterDevice") // Register a device with the name of a device already registered const Device* deviceSameName = nullptr; - CHECK_THROWS_AS(deviceSameName = counterDirectory.RegisterDevice(deviceName), armnn::InvalidArgumentException); + CHECK_THROWS_AS(deviceSameName = counterDirectory.RegisterDevice(deviceName), arm::pipe::InvalidArgumentException); CHECK(counterDirectory.GetDeviceCount() == 1); CHECK(!deviceSameName); @@ -1019,7 +1019,7 @@ TEST_CASE("CheckCounterDirectoryRegisterDevice") const Device* deviceWCoresWInvalidParentCategory = nullptr; CHECK_THROWS_AS(deviceWCoresWInvalidParentCategory = counterDirectory.RegisterDevice(deviceWCoresWInvalidParentCategoryName, 3, std::string("")), - armnn::InvalidArgumentException); + arm::pipe::InvalidArgumentException); CHECK(counterDirectory.GetDeviceCount() == 2); CHECK(!deviceWCoresWInvalidParentCategory); @@ -1028,7 +1028,7 @@ TEST_CASE("CheckCounterDirectoryRegisterDevice") const Device* deviceWCoresWInvalidParentCategory2 = nullptr; CHECK_THROWS_AS(deviceWCoresWInvalidParentCategory2 = counterDirectory.RegisterDevice( deviceWCoresWInvalidParentCategoryName2, 3, std::string("invalid_parent_category")), - armnn::InvalidArgumentException); + arm::pipe::InvalidArgumentException); CHECK(counterDirectory.GetDeviceCount() == 2); CHECK(!deviceWCoresWInvalidParentCategory2); @@ -1065,13 +1065,13 @@ TEST_CASE("CheckCounterDirectoryRegisterCounterSet") // Register a counter set with an invalid name const CounterSet* noCounterSet = nullptr; - CHECK_THROWS_AS(noCounterSet = counterDirectory.RegisterCounterSet(""), armnn::InvalidArgumentException); + CHECK_THROWS_AS(noCounterSet = counterDirectory.RegisterCounterSet(""), arm::pipe::InvalidArgumentException); CHECK(counterDirectory.GetCounterSetCount() == 0); CHECK(!noCounterSet); // Register a counter set with an invalid name CHECK_THROWS_AS(noCounterSet = counterDirectory.RegisterCounterSet("invalid name"), - armnn::InvalidArgumentException); + arm::pipe::InvalidArgumentException); CHECK(counterDirectory.GetCounterSetCount() == 0); CHECK(!noCounterSet); @@ -1098,7 +1098,7 @@ TEST_CASE("CheckCounterDirectoryRegisterCounterSet") // Register a counter set with the name of a counter set already registered const CounterSet* counterSetSameName = nullptr; CHECK_THROWS_AS(counterSetSameName = counterDirectory.RegisterCounterSet(counterSetName), - armnn::InvalidArgumentException); + arm::pipe::InvalidArgumentException); CHECK(counterDirectory.GetCounterSetCount() == 1); CHECK(!counterSetSameName); @@ -1126,7 +1126,7 @@ TEST_CASE("CheckCounterDirectoryRegisterCounterSet") const CounterSet* counterSetWCountWInvalidParentCategory = nullptr; CHECK_THROWS_AS(counterSetWCountWInvalidParentCategory = counterDirectory.RegisterCounterSet( counterSetWCountWInvalidParentCategoryName, 42, std::string("")), - armnn::InvalidArgumentException); + arm::pipe::InvalidArgumentException); CHECK(counterDirectory.GetCounterSetCount() == 2); CHECK(!counterSetWCountWInvalidParentCategory); @@ -1136,7 +1136,7 @@ TEST_CASE("CheckCounterDirectoryRegisterCounterSet") const CounterSet* counterSetWCountWInvalidParentCategory2 = nullptr; CHECK_THROWS_AS(counterSetWCountWInvalidParentCategory2 = counterDirectory.RegisterCounterSet( counterSetWCountWInvalidParentCategoryName2, 42, std::string("invalid_parent_category")), - armnn::InvalidArgumentException); + arm::pipe::InvalidArgumentException); CHECK(counterDirectory.GetCounterSetCount() == 2); CHECK(!counterSetWCountWInvalidParentCategory2); @@ -1169,7 +1169,7 @@ TEST_CASE("CheckCounterDirectoryRegisterCounterSet") const CounterSet* counterSetSameCategory = nullptr; CHECK_THROWS_AS(counterSetSameCategory = counterDirectory.RegisterCounterSet(counterSetSameCategoryName, 0, invalidCategoryName), - armnn::InvalidArgumentException); + arm::pipe::InvalidArgumentException); CHECK(counterDirectory.GetCounterSetCount() == 3); CHECK(!counterSetSameCategory); } @@ -1193,62 +1193,62 @@ TEST_CASE("CheckCounterDirectoryRegisterCounter") 123.45f, "valid ", "name"), - armnn::InvalidArgumentException); + arm::pipe::InvalidArgumentException); CHECK(counterDirectory.GetCounterCount() == 0); CHECK(!noCounter); // Register a counter with an invalid parent category name CHECK_THROWS_AS(noCounter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, - 1, - "invalid parent category", - 0, - 1, - 123.45f, - "valid name", - "valid description"), - armnn::InvalidArgumentException); + 1, + "invalid parent category", + 0, + 1, + 123.45f, + "valid name", + "valid description"), + arm::pipe::InvalidArgumentException); CHECK(counterDirectory.GetCounterCount() == 0); CHECK(!noCounter); // Register a counter with an invalid class CHECK_THROWS_AS(noCounter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, - 2, - "valid_parent_category", - 2, - 1, - 123.45f, - "valid " - "name", - "valid description"), - armnn::InvalidArgumentException); + 2, + "valid_parent_category", + 2, + 1, + 123.45f, + "valid " + "name", + "valid description"), + arm::pipe::InvalidArgumentException); CHECK(counterDirectory.GetCounterCount() == 0); CHECK(!noCounter); // Register a counter with an invalid interpolation CHECK_THROWS_AS(noCounter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, - 4, - "valid_parent_category", - 0, - 3, - 123.45f, - "valid " - "name", - "valid description"), - armnn::InvalidArgumentException); + 4, + "valid_parent_category", + 0, + 3, + 123.45f, + "valid " + "name", + "valid description"), + arm::pipe::InvalidArgumentException); CHECK(counterDirectory.GetCounterCount() == 0); CHECK(!noCounter); // Register a counter with an invalid multiplier CHECK_THROWS_AS(noCounter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, - 5, - "valid_parent_category", - 0, - 1, - .0f, - "valid " - "name", - "valid description"), - armnn::InvalidArgumentException); + 5, + "valid_parent_category", + 0, + 1, + .0f, + "valid " + "name", + "valid description"), + arm::pipe::InvalidArgumentException); CHECK(counterDirectory.GetCounterCount() == 0); CHECK(!noCounter); @@ -1262,20 +1262,20 @@ TEST_CASE("CheckCounterDirectoryRegisterCounter") 123.45f, "", "valid description"), - armnn::InvalidArgumentException); + arm::pipe::InvalidArgumentException); CHECK(counterDirectory.GetCounterCount() == 0); CHECK(!noCounter); // Register a counter with an invalid name CHECK_THROWS_AS(noCounter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, - 7, - "valid_parent_category", - 0, - 1, - 123.45f, - "invalid nam€", - "valid description"), - armnn::InvalidArgumentException); + 7, + "valid_parent_category", + 0, + 1, + 123.45f, + "invalid nam€", + "valid description"), + arm::pipe::InvalidArgumentException); CHECK(counterDirectory.GetCounterCount() == 0); CHECK(!noCounter); @@ -1289,48 +1289,48 @@ TEST_CASE("CheckCounterDirectoryRegisterCounter") 123.45f, "valid name", ""), - armnn::InvalidArgumentException); + arm::pipe::InvalidArgumentException); CHECK(counterDirectory.GetCounterCount() == 0); CHECK(!noCounter); // Register a counter with an invalid description CHECK_THROWS_AS(noCounter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, - 9, - "valid_parent_category", - 0, - 1, - 123.45f, - "valid " - "name", - "inv@lid description"), - armnn::InvalidArgumentException); + 9, + "valid_parent_category", + 0, + 1, + 123.45f, + "valid " + "name", + "inv@lid description"), + arm::pipe::InvalidArgumentException); CHECK(counterDirectory.GetCounterCount() == 0); CHECK(!noCounter); // Register a counter with an invalid unit2 CHECK_THROWS_AS(noCounter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, - 10, - "valid_parent_category", - 0, - 1, - 123.45f, - "valid name", - "valid description", - std::string("Mb/s2")), - armnn::InvalidArgumentException); + 10, + "valid_parent_category", + 0, + 1, + 123.45f, + "valid name", + "valid description", + std::string("Mb/s2")), + arm::pipe::InvalidArgumentException); CHECK(counterDirectory.GetCounterCount() == 0); CHECK(!noCounter); // Register a counter with a non-existing parent category name CHECK_THROWS_AS(noCounter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, - 11, - "invalid_parent_category", - 0, - 1, - 123.45f, - "valid name", - "valid description"), - armnn::InvalidArgumentException); + 11, + "invalid_parent_category", + 0, + 1, + 123.45f, + "valid name", + "valid description"), + arm::pipe::InvalidArgumentException); CHECK(counterDirectory.GetCounterCount() == 0); CHECK(!noCounter); @@ -1384,21 +1384,21 @@ TEST_CASE("CheckCounterDirectoryRegisterCounter") "valid name", "valid description", std::string("description")), - armnn::InvalidArgumentException); + arm::pipe::InvalidArgumentException); CHECK(counterDirectory.GetCounterCount() == 1); CHECK(!counterSameName); // Register a counter with a valid parent category name and units const Counter* counterWUnits = nullptr; CHECK_NOTHROW(counterWUnits = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, - 14, - categoryName, - 0, - 1, - 123.45f, - "valid name 2", - "valid description", - std::string("Mnnsq2"))); // Units + 14, + categoryName, + 0, + 1, + 123.45f, + "valid name 2", + "valid description", + std::string("Mnnsq2"))); // Units CHECK(counterDirectory.GetCounterCount() == 2); CHECK(counterWUnits); CHECK(counterWUnits->m_Uid > counter->m_Uid); @@ -1417,16 +1417,16 @@ TEST_CASE("CheckCounterDirectoryRegisterCounter") // Register a counter with a valid parent category name and not associated with a device const Counter* counterWoDevice = nullptr; CHECK_NOTHROW(counterWoDevice = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, - 26, - categoryName, - 0, - 1, - 123.45f, - "valid name 3", - "valid description", - armnn::EmptyOptional(),// Units - armnn::EmptyOptional(),// Number of cores - 0)); // Device UID + 26, + categoryName, + 0, + 1, + 123.45f, + "valid name 3", + "valid description", + armnn::EmptyOptional(),// Units + armnn::EmptyOptional(),// Number of cores + 0)); // Device UID CHECK(counterDirectory.GetCounterCount() == 3); CHECK(counterWoDevice); CHECK(counterWoDevice->m_Uid > counter->m_Uid); @@ -1444,17 +1444,17 @@ TEST_CASE("CheckCounterDirectoryRegisterCounter") // Register a counter with a valid parent category name and associated to an invalid device CHECK_THROWS_AS(noCounter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, - 15, - categoryName, - 0, - 1, - 123.45f, - "valid name 4", - "valid description", - armnn::EmptyOptional(), // Units - armnn::EmptyOptional(), // Number of cores - 100), // Device UID - armnn::InvalidArgumentException); + 15, + categoryName, + 0, + 1, + 123.45f, + "valid name 4", + "valid description", + armnn::EmptyOptional(), // Units + armnn::EmptyOptional(), // Number of cores + 100), // Device UID + arm::pipe::InvalidArgumentException); CHECK(counterDirectory.GetCounterCount() == 3); CHECK(!noCounter); @@ -1471,16 +1471,16 @@ TEST_CASE("CheckCounterDirectoryRegisterCounter") // Register a counter with a valid parent category name and associated to a device const Counter* counterWDevice = nullptr; CHECK_NOTHROW(counterWDevice = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, - 16, - categoryName, - 0, - 1, - 123.45f, - "valid name 5", - std::string("valid description"), - armnn::EmptyOptional(), // Units - armnn::EmptyOptional(), // Number of cores - device->m_Uid)); // Device UID + 16, + categoryName, + 0, + 1, + 123.45f, + "valid name 5", + std::string("valid description"), + armnn::EmptyOptional(), // Units + armnn::EmptyOptional(), // Number of cores + device->m_Uid)); // Device UID CHECK(counterDirectory.GetCounterCount() == 4); CHECK(counterWDevice); CHECK(counterWDevice->m_Uid > counter->m_Uid); @@ -1499,17 +1499,17 @@ TEST_CASE("CheckCounterDirectoryRegisterCounter") // Register a counter with a valid parent category name and not associated with a counter set const Counter* counterWoCounterSet = nullptr; CHECK_NOTHROW(counterWoCounterSet = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, - 17, - categoryName, - 0, - 1, - 123.45f, - "valid name 6", - "valid description", - armnn::EmptyOptional(),// Units - armnn::EmptyOptional(),// No of cores - armnn::EmptyOptional(),// Device UID - 0)); // CounterSet UID + 17, + categoryName, + 0, + 1, + 123.45f, + "valid name 6", + "valid description", + armnn::EmptyOptional(),// Units + armnn::EmptyOptional(),// No of cores + armnn::EmptyOptional(),// Device UID + 0)); // CounterSet UID CHECK(counterDirectory.GetCounterCount() == 5); CHECK(counterWoCounterSet); CHECK(counterWoCounterSet->m_Uid > counter->m_Uid); @@ -1527,18 +1527,18 @@ TEST_CASE("CheckCounterDirectoryRegisterCounter") // Register a counter with a valid parent category name and associated to an invalid counter set CHECK_THROWS_AS(noCounter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, - 18, - categoryName, - 0, - 1, - 123.45f, - "valid ", - "name 7", - std::string("valid description"), - armnn::EmptyOptional(), // Units - armnn::EmptyOptional(), // Number of cores - 100), // Counter set UID - armnn::InvalidArgumentException); + 18, + categoryName, + 0, + 1, + 123.45f, + "valid ", + "name 7", + std::string("valid description"), + armnn::EmptyOptional(), // Units + armnn::EmptyOptional(), // Number of cores + 100), // Counter set UID + arm::pipe::InvalidArgumentException); CHECK(counterDirectory.GetCounterCount() == 5); CHECK(!noCounter); @@ -1727,12 +1727,12 @@ TEST_CASE("CheckCounterDirectoryRegisterCounter") // Register a counter to the other category const Counter* anotherCounter = nullptr; CHECK_NOTHROW(anotherCounter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, 24, - anotherCategoryName, 1, 0, .00043f, - "valid name", "valid description", - armnn::EmptyOptional(), // Units - armnn::EmptyOptional(), // Number of cores - device->m_Uid, // Device UID - counterSet->m_Uid)); // Counter set UID + anotherCategoryName, 1, 0, .00043f, + "valid name", "valid description", + armnn::EmptyOptional(), // Units + armnn::EmptyOptional(), // Number of cores + device->m_Uid, // Device UID + counterSet->m_Uid)); // Counter set UID CHECK(counterDirectory.GetCounterCount() == 29); CHECK(anotherCounter); CHECK(anotherCounter->m_MaxCounterUid == anotherCounter->m_Uid); @@ -1787,7 +1787,7 @@ TEST_CASE("CounterSelectionCommandHandlerParseData") uint32_t version = 1; const std::unordered_map> backendProfilingContext; + std::shared_ptr> backendProfilingContext; CounterIdMap counterIdMap; Holder holder; TestCaptureThread captureThread; @@ -1928,7 +1928,7 @@ TEST_CASE("CheckTimelineActivationAndDeactivation") TestReportStructure testReportStructure; TestNotifyBackends testNotifyBackends; - profiling::ActivateTimelineReportingCommandHandler activateTimelineReportingCommandHandler(0, + ActivateTimelineReportingCommandHandler activateTimelineReportingCommandHandler(0, 6, packetVersionResolver.ResolvePacketVersion(0, 6) .GetEncodedValue(), @@ -2001,19 +2001,18 @@ TEST_CASE("CheckTimelineActivationAndDeactivation") TEST_CASE("CheckProfilingServiceNotActive") { using namespace armnn; - using namespace armnn::profiling; // Create runtime in which the test will run armnn::IRuntime::CreationOptions options; options.m_ProfilingOptions.m_EnableProfiling = true; armnn::RuntimeImpl runtime(options); - profiling::ProfilingServiceRuntimeHelper profilingServiceHelper(GetProfilingService(&runtime)); + ProfilingServiceRuntimeHelper profilingServiceHelper(GetProfilingService(&runtime)); profilingServiceHelper.ForceTransitionToState(ProfilingState::NotConnected); profilingServiceHelper.ForceTransitionToState(ProfilingState::WaitingForAck); profilingServiceHelper.ForceTransitionToState(ProfilingState::Active); - profiling::BufferManager& bufferManager = profilingServiceHelper.GetProfilingBufferManager(); + BufferManager& bufferManager = profilingServiceHelper.GetProfilingBufferManager(); auto readableBuffer = bufferManager.GetReadableBuffer(); // Profiling is enabled, the post-optimisation structure should be created @@ -2344,7 +2343,7 @@ TEST_CASE("CheckPeriodicCounterCaptureThread") ProfilingStateMachine profilingStateMachine; const std::unordered_map> backendProfilingContext; + std::shared_ptr> backendProfilingContext; CounterIdMap counterIdMap; Holder data; std::vector captureIds1 = { 0, 1 }; @@ -2551,7 +2550,7 @@ TEST_CASE("CheckProfilingServiceGoodConnectionAcknowledgedPacket") // Reset the profiling service to the uninitialized state ProfilingOptions options; options.m_EnableProfiling = true; - armnn::profiling::ProfilingService profilingService; + ProfilingService profilingService; profilingService.ResetExternalProfilingOptions(options, true); // Swap the profiling connection factory in the profiling service instance with our mock one @@ -2611,7 +2610,7 @@ TEST_CASE("CheckProfilingServiceGoodRequestCounterDirectoryPacket") // Reset the profiling service to the uninitialized state ProfilingOptions options; options.m_EnableProfiling = true; - armnn::profiling::ProfilingService profilingService; + ProfilingService profilingService; profilingService.ResetExternalProfilingOptions(options, true); // Swap the profiling connection factory in the profiling service instance with our mock one @@ -2669,7 +2668,7 @@ TEST_CASE("CheckProfilingServiceBadPeriodicCounterSelectionPacketInvalidCounterU // Reset the profiling service to the uninitialized state ProfilingOptions options; options.m_EnableProfiling = true; - armnn::profiling::ProfilingService profilingService; + ProfilingService profilingService; profilingService.ResetExternalProfilingOptions(options, true); // Swap the profiling connection factory in the profiling service instance with our mock one @@ -2748,7 +2747,7 @@ TEST_CASE("CheckProfilingServiceGoodPeriodicCounterSelectionPacketNoCounters") // Reset the profiling service to the uninitialized state ProfilingOptions options; options.m_EnableProfiling = true; - armnn::profiling::ProfilingService profilingService; + ProfilingService profilingService; profilingService.ResetExternalProfilingOptions(options, true); // Swap the profiling connection factory in the profiling service instance with our mock one @@ -2813,7 +2812,7 @@ TEST_CASE("CheckProfilingServiceGoodPeriodicCounterSelectionPacketSingleCounter" // Reset the profiling service to the uninitialized state ProfilingOptions options; options.m_EnableProfiling = true; - armnn::profiling::ProfilingService profilingService; + ProfilingService profilingService; profilingService.ResetExternalProfilingOptions(options, true); // Swap the profiling connection factory in the profiling service instance with our mock one @@ -2890,7 +2889,7 @@ TEST_CASE("CheckProfilingServiceGoodPeriodicCounterSelectionPacketMultipleCounte // Reset the profiling service to the uninitialized state ProfilingOptions options; options.m_EnableProfiling = true; - armnn::profiling::ProfilingService profilingService; + ProfilingService profilingService; profilingService.ResetExternalProfilingOptions(options, true); // Swap the profiling connection factory in the profiling service instance with our mock one @@ -2969,7 +2968,7 @@ TEST_CASE("CheckProfilingServiceDisconnect") // Reset the profiling service to the uninitialized state ProfilingOptions options; options.m_EnableProfiling = true; - armnn::profiling::ProfilingService profilingService; + ProfilingService profilingService; profilingService.ResetExternalProfilingOptions(options, true); // Swap the profiling connection factory in the profiling service instance with our mock one @@ -3027,7 +3026,7 @@ TEST_CASE("CheckProfilingServiceGoodPerJobCounterSelectionPacket") // Reset the profiling service to the uninitialized state ProfilingOptions options; options.m_EnableProfiling = true; - armnn::profiling::ProfilingService profilingService; + ProfilingService profilingService; profilingService.ResetExternalProfilingOptions(options, true); // Swap the profiling connection factory in the profiling service instance with our mock one @@ -3094,7 +3093,7 @@ TEST_CASE("CheckConfigureProfilingServiceOn") { ProfilingOptions options; options.m_EnableProfiling = true; - armnn::profiling::ProfilingService profilingService; + ProfilingService profilingService; CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); profilingService.ConfigureProfilingService(options); // should get as far as NOT_CONNECTED @@ -3107,7 +3106,7 @@ TEST_CASE("CheckConfigureProfilingServiceOn") TEST_CASE("CheckConfigureProfilingServiceOff") { ProfilingOptions options; - armnn::profiling::ProfilingService profilingService; + ProfilingService profilingService; CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); profilingService.ConfigureProfilingService(options); // should not move from Uninitialised @@ -3123,7 +3122,7 @@ TEST_CASE("CheckProfilingServiceEnabled") LogLevelSwapper logLevelSwapper(armnn::LogSeverity::Warning); ProfilingOptions options; options.m_EnableProfiling = true; - armnn::profiling::ProfilingService profilingService; + ProfilingService profilingService; profilingService.ResetExternalProfilingOptions(options, true); CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); profilingService.Update(); @@ -3153,7 +3152,7 @@ TEST_CASE("CheckProfilingServiceEnabledRuntime") // Locally reduce log level to "Warning", as this test needs to parse a warning message from the standard output LogLevelSwapper logLevelSwapper(armnn::LogSeverity::Warning); ProfilingOptions options; - armnn::profiling::ProfilingService profilingService; + ProfilingService profilingService; profilingService.ResetExternalProfilingOptions(options, true); CHECK(profilingService.GetCurrentState() == ProfilingState::Uninitialised); profilingService.Update(); @@ -3196,7 +3195,7 @@ TEST_CASE("CheckProfilingServiceBadConnectionAcknowledgedPacket") // Reset the profiling service to the uninitialized state ProfilingOptions options; options.m_EnableProfiling = true; - armnn::profiling::ProfilingService profilingService; + ProfilingService profilingService; profilingService.ResetExternalProfilingOptions(options, true); // Swap the profiling connection factory in the profiling service instance with our mock one @@ -3258,7 +3257,7 @@ TEST_CASE("CheckProfilingServiceBadRequestCounterDirectoryPacket") // Reset the profiling service to the uninitialized state ProfilingOptions options; options.m_EnableProfiling = true; - armnn::profiling::ProfilingService profilingService; + ProfilingService profilingService; profilingService.ResetExternalProfilingOptions(options, true); // Swap the profiling connection factory in the profiling service instance with our mock one @@ -3322,7 +3321,7 @@ TEST_CASE("CheckProfilingServiceBadPeriodicCounterSelectionPacket") // Reset the profiling service to the uninitialized state ProfilingOptions options; options.m_EnableProfiling = true; - armnn::profiling::ProfilingService profilingService; + ProfilingService profilingService; profilingService.ResetExternalProfilingOptions(options, true); // Swap the profiling connection factory in the profiling service instance with our mock one @@ -3417,7 +3416,7 @@ TEST_CASE("CheckCounterIdMap") TEST_CASE("CheckRegisterBackendCounters") { - uint16_t globalCounterIds = armnn::profiling::INFERENCES_RUN; + uint16_t globalCounterIds = INFERENCES_RUN; armnn::BackendId cpuRefId(armnn::Compute::CpuRef); // Reset the profiling service to the uninitialized state @@ -3454,7 +3453,7 @@ TEST_CASE("CheckRegisterBackendCounters") 1.f, "CounterOne", "first test counter"); - CHECK((newGlobalCounterId = armnn::profiling::INFERENCES_RUN + 1)); + CHECK((newGlobalCounterId = INFERENCES_RUN + 1)); uint16_t mappedGlobalId = profilingService.GetCounterMappings().GetGlobalId(0, cpuRefId); CHECK(mappedGlobalId == newGlobalCounterId); auto backendMapping = profilingService.GetCounterMappings().GetBackendId(newGlobalCounterId); @@ -3482,7 +3481,7 @@ TEST_CASE("CheckCounterStatusQuery") BackendProfiling backendProfilingCpuRef(options, profilingService, cpuRefId); BackendProfiling backendProfilingCpuAcc(options, profilingService, cpuAccId); - uint16_t initialNumGlobalCounterIds = armnn::profiling::INFERENCES_RUN; + uint16_t initialNumGlobalCounterIds = INFERENCES_RUN; // Create RegisterBackendCounters for CpuRef RegisterBackendCounters registerBackendCountersCpuRef(initialNumGlobalCounterIds, cpuRefId, profilingService); @@ -3617,15 +3616,15 @@ TEST_CASE("CheckRegisterCounters") mockProfilingService.RegisterMapping(7, 1, cpuRefId); mockProfilingService.RegisterMapping(8, 2, cpuRefId); - armnn::profiling::BackendProfiling backendProfiling(options, + BackendProfiling backendProfiling(options, mockProfilingService, cpuRefId); - armnn::profiling::Timestamp timestamp; + Timestamp timestamp; timestamp.timestamp = 1000998; timestamp.counterValues.emplace_back(0, 700); timestamp.counterValues.emplace_back(2, 93); - std::vector timestamps; + std::vector timestamps; timestamps.push_back(timestamp); backendProfiling.ReportCounters(timestamps); @@ -3675,7 +3674,7 @@ TEST_CASE("CheckFileFormat") { // Change file format to an unsupported value options.m_FileFormat = "json"; // Enable the profiling service - armnn::profiling::ProfilingService profilingService; + ProfilingService profilingService; profilingService.ResetExternalProfilingOptions(options, true); // Start the command handler and the send thread profilingService.Update(); diff --git a/src/profiling/test/ProfilingTests.hpp b/src/profiling/test/ProfilingTests.hpp index a8ca1b9b18..fd8ad315f1 100644 --- a/src/profiling/test/ProfilingTests.hpp +++ b/src/profiling/test/ProfilingTests.hpp @@ -21,10 +21,10 @@ #include #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { struct LogLevelSwapper @@ -79,7 +79,7 @@ public: bool WritePacket(const unsigned char* buffer, uint32_t length) override { - IgnoreUnused(buffer, length); + armnn::IgnoreUnused(buffer, length); return false; } @@ -141,7 +141,7 @@ public: arm::pipe::Packet ReadPacket(uint32_t timeout) override { - IgnoreUnused(timeout); + armnn::IgnoreUnused(timeout); ++m_ReadRequests; throw armnn::Exception("Simulate a non-timeout error"); } @@ -160,7 +160,7 @@ class TestProfilingConnectionBadAckPacket : public TestProfilingConnectionBase public: arm::pipe::Packet ReadPacket(uint32_t timeout) override { - IgnoreUnused(timeout); + armnn::IgnoreUnused(timeout); // Connection Acknowledged Packet header (word 0, word 1 is always zero): // 26:31 [6] packet_family: Control Packet Family, value 0b000000 // 16:25 [10] packet_id: Packet identifier, value 0b0000000001 @@ -183,7 +183,7 @@ public: void operator()(const arm::pipe::Packet& packet) override { - IgnoreUnused(packet); + armnn::IgnoreUnused(packet); m_Count++; } @@ -206,7 +206,7 @@ class SwapProfilingConnectionFactoryHelper : public ProfilingService public: using MockProfilingConnectionFactoryPtr = std::unique_ptr; - SwapProfilingConnectionFactoryHelper(armnn::profiling::ProfilingService& profilingService) + SwapProfilingConnectionFactoryHelper(ProfilingService& profilingService) : ProfilingService() , m_ProfilingService(profilingService) , m_MockProfilingConnectionFactory(new MockProfilingConnectionFactory()) @@ -231,7 +231,7 @@ public: MockProfilingConnection* GetMockProfilingConnection() { IProfilingConnection* profilingConnection = GetProfilingConnection(m_ProfilingService); - return PolymorphicDowncast(profilingConnection); + return armnn::PolymorphicDowncast(profilingConnection); } void ForceTransitionToState(ProfilingState newState) @@ -272,11 +272,11 @@ public: } private: - armnn::profiling::ProfilingService& m_ProfilingService; + ProfilingService& m_ProfilingService; MockProfilingConnectionFactoryPtr m_MockProfilingConnectionFactory; IProfilingConnectionFactory* m_BackupProfilingConnectionFactory; }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/test/RequestCountersPacketHandler.cpp b/src/profiling/test/RequestCountersPacketHandler.cpp index 3ba50503a1..fb3eee8f20 100644 --- a/src/profiling/test/RequestCountersPacketHandler.cpp +++ b/src/profiling/test/RequestCountersPacketHandler.cpp @@ -12,10 +12,10 @@ #include #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { std::vector RequestCountersPacketHandler::GetHeadersAccepted() @@ -75,6 +75,6 @@ void RequestCountersPacketHandler::SendCounterSelectionPacket() m_Connection->ReturnPacket(packet); } -} // namespace profiling +} // namespace pipe -} // namespace armnn \ No newline at end of file +} // namespace arm \ No newline at end of file diff --git a/src/profiling/test/RequestCountersPacketHandler.hpp b/src/profiling/test/RequestCountersPacketHandler.hpp index 82bd313b85..7068a4f253 100644 --- a/src/profiling/test/RequestCountersPacketHandler.hpp +++ b/src/profiling/test/RequestCountersPacketHandler.hpp @@ -11,10 +11,10 @@ #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class RequestCountersPacketHandler : public ILocalPacketHandler @@ -43,6 +43,6 @@ private: void SendCounterSelectionPacket(); }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/test/SendCounterPacketTests.cpp b/src/profiling/test/SendCounterPacketTests.cpp index 675d083644..1380b42d37 100644 --- a/src/profiling/test/SendCounterPacketTests.cpp +++ b/src/profiling/test/SendCounterPacketTests.cpp @@ -26,7 +26,7 @@ #include -using namespace armnn::profiling; +using namespace arm::pipe; namespace { @@ -294,7 +294,7 @@ TEST_CASE("SendStreamMetaDataPacketTest") // Error no space left in buffer MockBufferManager mockBuffer1(10); SendCounterPacket sendPacket1(mockBuffer1); - CHECK_THROWS_AS(sendPacket1.SendStreamMetaDataPacket(), armnn::profiling::BufferExhaustion); + CHECK_THROWS_AS(sendPacket1.SendStreamMetaDataPacket(), BufferExhaustion); // Full metadata packet @@ -1180,7 +1180,7 @@ TEST_CASE("SendCounterDirectoryPacketTest1") MockBufferManager mockBuffer(10); SendCounterPacket sendCounterPacket(mockBuffer); CHECK_THROWS_AS(sendCounterPacket.SendCounterDirectoryPacket(counterDirectory), - armnn::profiling::BufferExhaustion); + BufferExhaustion); } TEST_CASE("SendCounterDirectoryPacketTest2") @@ -1228,49 +1228,49 @@ TEST_CASE("SendCounterDirectoryPacketTest2") // Register a counter associated to "category1" const Counter* counter1 = nullptr; CHECK_NOTHROW(counter1 = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, - 0, - category1Name, - 0, - 1, - 123.45f, - "counter1", - "counter1description", - std::string("counter1units"), - numberOfCores)); + 0, + category1Name, + 0, + 1, + 123.45f, + "counter1", + "counter1description", + std::string("counter1units"), + numberOfCores)); CHECK(counterDirectory.GetCounterCount() == 4); CHECK(counter1); // Register a counter associated to "category1" const Counter* counter2 = nullptr; CHECK_NOTHROW(counter2 = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, - 4, - category1Name, - 1, - 0, - 330.1245656765f, - "counter2", - "counter2description", - std::string("counter2units"), - armnn::EmptyOptional(), - device2->m_Uid, - 0)); + 4, + category1Name, + 1, + 0, + 330.1245656765f, + "counter2", + "counter2description", + std::string("counter2units"), + armnn::EmptyOptional(), + device2->m_Uid, + 0)); CHECK(counterDirectory.GetCounterCount() == 5); CHECK(counter2); // Register a counter associated to "category2" const Counter* counter3 = nullptr; CHECK_NOTHROW(counter3 = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, - 5, - category2Name, - 1, - 1, - 0.0000045399f, - "counter3", - "counter3description", - armnn::EmptyOptional(), - numberOfCores, - device2->m_Uid, - counterSet1->m_Uid)); + 5, + category2Name, + 1, + 1, + 0.0000045399f, + "counter3", + "counter3description", + armnn::EmptyOptional(), + numberOfCores, + device2->m_Uid, + counterSet1->m_Uid)); CHECK(counterDirectory.GetCounterCount() == 9); CHECK(counter3); @@ -1773,17 +1773,17 @@ TEST_CASE("SendCounterDirectoryPacketTest7") // Register an invalid counter associated to a valid category const Counter* counter = nullptr; CHECK_NOTHROW(counter = counterDirectory.RegisterCounter(armnn::profiling::BACKEND_ID, - 0, - categoryName, - 0, - 1, - 123.45f, - "counter", - "counter description", - std::string("invalid counter units"), - 5, - device->m_Uid, - counterSet->m_Uid)); + 0, + categoryName, + 0, + 1, + 123.45f, + "counter", + "counter description", + std::string("invalid counter units"), + 5, + device->m_Uid, + counterSet->m_Uid)); CHECK(counterDirectory.GetCounterCount() == 5); CHECK(counter); diff --git a/src/profiling/test/SendCounterPacketTests.hpp b/src/profiling/test/SendCounterPacketTests.hpp index 2eac395ecf..4dec67d335 100644 --- a/src/profiling/test/SendCounterPacketTests.hpp +++ b/src/profiling/test/SendCounterPacketTests.hpp @@ -22,10 +22,10 @@ #include #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class SendCounterPacketTest : public SendCounterPacket @@ -65,6 +65,6 @@ public: } }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/src/profiling/test/SendTimelinePacketTests.cpp b/src/profiling/test/SendTimelinePacketTests.cpp index a2076b87c5..4e32149e44 100644 --- a/src/profiling/test/SendTimelinePacketTests.cpp +++ b/src/profiling/test/SendTimelinePacketTests.cpp @@ -21,7 +21,7 @@ #include #include -using namespace armnn::profiling; +using namespace arm::pipe; TEST_SUITE("SendTimelinePacketTests") { @@ -421,7 +421,7 @@ TEST_CASE("SendTimelinePacketTests3") const uint64_t eventClassBinaryPacketNameGuid = 8845u; CHECK_THROWS_AS(sendTimelinePacket->SendTimelineEventClassBinaryPacket( eventClassBinaryPacketProfilingGuid, eventClassBinaryPacketNameGuid), - armnn::profiling::BufferExhaustion); + BufferExhaustion); } TEST_CASE("GetGuidsFromProfilingService") @@ -429,7 +429,7 @@ TEST_CASE("GetGuidsFromProfilingService") armnn::IRuntime::CreationOptions options; options.m_ProfilingOptions.m_EnableProfiling = true; armnn::RuntimeImpl runtime(options); - armnn::profiling::ProfilingService profilingService(runtime); + ProfilingService profilingService(runtime); profilingService.ResetExternalProfilingOptions( ConvertExternalProfilingOptions(options.m_ProfilingOptions), true); @@ -450,7 +450,7 @@ TEST_CASE("GetTimelinePackerWriterFromProfilingService") { ProfilingOptions options; options.m_EnableProfiling = true; - armnn::profiling::ProfilingService profilingService; + ProfilingService profilingService; profilingService.ResetExternalProfilingOptions(options, true); std::unique_ptr writer = profilingService.GetSendTimelinePacket(); diff --git a/src/profiling/test/TestTimelinePacketHandler.cpp b/src/profiling/test/TestTimelinePacketHandler.cpp index a2b5286728..d38c1751cb 100644 --- a/src/profiling/test/TestTimelinePacketHandler.cpp +++ b/src/profiling/test/TestTimelinePacketHandler.cpp @@ -11,10 +11,10 @@ #include #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { std::vector TestTimelinePacketHandler::GetHeadersAccepted() @@ -125,7 +125,7 @@ arm::pipe::ITimelineDecoder::TimelineStatus TimelineMessageDecoder::CreateRelati m_TimelineModel.IsInferenceGuid(relationship.m_HeadGuid)) { ProfilingStaticGuid attributeGuid(relationship.m_AttributeGuid); - if (attributeGuid == armnn::profiling::LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS) + if (attributeGuid == LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS) { if (m_PacketHandler != nullptr) { @@ -136,6 +136,6 @@ arm::pipe::ITimelineDecoder::TimelineStatus TimelineMessageDecoder::CreateRelati return arm::pipe::ITimelineDecoder::TimelineStatus::TimelineStatus_Success; } -} // namespace profiling +} // namespace pipe -} // namespace armnn \ No newline at end of file +} // namespace arm \ No newline at end of file diff --git a/src/profiling/test/TestTimelinePacketHandler.hpp b/src/profiling/test/TestTimelinePacketHandler.hpp index ab6eee5121..7166707e80 100644 --- a/src/profiling/test/TestTimelinePacketHandler.hpp +++ b/src/profiling/test/TestTimelinePacketHandler.hpp @@ -20,10 +20,10 @@ #include #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { // forward declaration of class @@ -87,6 +87,6 @@ private: arm::pipe::TimelineDirectoryCaptureCommandHandler m_DirectoryDecoder; }; -} // namespace profiling +} // namespace pipe -} // namespace armnn \ No newline at end of file +} // namespace arm \ No newline at end of file diff --git a/src/profiling/test/TimelineModel.cpp b/src/profiling/test/TimelineModel.cpp index a80ad11e24..24ced44942 100644 --- a/src/profiling/test/TimelineModel.cpp +++ b/src/profiling/test/TimelineModel.cpp @@ -9,10 +9,10 @@ #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { void TimelineModel::AddLabel(const arm::pipe::ITimelineDecoder::Label& label) @@ -58,20 +58,20 @@ void TimelineModel::AddRelationship(const arm::pipe::ITimelineDecoder::Relations { HandleLabelLink(relationship); } - else if (relationship.m_RelationshipType == arm::pipe::ITimelineDecoder::RelationshipType::RetentionLink) + else if (relationship.m_RelationshipType == ITimelineDecoder::RelationshipType::RetentionLink) { // Take care of the special case of a connection between layers in ArmNN // modelled by a retention link between two layer entities with an attribute GUID // of connection - if (relationship.m_AttributeGuid == armnn::profiling::LabelsAndEventClasses::CONNECTION_GUID) + if (relationship.m_AttributeGuid == LabelsAndEventClasses::CONNECTION_GUID) { HandleConnection(relationship); } - else if (relationship.m_AttributeGuid == armnn::profiling::LabelsAndEventClasses::CHILD_GUID) + else if (relationship.m_AttributeGuid == LabelsAndEventClasses::CHILD_GUID) { HandleChild(relationship); } - else if (relationship.m_AttributeGuid == armnn::profiling::LabelsAndEventClasses::EXECUTION_OF_GUID) + else if (relationship.m_AttributeGuid == LabelsAndEventClasses::EXECUTION_OF_GUID) { HandleExecutionOf(relationship); } @@ -128,8 +128,8 @@ void TimelineModel::HandleLabelLink(const arm::pipe::ITimelineDecoder::Relations entity->AddAttribute(*attribute, *value); // if the attribute is 'type' and the value is 'inference' // we need to cache the entity guid as an inference - if (armnn::profiling::LabelsAndEventClasses::TYPE_LABEL.compare(*attribute) == 0 && - armnn::profiling::LabelsAndEventClasses::INFERENCE.compare(*value) == 0) + if (LabelsAndEventClasses::TYPE_LABEL.compare(*attribute) == 0 && + LabelsAndEventClasses::INFERENCE.compare(*value) == 0) { m_InferenceGuids.push_back(relationship.m_HeadGuid); } @@ -360,7 +360,7 @@ std::string GetEntityDescription(const Entity& entity) ss << "Entity [" << entity.GetGuid() << "]"; for (auto& attributeEntry : entity.GetAttributes()) { - if (profiling::LabelsAndEventClasses::PROCESS_ID_LABEL == attributeEntry.second.first) + if (LabelsAndEventClasses::PROCESS_ID_LABEL == attributeEntry.second.first) { ss << " " << attributeEntry.second.first << " = [processId]"; } @@ -400,6 +400,6 @@ std::string GetEventDescription(EventObj* event) return ss.str(); } -} // namespace profiling +} // namespace pipe -} // namespace armnn \ No newline at end of file +} // namespace arm \ No newline at end of file diff --git a/src/profiling/test/TimelineModel.hpp b/src/profiling/test/TimelineModel.hpp index ccbec7b01d..7628f8c042 100644 --- a/src/profiling/test/TimelineModel.hpp +++ b/src/profiling/test/TimelineModel.hpp @@ -12,10 +12,10 @@ #include #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { using LabelMap = std::map; using Attribute = std::pair; @@ -184,6 +184,6 @@ std::string GetConnectionDescription(const Connection& connection); std::string GetExecutionDescription(Entity* execution); std::string GetEventDescription(EventObj* event); -} // namespace profiling +} // namespace pipe -} // namespace armnn \ No newline at end of file +} // namespace arm \ No newline at end of file diff --git a/src/profiling/test/TimelinePacketTests.cpp b/src/profiling/test/TimelinePacketTests.cpp index 379988a9dc..de791c1da0 100644 --- a/src/profiling/test/TimelinePacketTests.cpp +++ b/src/profiling/test/TimelinePacketTests.cpp @@ -12,7 +12,7 @@ #include -using namespace armnn::profiling; +using namespace arm::pipe; TEST_SUITE("TimelinePacketTests") { @@ -204,7 +204,7 @@ TEST_CASE("TimelineRelationshipPacketInvalidRelationTest") buffer.data(), armnn::numeric_cast(buffer.size()), numberOfBytesWritten), - armnn::InvalidArgumentException); + arm::pipe::InvalidArgumentException); CHECK(numberOfBytesWritten == 0); } @@ -527,7 +527,7 @@ TEST_CASE("TimelineMessageDirectoryPacketTestFullConstruction") // Check the ui_name std::vector swTraceString; - arm::pipe::StringToSwTraceString(label, swTraceString); + StringToSwTraceString(label, swTraceString); offset += (armnn::numeric_cast(swTraceString.size()) - 1) * uint32_t_size; uint32_t swTraceUINameLength = ReadUint32(buffer.data(), offset); CHECK(swTraceUINameLength == 14); // ui_name length including the null-terminator @@ -539,7 +539,7 @@ TEST_CASE("TimelineMessageDirectoryPacketTestFullConstruction") swTraceUINameLength - 1) == 0); // The length of the label // Check arg_types - arm::pipe::StringToSwTraceString(label, swTraceString); + StringToSwTraceString(label, swTraceString); offset += (armnn::numeric_cast(swTraceString.size()) - 1) * uint32_t_size; uint32_t swTraceArgTypesLength = ReadUint32(buffer.data(), offset); CHECK(swTraceArgTypesLength == 3); // arg_types length including the null-terminator @@ -551,7 +551,7 @@ TEST_CASE("TimelineMessageDirectoryPacketTestFullConstruction") swTraceArgTypesLength - 1) == 0); // The length of the label // Check arg_names - arm::pipe::StringToSwTraceString(label, swTraceString); + StringToSwTraceString(label, swTraceString); offset += (armnn::numeric_cast(swTraceString.size()) - 1) * uint32_t_size; uint32_t swTraceArgNamesLength = ReadUint32(buffer.data(), offset); CHECK(swTraceArgNamesLength == 11); // arg_names length including the null-terminator @@ -563,7 +563,7 @@ TEST_CASE("TimelineMessageDirectoryPacketTestFullConstruction") swTraceArgNamesLength - 1) == 0); // The length of the label // Check second message decl_id - arm::pipe::StringToSwTraceString(label, swTraceString); + StringToSwTraceString(label, swTraceString); offset += (armnn::numeric_cast(swTraceString.size()) - 1) * uint32_t_size; readDeclId = ReadUint32(buffer.data(), offset); CHECK(readDeclId == 1); diff --git a/src/profiling/test/TimelineUtilityMethodsTests.cpp b/src/profiling/test/TimelineUtilityMethodsTests.cpp index 47e1182a3d..b0b7bff517 100644 --- a/src/profiling/test/TimelineUtilityMethodsTests.cpp +++ b/src/profiling/test/TimelineUtilityMethodsTests.cpp @@ -17,7 +17,7 @@ #include using namespace armnn; -using namespace armnn::profiling; +using namespace arm::pipe; TEST_SUITE("TimelineUtilityMethodsTests") { @@ -214,20 +214,20 @@ TEST_CASE("CreateNamedTypedChildEntityTest") profilingService.NextGuid(); CHECK_THROWS_AS(timelineUtilityMethods.CreateNamedTypedChildEntity(parentEntityGuid, "", entityType), - InvalidArgumentException); + arm::pipe::InvalidArgumentException); CHECK_THROWS_AS(timelineUtilityMethods.CreateNamedTypedChildEntity(parentEntityGuid, entityName, ""), - InvalidArgumentException); + arm::pipe::InvalidArgumentException); CHECK_THROWS_AS(timelineUtilityMethods.CreateNamedTypedChildEntity( - childEntityGuid, parentEntityGuid, "", entityType), InvalidArgumentException); + childEntityGuid, parentEntityGuid, "", entityType), arm::pipe::InvalidArgumentException); CHECK_THROWS_AS(timelineUtilityMethods.CreateNamedTypedChildEntity( - childEntityGuid, parentEntityGuid, entityName, ""), InvalidArgumentException); + childEntityGuid, parentEntityGuid, entityName, ""), arm::pipe::InvalidArgumentException); CHECK_NOTHROW(childEntityGuid = timelineUtilityMethods.CreateNamedTypedChildEntity(parentEntityGuid, entityName, entityType)); CHECK(childEntityGuid != ProfilingGuid(0)); - // Commit all packets at once + // Commit all packets at onceTimelineUtilityMethodsTests.cpp timelineUtilityMethods.Commit(); // Get the readable buffer @@ -296,7 +296,7 @@ TEST_CASE("DeclareLabelTest") profilingService.NextGuid(); // Try declaring an invalid (empty) label - CHECK_THROWS_AS(timelineUtilityMethods.DeclareLabel(""), InvalidArgumentException); + CHECK_THROWS_AS(timelineUtilityMethods.DeclareLabel(""), arm::pipe::InvalidArgumentException); // Try declaring an invalid (wrong SWTrace format) label CHECK_THROWS_AS(timelineUtilityMethods.DeclareLabel("inv@lid lab€l"), RuntimeException); @@ -322,20 +322,20 @@ TEST_CASE("CreateNameTypeEntityInvalidTest") TimelineUtilityMethods timelineUtilityMethods(sendTimelinePacket); // Invalid name - CHECK_THROWS_AS(timelineUtilityMethods.CreateNamedTypedEntity("", "Type"), InvalidArgumentException); + CHECK_THROWS_AS(timelineUtilityMethods.CreateNamedTypedEntity("", "Type"), arm::pipe::InvalidArgumentException); // Invalid type - CHECK_THROWS_AS(timelineUtilityMethods.CreateNamedTypedEntity("Name", ""), InvalidArgumentException); + CHECK_THROWS_AS(timelineUtilityMethods.CreateNamedTypedEntity("Name", ""), arm::pipe::InvalidArgumentException); ProfilingDynamicGuid guid = profilingService.NextGuid(); // CreatedNamedTypedEntity with Guid - Invalid name CHECK_THROWS_AS(timelineUtilityMethods.CreateNamedTypedEntity(guid, "", "Type"), - InvalidArgumentException); + arm::pipe::InvalidArgumentException); // CreatedNamedTypedEntity with Guid - Invalid type CHECK_THROWS_AS(timelineUtilityMethods.CreateNamedTypedEntity(guid, "Name", ""), - InvalidArgumentException); + arm::pipe::InvalidArgumentException); } -- cgit v1.2.1