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 --- include/armnn/BackendId.hpp | 5 ++--- include/armnn/BackendRegistry.hpp | 18 ++++++++++------ include/armnn/INetwork.hpp | 2 +- include/armnn/IProfiler.hpp | 6 +++--- include/armnn/IRuntime.hpp | 2 +- include/armnn/Types.hpp | 18 +++++++++++----- include/armnn/Version.hpp | 2 +- include/armnn/backends/IBackendInternal.hpp | 4 ++-- include/armnn/backends/IWorkload.hpp | 2 +- include/armnn/backends/Workload.hpp | 6 +++--- .../armnn/backends/profiling/IBackendProfiling.hpp | 22 +++++++++++--------- .../profiling/IBackendProfilingContext.hpp | 11 +++++----- include/armnn/profiling/ILocalPacketHandler.hpp | 24 ++++++---------------- include/armnn/profiling/ISendTimelinePacket.hpp | 8 ++++---- include/armnn/profiling/ProfilingOptions.hpp | 14 +++---------- 15 files changed, 70 insertions(+), 74 deletions(-) (limited to 'include/armnn') diff --git a/include/armnn/BackendId.hpp b/include/armnn/BackendId.hpp index 5849dea8fb..45e2ca8d86 100644 --- a/include/armnn/BackendId.hpp +++ b/include/armnn/BackendId.hpp @@ -169,8 +169,8 @@ namespace armnn namespace profiling { - // Static constant describing ArmNN as a dummy backend - static const BackendId BACKEND_ID("ARMNN"); +// Static constant describing ArmNN as a dummy backend +static const BackendId BACKEND_ID("ARMNN"); } // profiling inline std::ostream& operator<<(std::ostream& os, const BackendId& id) @@ -193,4 +193,3 @@ using BackendIdVector = std::vector; using BackendIdSet = std::unordered_set; } // namespace armnn - diff --git a/include/armnn/BackendRegistry.hpp b/include/armnn/BackendRegistry.hpp index 0d09607de2..08e164c549 100644 --- a/include/armnn/BackendRegistry.hpp +++ b/include/armnn/BackendRegistry.hpp @@ -15,13 +15,19 @@ #include #include -namespace armnn +namespace arm +{ +namespace pipe { -namespace profiling +class ProfilingService; + +} // namespace arm +} // namespace pipe + +namespace armnn { - class ProfilingService; -} + class IBackendInternal; using IBackendInternalUniquePtr = std::unique_ptr; using MemoryOptimizerStrategiesMapRef = std::unordered_map>; @@ -38,7 +44,7 @@ public: size_t Size() const; BackendIdSet GetBackendIds() const; std::string GetBackendIdsAsString() const; - void SetProfilingService(armnn::Optional profilingService); + void SetProfilingService(armnn::Optional profilingService); void RegisterAllocator(const BackendId& id, std::shared_ptr alloc); std::unordered_map> GetAllocators(); void RegisterMemoryOptimizerStrategy(const BackendId& id, std::shared_ptr strategy); @@ -72,7 +78,7 @@ private: BackendRegistry& operator=(const BackendRegistry&) = delete; FactoryStorage m_Factories; - armnn::Optional m_ProfilingService; + armnn::Optional m_ProfilingService; std::unordered_map> m_CustomMemoryAllocatorMap; std::unordered_map> m_MemoryOptimizerStrategyMap; }; diff --git a/include/armnn/INetwork.hpp b/include/armnn/INetwork.hpp index 173e8d548a..d962fe715b 100644 --- a/include/armnn/INetwork.hpp +++ b/include/armnn/INetwork.hpp @@ -783,7 +783,7 @@ public: Status PrintGraph(); Status SerializeToDot(std::ostream& stream) const; - profiling::ProfilingGuid GetGuid() const; + arm::pipe::ProfilingGuid GetGuid() const; size_t GetNumInputs() const; size_t GetNumOutputs() const; diff --git a/include/armnn/IProfiler.hpp b/include/armnn/IProfiler.hpp index 1b450d0151..209777671b 100644 --- a/include/armnn/IProfiler.hpp +++ b/include/armnn/IProfiler.hpp @@ -54,12 +54,12 @@ private: void AddLayerDetails(const std::string& name, const DescriptorType& desc, const WorkloadInfo& infos, - const profiling::ProfilingGuid guid); + const arm::pipe::ProfilingGuid guid); Event* BeginEvent(const BackendId& backendId, const std::string& label, std::vector&& instruments, - const Optional& guid); + const Optional& guid); std::unique_ptr pProfilerImpl; @@ -69,7 +69,7 @@ private: friend inline void ProfilingUpdateDescriptions(const std::string& name, const DescriptorType& desc, const WorkloadInfo& infos, - const profiling::ProfilingGuid guid); + const arm::pipe::ProfilingGuid guid); // Friend functions for unit testing, see ProfilerTests.cpp. friend size_t GetProfilerEventSequenceSize(armnn::IProfiler* profiler); diff --git a/include/armnn/IRuntime.hpp b/include/armnn/IRuntime.hpp index 042271fc2b..debb2d6896 100644 --- a/include/armnn/IRuntime.hpp +++ b/include/armnn/IRuntime.hpp @@ -146,7 +146,7 @@ public: uint32_t m_CapturePeriod; /// The format of the file used for outputting profiling data. std::string m_FileFormat; - std::vector m_LocalPacketHandlers; + std::vector m_LocalPacketHandlers; }; ExternalProfilingOptions m_ProfilingOptions; diff --git a/include/armnn/Types.hpp b/include/armnn/Types.hpp index 880a6dd816..a804f55468 100644 --- a/include/armnn/Types.hpp +++ b/include/armnn/Types.hpp @@ -12,6 +12,19 @@ #include "Exceptions.hpp" #include "Deprecated.hpp" +namespace arm +{ +namespace pipe +{ + +class ProfilingGuid; + +} // namespace armn +} // namespace pipe + +/// Define LayerGuid type. +using LayerGuid = arm::pipe::ProfilingGuid; + namespace armnn { @@ -357,11 +370,6 @@ private: SizeType m_NumDimMappings; }; -namespace profiling { class ProfilingGuid; } - -/// Define LayerGuid type. -using LayerGuid = profiling::ProfilingGuid; - class ITensorHandle; /// Define the type of callback for the Debug layer to call diff --git a/include/armnn/Version.hpp b/include/armnn/Version.hpp index 7e172246e3..d41c4ec8af 100644 --- a/include/armnn/Version.hpp +++ b/include/armnn/Version.hpp @@ -10,7 +10,7 @@ #define STRINGIFY_MACRO(s) #s // ArmNN version components -#define ARMNN_MAJOR_VERSION 28 +#define ARMNN_MAJOR_VERSION 29 #define ARMNN_MINOR_VERSION 0 #define ARMNN_PATCH_VERSION 0 diff --git a/include/armnn/backends/IBackendInternal.hpp b/include/armnn/backends/IBackendInternal.hpp index c64150a484..06fa5edde8 100644 --- a/include/armnn/backends/IBackendInternal.hpp +++ b/include/armnn/backends/IBackendInternal.hpp @@ -86,8 +86,8 @@ public: using IWorkloadFactoryPtr = std::unique_ptr; using IBackendContextPtr = std::unique_ptr; /// This is the bridge between backend and backend profiling we'll keep it in the backend namespace. - using IBackendProfilingContextPtr = std::shared_ptr; - using IBackendProfilingPtr = std::unique_ptr; + using IBackendProfilingContextPtr = std::shared_ptr; + using IBackendProfilingPtr = std::unique_ptr; using ILayerSupportSharedPtr = std::shared_ptr; using IBackendSpecificModelContextPtr = std::shared_ptr; diff --git a/include/armnn/backends/IWorkload.hpp b/include/armnn/backends/IWorkload.hpp index ce3914bc5a..20be01658e 100644 --- a/include/armnn/backends/IWorkload.hpp +++ b/include/armnn/backends/IWorkload.hpp @@ -29,7 +29,7 @@ public: virtual void ExecuteAsync(WorkingMemDescriptor& desc) = 0; - virtual profiling::ProfilingGuid GetGuid() const = 0; + virtual arm::pipe::ProfilingGuid GetGuid() const = 0; // SupportsTensorHandleReplacement signals that a given workload is capable of // replacing any of its I/O tensors via ReplaceInput/OutputTensorHandle diff --git a/include/armnn/backends/Workload.hpp b/include/armnn/backends/Workload.hpp index 21109480dc..ddcc5a8f0a 100644 --- a/include/armnn/backends/Workload.hpp +++ b/include/armnn/backends/Workload.hpp @@ -32,7 +32,7 @@ public: BaseWorkload(const QueueDescriptor& descriptor, const WorkloadInfo& info) : m_Data(descriptor), - m_Guid(profiling::ProfilingService::GetNextGuid()) + m_Guid(arm::pipe::ProfilingService::GetNextGuid()) { m_Data.Validate(info); } @@ -52,7 +52,7 @@ public: const QueueDescriptor& GetData() const { return m_Data; } - profiling::ProfilingGuid GetGuid() const final { return m_Guid; } + arm::pipe::ProfilingGuid GetGuid() const final { return m_Guid; } virtual bool SupportsTensorHandleReplacement() const override { @@ -75,7 +75,7 @@ public: protected: QueueDescriptor m_Data; - const profiling::ProfilingGuid m_Guid; + const arm::pipe::ProfilingGuid m_Guid; private: std::mutex m_AsyncWorkloadMutex; diff --git a/include/armnn/backends/profiling/IBackendProfiling.hpp b/include/armnn/backends/profiling/IBackendProfiling.hpp index beb7755741..a04f3c1b99 100644 --- a/include/armnn/backends/profiling/IBackendProfiling.hpp +++ b/include/armnn/backends/profiling/IBackendProfiling.hpp @@ -12,10 +12,10 @@ #include #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { struct CounterValue @@ -55,11 +55,13 @@ public: virtual uint16_t RegisterDevice(const std::string& deviceName, uint16_t cores = 0, - const Optional& parentCategoryName = EmptyOptional()) = 0; + const armnn::Optional& parentCategoryName + = armnn::EmptyOptional()) = 0; virtual uint16_t RegisterCounterSet(const std::string& counterSetName, uint16_t count = 0, - const Optional& parentCategoryName = EmptyOptional()) = 0; + const armnn::Optional& parentCategoryName + = armnn::EmptyOptional()) = 0; virtual uint16_t RegisterCounter(const uint16_t uid, const std::string& parentCategoryName, @@ -68,10 +70,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()) = 0; + const armnn::Optional& units = armnn::EmptyOptional(), + const armnn::Optional& numberOfCores = armnn::EmptyOptional(), + const armnn::Optional& deviceUid = armnn::EmptyOptional(), + const armnn::Optional& counterSetUid = armnn::EmptyOptional()) = 0; virtual ~IRegisterBackendCounters() {} }; @@ -99,6 +101,6 @@ public: }; -} // namespace profiling +} // namespace pipe -} // namespace armnn \ No newline at end of file +} // namespace arm \ No newline at end of file diff --git a/include/armnn/backends/profiling/IBackendProfilingContext.hpp b/include/armnn/backends/profiling/IBackendProfilingContext.hpp index 77959e959b..2e3df48227 100644 --- a/include/armnn/backends/profiling/IBackendProfilingContext.hpp +++ b/include/armnn/backends/profiling/IBackendProfilingContext.hpp @@ -8,9 +8,9 @@ #include #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { class IBackendProfilingContext @@ -19,12 +19,13 @@ public: virtual ~IBackendProfilingContext() {} virtual uint16_t RegisterCounters(uint16_t currentMaxGlobalCounterID) = 0; - virtual Optional ActivateCounters(uint32_t capturePeriod, const std::vector& counterIds) = 0; + virtual armnn::Optional ActivateCounters(uint32_t capturePeriod, const std::vector& + counterIds) = 0; virtual std::vector ReportCounterValues() = 0; virtual bool EnableProfiling(bool flag) = 0; virtual bool EnableTimelineReporting(bool flag) = 0; }; using IBackendProfilingContextUniquePtr = std::unique_ptr; -} // namespace profiling -} // namespace armnn \ No newline at end of file +} // namespace pipe +} // namespace arm \ No newline at end of file diff --git a/include/armnn/profiling/ILocalPacketHandler.hpp b/include/armnn/profiling/ILocalPacketHandler.hpp index af1b0f88b8..bf7bdbc5c4 100644 --- a/include/armnn/profiling/ILocalPacketHandler.hpp +++ b/include/armnn/profiling/ILocalPacketHandler.hpp @@ -7,6 +7,7 @@ #include +#include "../../../profiling/common/include/TargetEndianess.hpp" #include #include @@ -16,22 +17,9 @@ namespace arm { namespace pipe -{ - class Packet; -} // namespace pipe -} // namespace arm - -namespace armnn -{ - -namespace profiling { -enum class TargetEndianness -{ - BeWire, - LeWire -}; +class Packet; // the handlers need to be able to do two // things to service the FileOnlyProfilingConnection @@ -45,7 +33,7 @@ public: virtual void SetEndianess(const TargetEndianness& endianness) = 0; - virtual void ReturnPacket(arm::pipe::Packet& packet) = 0; + virtual void ReturnPacket(Packet& packet) = 0; virtual void Close() = 0; }; @@ -62,7 +50,7 @@ public: virtual std::vector GetHeadersAccepted() = 0; /// process the packet - virtual void HandlePacket(const arm::pipe::Packet& packet) = 0; + virtual void HandlePacket(const Packet& packet) = 0; /// Set a profiling connection on the handler. Only need to implement this /// function if the handler will be writing data back to the profiled application. @@ -73,6 +61,6 @@ public: using ILocalPacketHandlerPtr = std::unique_ptr; using ILocalPacketHandlerSharedPtr = std::shared_ptr; -} // namespace profiling +} // namespace pipe -} // namespace armnn \ No newline at end of file +} // namespace arm \ No newline at end of file diff --git a/include/armnn/profiling/ISendTimelinePacket.hpp b/include/armnn/profiling/ISendTimelinePacket.hpp index c5da5219f7..4785e04ef8 100644 --- a/include/armnn/profiling/ISendTimelinePacket.hpp +++ b/include/armnn/profiling/ISendTimelinePacket.hpp @@ -9,10 +9,10 @@ #include #include -namespace armnn +namespace arm { -namespace profiling +namespace pipe { enum class ProfilingRelationshipType @@ -56,6 +56,6 @@ public: uint64_t attributeGuid) = 0; }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm diff --git a/include/armnn/profiling/ProfilingOptions.hpp b/include/armnn/profiling/ProfilingOptions.hpp index 50cd50e5c3..6b4472ca63 100644 --- a/include/armnn/profiling/ProfilingOptions.hpp +++ b/include/armnn/profiling/ProfilingOptions.hpp @@ -16,14 +16,6 @@ namespace pipe { /// The lowest performance data capture interval we support is 10 miliseconds. constexpr unsigned int LOWEST_CAPTURE_PERIOD = 10000u; -} // namespace pipe -} // namespace arm - -namespace armnn -{ - -namespace profiling -{ struct ProfilingOptions { ProfilingOptions() @@ -45,9 +37,9 @@ struct ProfilingOptions { uint32_t m_CapturePeriod; /// The format of the file used for outputting profiling data. std::string m_FileFormat; - std::vector m_LocalPacketHandlers; + std::vector m_LocalPacketHandlers; }; -} // namespace profiling +} // namespace pipe -} // namespace armnn +} // namespace arm -- cgit v1.2.1