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 <cathal.corbett@arm.com>
Change-Id: I9c50007dcd5b5e792757e7bd1213606df5ffec36
diff --git a/include/armnn/BackendId.hpp b/include/armnn/BackendId.hpp
index 5849dea..45e2ca8 100644
--- a/include/armnn/BackendId.hpp
+++ b/include/armnn/BackendId.hpp
@@ -169,8 +169,8 @@
 
 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 BackendIdSet    = std::unordered_set<BackendId>;
 
 } // namespace armnn
-
diff --git a/include/armnn/BackendRegistry.hpp b/include/armnn/BackendRegistry.hpp
index 0d09607..08e164c 100644
--- a/include/armnn/BackendRegistry.hpp
+++ b/include/armnn/BackendRegistry.hpp
@@ -15,13 +15,19 @@
 #include <unordered_map>
 #include <functional>
 
+namespace arm
+{
+namespace pipe
+{
+
+class ProfilingService;
+
+} // namespace arm
+} // namespace pipe
+
 namespace armnn
 {
 
-namespace profiling
-{
-    class ProfilingService;
-}
 class IBackendInternal;
 using IBackendInternalUniquePtr = std::unique_ptr<IBackendInternal>;
 using MemoryOptimizerStrategiesMapRef = std::unordered_map<BackendId, std::shared_ptr<IMemoryOptimizerStrategy>>;
@@ -38,7 +44,7 @@
     size_t Size() const;
     BackendIdSet GetBackendIds() const;
     std::string GetBackendIdsAsString() const;
-    void SetProfilingService(armnn::Optional<profiling::ProfilingService&> profilingService);
+    void SetProfilingService(armnn::Optional<arm::pipe::ProfilingService&> profilingService);
     void RegisterAllocator(const BackendId& id, std::shared_ptr<ICustomAllocator> alloc);
     std::unordered_map<BackendId, std::shared_ptr<ICustomAllocator>> GetAllocators();
     void RegisterMemoryOptimizerStrategy(const BackendId& id, std::shared_ptr<IMemoryOptimizerStrategy> strategy);
@@ -72,7 +78,7 @@
     BackendRegistry& operator=(const BackendRegistry&) = delete;
 
     FactoryStorage m_Factories;
-    armnn::Optional<profiling::ProfilingService&> m_ProfilingService;
+    armnn::Optional<arm::pipe::ProfilingService&> m_ProfilingService;
     std::unordered_map<BackendId, std::shared_ptr<ICustomAllocator>> m_CustomMemoryAllocatorMap;
     std::unordered_map<BackendId, std::shared_ptr<IMemoryOptimizerStrategy>> m_MemoryOptimizerStrategyMap;
 };
diff --git a/include/armnn/INetwork.hpp b/include/armnn/INetwork.hpp
index 173e8d5..d962fe7 100644
--- a/include/armnn/INetwork.hpp
+++ b/include/armnn/INetwork.hpp
@@ -783,7 +783,7 @@
     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 1b450d0..2097776 100644
--- a/include/armnn/IProfiler.hpp
+++ b/include/armnn/IProfiler.hpp
@@ -54,12 +54,12 @@
     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<InstrumentPtr>&& instruments,
-                      const Optional<profiling::ProfilingGuid>& guid);
+                      const Optional<arm::pipe::ProfilingGuid>& guid);
 
     std::unique_ptr<ProfilerImpl> pProfilerImpl;
 
@@ -69,7 +69,7 @@
     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 042271f..debb2d6 100644
--- a/include/armnn/IRuntime.hpp
+++ b/include/armnn/IRuntime.hpp
@@ -146,7 +146,7 @@
             uint32_t    m_CapturePeriod;
             /// The format of the file used for outputting profiling data.
             std::string m_FileFormat;
-            std::vector<armnn::profiling::ILocalPacketHandlerSharedPtr> m_LocalPacketHandlers;
+            std::vector<arm::pipe::ILocalPacketHandlerSharedPtr> m_LocalPacketHandlers;
         };
         ExternalProfilingOptions m_ProfilingOptions;
 
diff --git a/include/armnn/Types.hpp b/include/armnn/Types.hpp
index 880a6dd..a804f55 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 @@
     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 7e17224..d41c4ec 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 c64150a..06fa5ed 100644
--- a/include/armnn/backends/IBackendInternal.hpp
+++ b/include/armnn/backends/IBackendInternal.hpp
@@ -86,8 +86,8 @@
     using IWorkloadFactoryPtr = std::unique_ptr<IWorkloadFactory>;
     using IBackendContextPtr = std::unique_ptr<IBackendContext>;
     /// This is the bridge between backend and backend profiling we'll keep it in the backend namespace.
-    using IBackendProfilingContextPtr = std::shared_ptr<armnn::profiling::IBackendProfilingContext>;
-    using IBackendProfilingPtr = std::unique_ptr<armnn::profiling::IBackendProfiling>;
+    using IBackendProfilingContextPtr = std::shared_ptr<arm::pipe::IBackendProfilingContext>;
+    using IBackendProfilingPtr = std::unique_ptr<arm::pipe::IBackendProfiling>;
     using ILayerSupportSharedPtr = std::shared_ptr<ILayerSupport>;
 
     using IBackendSpecificModelContextPtr = std::shared_ptr<IBackendModelContext>;
diff --git a/include/armnn/backends/IWorkload.hpp b/include/armnn/backends/IWorkload.hpp
index ce3914b..20be016 100644
--- a/include/armnn/backends/IWorkload.hpp
+++ b/include/armnn/backends/IWorkload.hpp
@@ -29,7 +29,7 @@
 
     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 2110948..ddcc5a8 100644
--- a/include/armnn/backends/Workload.hpp
+++ b/include/armnn/backends/Workload.hpp
@@ -32,7 +32,7 @@
 
     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 @@
 
     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 @@
 
 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 beb7755..a04f3c1 100644
--- a/include/armnn/backends/profiling/IBackendProfiling.hpp
+++ b/include/armnn/backends/profiling/IBackendProfiling.hpp
@@ -12,10 +12,10 @@
 #include <memory>
 #include <vector>
 
-namespace armnn
+namespace arm
 {
 
-namespace profiling
+namespace pipe
 {
 
 struct CounterValue
@@ -55,11 +55,13 @@
 
     virtual uint16_t RegisterDevice(const std::string& deviceName,
                                     uint16_t cores = 0,
-                                    const Optional<std::string>& parentCategoryName = EmptyOptional()) = 0;
+                                    const armnn::Optional<std::string>& parentCategoryName
+                                        = armnn::EmptyOptional()) = 0;
 
     virtual uint16_t RegisterCounterSet(const std::string& counterSetName,
                                         uint16_t count = 0,
-                                        const Optional<std::string>& parentCategoryName = EmptyOptional()) = 0;
+                                        const armnn::Optional<std::string>& parentCategoryName
+                                            = armnn::EmptyOptional()) = 0;
 
     virtual uint16_t RegisterCounter(const uint16_t uid,
                                      const std::string& parentCategoryName,
@@ -68,10 +70,10 @@
                                      double multiplier,
                                      const std::string& name,
                                      const std::string& description,
-                                     const Optional<std::string>& units      = EmptyOptional(),
-                                     const Optional<uint16_t>& numberOfCores = EmptyOptional(),
-                                     const Optional<uint16_t>& deviceUid     = EmptyOptional(),
-                                     const Optional<uint16_t>& counterSetUid = EmptyOptional()) = 0;
+                                     const armnn::Optional<std::string>& units      = armnn::EmptyOptional(),
+                                     const armnn::Optional<uint16_t>& numberOfCores = armnn::EmptyOptional(),
+                                     const armnn::Optional<uint16_t>& deviceUid     = armnn::EmptyOptional(),
+                                     const armnn::Optional<uint16_t>& counterSetUid = armnn::EmptyOptional()) = 0;
 
     virtual ~IRegisterBackendCounters() {}
 };
@@ -99,6 +101,6 @@
 
 };
 
-}    // 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 77959e9..2e3df48 100644
--- a/include/armnn/backends/profiling/IBackendProfilingContext.hpp
+++ b/include/armnn/backends/profiling/IBackendProfilingContext.hpp
@@ -8,9 +8,9 @@
 #include <armnn/IRuntime.hpp>
 #include <vector>
 
-namespace armnn
+namespace arm
 {
-namespace profiling
+namespace pipe
 {
 
 class IBackendProfilingContext
@@ -19,12 +19,13 @@
     virtual ~IBackendProfilingContext()
     {}
     virtual uint16_t RegisterCounters(uint16_t currentMaxGlobalCounterID) = 0;
-    virtual Optional<std::string> ActivateCounters(uint32_t capturePeriod, const std::vector<uint16_t>& counterIds) = 0;
+    virtual armnn::Optional<std::string> ActivateCounters(uint32_t capturePeriod, const std::vector<uint16_t>&
+        counterIds) = 0;
     virtual std::vector<Timestamp> ReportCounterValues() = 0;
     virtual bool EnableProfiling(bool flag) = 0;
     virtual bool EnableTimelineReporting(bool flag) = 0;
 };
 
 using IBackendProfilingContextUniquePtr = std::unique_ptr<IBackendProfilingContext>;
-}    // 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 af1b0f8..bf7bdbc 100644
--- a/include/armnn/profiling/ILocalPacketHandler.hpp
+++ b/include/armnn/profiling/ILocalPacketHandler.hpp
@@ -7,6 +7,7 @@
 
 
 #include <armnn/utility/IgnoreUnused.hpp>
+#include "../../../profiling/common/include/TargetEndianess.hpp"
 
 #include <cstdint>
 #include <memory>
@@ -17,21 +18,8 @@
 {
 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 @@
 
     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 @@
     virtual std::vector<uint32_t> 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 @@
 using ILocalPacketHandlerPtr = std::unique_ptr<ILocalPacketHandler>;
 using ILocalPacketHandlerSharedPtr = std::shared_ptr<ILocalPacketHandler>;
 
-} // 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 c5da521..4785e04 100644
--- a/include/armnn/profiling/ISendTimelinePacket.hpp
+++ b/include/armnn/profiling/ISendTimelinePacket.hpp
@@ -9,10 +9,10 @@
 #include <string>
 #include <vector>
 
-namespace armnn
+namespace arm
 {
 
-namespace profiling
+namespace pipe
 {
 
 enum class ProfilingRelationshipType
@@ -56,6 +56,6 @@
                                                       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 50cd50e..6b4472c 100644
--- a/include/armnn/profiling/ProfilingOptions.hpp
+++ b/include/armnn/profiling/ProfilingOptions.hpp
@@ -16,14 +16,6 @@
 {
 /// 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 @@
     uint32_t m_CapturePeriod;
     /// The format of the file used for outputting profiling data.
     std::string m_FileFormat;
-    std::vector <armnn::profiling::ILocalPacketHandlerSharedPtr> m_LocalPacketHandlers;
+    std::vector <ILocalPacketHandlerSharedPtr> m_LocalPacketHandlers;
 };
 
-} // namespace profiling
+} // namespace pipe
 
-} // namespace armnn
+} // namespace arm