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/profiling/common/include/IProfilingGuidGenerator.hpp b/profiling/common/include/IProfilingGuidGenerator.hpp
index 34ee967..2fdffc4 100644
--- a/profiling/common/include/IProfilingGuidGenerator.hpp
+++ b/profiling/common/include/IProfilingGuidGenerator.hpp
@@ -9,10 +9,10 @@
 
 #include <string>
 
-namespace armnn
+namespace arm
 {
 
-namespace profiling
+namespace pipe
 {
 
 class IProfilingGuidGenerator
@@ -27,6 +27,6 @@
     virtual ~IProfilingGuidGenerator() {}
 };
 
-} // namespace profiling
+} // namespace pipe
 
-} // namespace armnn
+} // namespace arm
diff --git a/profiling/common/include/LabelsAndEventClasses.hpp b/profiling/common/include/LabelsAndEventClasses.hpp
index 8e3e0b0..0c43524 100644
--- a/profiling/common/include/LabelsAndEventClasses.hpp
+++ b/profiling/common/include/LabelsAndEventClasses.hpp
@@ -9,10 +9,10 @@
 
 #include "DllExport.hpp"
 
-namespace armnn
+namespace arm
 {
 
-namespace profiling
+namespace pipe
 {
 
 class LabelsAndEventClasses
@@ -64,6 +64,6 @@
     static ProfilingGuidGenerator m_GuidGenerator;
 };
 
-} // namespace profiling
+} // namespace pipe
 
-} // namespace armnn
+} // namespace arm
diff --git a/profiling/common/include/ProfilingGuid.hpp b/profiling/common/include/ProfilingGuid.hpp
index 4d0dd9b..fef1798 100644
--- a/profiling/common/include/ProfilingGuid.hpp
+++ b/profiling/common/include/ProfilingGuid.hpp
@@ -8,10 +8,10 @@
 #include <memory>
 #include <stdint.h>
 
-namespace armnn
+namespace arm
 {
 
-namespace profiling
+namespace pipe
 {
 
 static constexpr uint64_t MIN_STATIC_GUID = 1llu << 63;
@@ -70,11 +70,9 @@
     using ProfilingGuid::ProfilingGuid;
 };
 
-} // namespace profiling
+} // namespace pipe
 
-
-
-} // namespace armnn
+} // namespace arm
 
 
 
@@ -82,9 +80,9 @@
 {
 /// make ProfilingGuid hashable
 template <>
-struct hash<armnn::profiling::ProfilingGuid>
+struct hash<arm::pipe::ProfilingGuid>
 {
-    std::size_t operator()(armnn::profiling::ProfilingGuid const& guid) const noexcept
+    std::size_t operator()(arm::pipe::ProfilingGuid const& guid) const noexcept
     {
         return hash<uint64_t>()(uint64_t(guid));
     }
@@ -92,9 +90,9 @@
 
 /// make ProfilingDynamicGuid hashable
 template <>
-struct hash<armnn::profiling::ProfilingDynamicGuid>
+struct hash<arm::pipe::ProfilingDynamicGuid>
 {
-    std::size_t operator()(armnn::profiling::ProfilingDynamicGuid const& guid) const noexcept
+    std::size_t operator()(arm::pipe::ProfilingDynamicGuid const& guid) const noexcept
     {
         return hash<uint64_t>()(uint64_t(guid));
     }
@@ -102,9 +100,9 @@
 
 /// make ProfilingStaticGuid hashable
 template <>
-struct hash<armnn::profiling::ProfilingStaticGuid>
+struct hash<arm::pipe::ProfilingStaticGuid>
 {
-    std::size_t operator()(armnn::profiling::ProfilingStaticGuid const& guid) const noexcept
+    std::size_t operator()(arm::pipe::ProfilingStaticGuid const& guid) const noexcept
     {
         return hash<uint64_t>()(uint64_t(guid));
     }
diff --git a/profiling/common/include/ProfilingGuidGenerator.hpp b/profiling/common/include/ProfilingGuidGenerator.hpp
index 2b7302b..bfee764 100644
--- a/profiling/common/include/ProfilingGuidGenerator.hpp
+++ b/profiling/common/include/ProfilingGuidGenerator.hpp
@@ -11,10 +11,10 @@
 #include <functional>
 #include <mutex>
 
-namespace armnn
+namespace arm
 {
 
-namespace profiling
+namespace pipe
 {
 
 class ProfilingGuidGenerator : public IProfilingGuidGenerator
@@ -57,6 +57,6 @@
     std::mutex m_SequenceMutex;
 };
 
-} // namespace profiling
+} // namespace pipe
 
-} // namespace armnn
+} // namespace arm
diff --git a/profiling/common/include/TargetEndianess.hpp b/profiling/common/include/TargetEndianess.hpp
new file mode 100644
index 0000000..8ee8db1
--- /dev/null
+++ b/profiling/common/include/TargetEndianess.hpp
@@ -0,0 +1,12 @@
+//
+// Copyright © 2022 Arm Ltd and Contributors. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+
+#pragma once
+
+enum class TargetEndianness
+{
+    BeWire,
+    LeWire
+};
\ No newline at end of file
diff --git a/profiling/common/src/LabelsAndEventClasses.cpp b/profiling/common/src/LabelsAndEventClasses.cpp
index fe6d119..b476ddd 100644
--- a/profiling/common/src/LabelsAndEventClasses.cpp
+++ b/profiling/common/src/LabelsAndEventClasses.cpp
@@ -5,10 +5,10 @@
 
 #include "LabelsAndEventClasses.hpp"
 
-namespace armnn
+namespace arm
 {
 
-namespace profiling
+namespace pipe
 {
 
 ProfilingGuidGenerator LabelsAndEventClasses::m_GuidGenerator;
@@ -74,6 +74,6 @@
 ProfilingStaticGuid LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS(
     m_GuidGenerator.GenerateStaticId("ARMNN_PROFILING_EOL"));
 
-} // namespace profiling
+} // namespace pipe
 
-} // namespace armnn
+} // namespace arm
diff --git a/profiling/server/include/basePipeServer/BasePipeServer.hpp b/profiling/server/include/basePipeServer/BasePipeServer.hpp
index 1b6dec5..c763542 100644
--- a/profiling/server/include/basePipeServer/BasePipeServer.hpp
+++ b/profiling/server/include/basePipeServer/BasePipeServer.hpp
@@ -8,6 +8,7 @@
 #include <common/include/NetworkSockets.hpp>
 #include <common/include/Packet.hpp>
 #include <common/include/SocketConnectionException.hpp>
+#include <common/include/TargetEndianess.hpp>
 
 #include <string>
 #include <atomic>
@@ -18,12 +19,6 @@
 namespace pipe
 {
 
-enum class TargetEndianness
-{
-    BeWire,
-    LeWire
-};
-
 enum class PacketDirection
 {
     Sending,
diff --git a/profiling/server/src/basePipeServer/tests/BasePipeServerTests.cpp b/profiling/server/src/basePipeServer/tests/BasePipeServerTests.cpp
index f307d98..03de769 100644
--- a/profiling/server/src/basePipeServer/tests/BasePipeServerTests.cpp
+++ b/profiling/server/src/basePipeServer/tests/BasePipeServerTests.cpp
@@ -25,21 +25,21 @@
 
     // The socket should close once we leave the scope of CHECK_NOTHROW
     // and socketProfilingConnection should fail to connect
-    CHECK_THROWS_AS(profiling::SocketProfilingConnection socketProfilingConnection,
+    CHECK_THROWS_AS(arm::pipe::SocketProfilingConnection socketProfilingConnection,
                       arm::pipe::SocketConnectionException);
 
     // Try to initialize a listening socket through the ConnectionHandler again
     ConnectionHandler connectionHandler(udsNamespace, true);
     // socketProfilingConnection should connect now
-    profiling::SocketProfilingConnection socketProfilingConnection;
+    arm::pipe::SocketProfilingConnection socketProfilingConnection;
     CHECK(socketProfilingConnection.IsOpen());
 
     auto basePipeServer = connectionHandler.GetNewBasePipeServer(false);
     // GetNewBasePipeServer will return null if it fails to create a socket
     CHECK(basePipeServer.get());
 
-    profiling::BufferManager bufferManager;
-    profiling::SendCounterPacket sendCounterPacket(bufferManager);
+    arm::pipe::BufferManager bufferManager;
+    arm::pipe::SendCounterPacket sendCounterPacket(bufferManager);
 
     // Check that we can receive a StreamMetaDataPacket
     sendCounterPacket.SendStreamMetaDataPacket();
diff --git a/profiling/server/src/timelineDecoder/tests/TimelineTests.cpp b/profiling/server/src/timelineDecoder/tests/TimelineTests.cpp
index 82c16fe..15c5c7e 100644
--- a/profiling/server/src/timelineDecoder/tests/TimelineTests.cpp
+++ b/profiling/server/src/timelineDecoder/tests/TimelineTests.cpp
@@ -74,10 +74,10 @@
     uint32_t uint32_t_size = sizeof(uint32_t);
     uint32_t uint64_t_size = sizeof(uint64_t);
 
-    armnn::profiling::BufferManager bufferManager(5);
-    armnn::profiling::TimelinePacketWriterFactory timelinePacketWriterFactory(bufferManager);
+    arm::pipe::BufferManager bufferManager(5);
+    arm::pipe::TimelinePacketWriterFactory timelinePacketWriterFactory(bufferManager);
 
-    std::unique_ptr<armnn::profiling::ISendTimelinePacket> sendTimelinePacket =
+    std::unique_ptr<arm::pipe::ISendTimelinePacket> sendTimelinePacket =
             timelinePacketWriterFactory.GetSendTimelinePacket();
 
     arm::pipe::PacketVersionResolver packetVersionResolver;
@@ -97,7 +97,7 @@
 
     unsigned int offset = uint32_t_size * 2;
 
-    std::unique_ptr<armnn::profiling::IPacketBuffer> packetBuffer = bufferManager.GetReadableBuffer();
+    std::unique_ptr<arm::pipe::IPacketBuffer> packetBuffer = bufferManager.GetReadableBuffer();
 
     uint8_t readStreamVersion = ReadUint8(packetBuffer, offset);
     CHECK(readStreamVersion == 4);
@@ -106,7 +106,7 @@
     CHECK(readPointerBytes == uint64_t_size);
     offset += uint8_t_size;
     uint8_t readThreadIdBytes = ReadUint8(packetBuffer, offset);
-    CHECK(readThreadIdBytes == armnn::profiling::ThreadIdSize);
+    CHECK(readThreadIdBytes == arm::pipe::ThreadIdSize);
     offset += uint8_t_size;
 
     uint32_t declarationSize = arm::pipe::ReadUint32(packetBuffer->GetReadableData(), offset);
@@ -145,10 +145,10 @@
 
 TEST_CASE("TimelineCaptureTest")
 {
-    armnn::profiling::BufferManager bufferManager(50);
-    armnn::profiling::TimelinePacketWriterFactory timelinePacketWriterFactory(bufferManager);
+    arm::pipe::BufferManager bufferManager(50);
+    arm::pipe::TimelinePacketWriterFactory timelinePacketWriterFactory(bufferManager);
 
-    std::unique_ptr<armnn::profiling::ISendTimelinePacket> sendTimelinePacket =
+    std::unique_ptr<arm::pipe::ISendTimelinePacket> sendTimelinePacket =
         timelinePacketWriterFactory.GetSendTimelinePacket();
 
     arm::pipe::PacketVersionResolver packetVersionResolver;
@@ -157,7 +157,7 @@
 
     arm::pipe::TimelineCaptureCommandHandler timelineCaptureCommandHandler(
         1, 1, packetVersionResolver.ResolvePacketVersion(1, 1).GetEncodedValue(), timelineDecoder,
-        armnn::profiling::ThreadIdSize);
+        arm::pipe::ThreadIdSize);
 
     using Status = arm::pipe::ITimelineDecoder::TimelineStatus;
     CHECK(timelineDecoder.SetEntityCallback(PushEntity)             == Status::TimelineStatus_Success);
@@ -175,16 +175,16 @@
     const int threadId = armnnUtils::Threads::GetCurrentThreadId();
 
     // need to do a bit of work here to extract the value from threadId
-    unsigned char* uCharThreadId = new unsigned char[armnn::profiling::ThreadIdSize]();;
+    unsigned char* uCharThreadId = new unsigned char[arm::pipe::ThreadIdSize]();;
     uint64_t uint64ThreadId;
 
-    arm::pipe::WriteBytes(uCharThreadId, 0, &threadId, armnn::profiling::ThreadIdSize);
+    arm::pipe::WriteBytes(uCharThreadId, 0, &threadId, arm::pipe::ThreadIdSize);
 
-    if (armnn::profiling::ThreadIdSize == 4)
+    if (arm::pipe::ThreadIdSize == 4)
     {
         uint64ThreadId =  arm::pipe::ReadUint32(uCharThreadId, 0);
     }
-    else if (armnn::profiling::ThreadIdSize == 8)
+    else if (arm::pipe::ThreadIdSize == 8)
     {
         uint64ThreadId =  arm::pipe::ReadUint64(uCharThreadId, 0);
     }
@@ -224,8 +224,8 @@
                                            timelineCaptureCommandHandler);
 
         // Send relationship
-        armnn::profiling::ProfilingRelationshipType relationshipType =
-            armnn::profiling::ProfilingRelationshipType::DataLink;
+        arm::pipe::ProfilingRelationshipType relationshipType =
+            arm::pipe::ProfilingRelationshipType::DataLink;
         sendTimelinePacket->SendTimelineRelationshipBinaryPacket(relationshipType,
                                                                  relationshipGuid,
                                                                  headGuid,
@@ -261,10 +261,10 @@
 
 TEST_CASE("TimelineCaptureTestMultipleStringsInBuffer")
 {
-    armnn::profiling::BufferManager               bufferManager(50);
-    armnn::profiling::TimelinePacketWriterFactory timelinePacketWriterFactory(bufferManager);
+    arm::pipe::BufferManager               bufferManager(50);
+    arm::pipe::TimelinePacketWriterFactory timelinePacketWriterFactory(bufferManager);
 
-    std::unique_ptr<armnn::profiling::ISendTimelinePacket> sendTimelinePacket =
+    std::unique_ptr<arm::pipe::ISendTimelinePacket> sendTimelinePacket =
                                                         timelinePacketWriterFactory.GetSendTimelinePacket();
 
     arm::pipe::PacketVersionResolver packetVersionResolver;
@@ -273,7 +273,7 @@
 
     arm::pipe::TimelineCaptureCommandHandler timelineCaptureCommandHandler(
         1, 1, packetVersionResolver.ResolvePacketVersion(1, 1).GetEncodedValue(), timelineDecoder,
-        armnn::profiling::ThreadIdSize);
+        arm::pipe::ThreadIdSize);
 
     using Status = arm::pipe::TimelineDecoder::TimelineStatus;
     CHECK(timelineDecoder.SetEntityCallback(PushEntity) == Status::TimelineStatus_Success);
@@ -291,16 +291,16 @@
     const int threadId = armnnUtils::Threads::GetCurrentThreadId();
 
     // need to do a bit of work here to extract the value from threadId
-    unsigned char* uCharThreadId = new unsigned char[armnn::profiling::ThreadIdSize]();
+    unsigned char* uCharThreadId = new unsigned char[arm::pipe::ThreadIdSize]();
     uint64_t uint64ThreadId;
 
-    arm::pipe::WriteBytes(uCharThreadId, 0, &threadId, armnn::profiling::ThreadIdSize);
+    arm::pipe::WriteBytes(uCharThreadId, 0, &threadId, arm::pipe::ThreadIdSize);
 
-    if ( armnn::profiling::ThreadIdSize == 4 )
+    if ( arm::pipe::ThreadIdSize == 4 )
     {
         uint64ThreadId = arm::pipe::ReadUint32(uCharThreadId, 0);
-    } 
-    else if ( armnn::profiling::ThreadIdSize == 8 )
+    }
+    else if ( arm::pipe::ThreadIdSize == 8 )
     {
         uint64ThreadId = arm::pipe::ReadUint64(uCharThreadId, 0);
     }
@@ -329,8 +329,8 @@
         sendTimelinePacket->SendTimelineLabelBinaryPacket(labelGuid, labelName2);
         sendTimelinePacket->SendTimelineLabelBinaryPacket(labelGuid, labelName3);
         // Send relationship
-        armnn::profiling::ProfilingRelationshipType relationshipType =
-            armnn::profiling::ProfilingRelationshipType::DataLink;
+        arm::pipe::ProfilingRelationshipType relationshipType =
+            arm::pipe::ProfilingRelationshipType::DataLink;
         sendTimelinePacket->SendTimelineRelationshipBinaryPacket(relationshipType,
                                                                  relationshipGuid,
                                                                  headGuid,