IVGCVSW-6847 replace armnn:Optional with arm::pipe::Optional in profiling code

Change-Id: I048c538d4f8c21770aec2b2751c934d9fa15a4dc
Signed-off-by: Jim Flynn <jim.flynn@arm.com>
diff --git a/include/armnn/backends/profiling/IBackendProfiling.hpp b/include/armnn/backends/profiling/IBackendProfiling.hpp
index 564bd61..9affab2 100644
--- a/include/armnn/backends/profiling/IBackendProfiling.hpp
+++ b/include/armnn/backends/profiling/IBackendProfiling.hpp
@@ -4,11 +4,10 @@
 //
 #pragma once
 
-#include <armnn/Optional.hpp>
-
 #include <armnn/profiling/ISendTimelinePacket.hpp>
 
 #include <common/include/IProfilingGuidGenerator.hpp>
+#include <common/include/Optional.hpp>
 
 #include <memory>
 #include <vector>
@@ -56,25 +55,25 @@
 
     virtual uint16_t RegisterDevice(const std::string& deviceName,
                                     uint16_t cores = 0,
-                                    const armnn::Optional<std::string>& parentCategoryName
-                                        = armnn::EmptyOptional()) = 0;
+                                    const arm::pipe::Optional<std::string>& parentCategoryName
+                                        = arm::pipe::EmptyOptional()) = 0;
 
     virtual uint16_t RegisterCounterSet(const std::string& counterSetName,
                                         uint16_t count = 0,
-                                        const armnn::Optional<std::string>& parentCategoryName
-                                            = armnn::EmptyOptional()) = 0;
+                                        const arm::pipe::Optional<std::string>& parentCategoryName
+                                            = arm::pipe::EmptyOptional()) = 0;
 
     virtual uint16_t RegisterCounter(const uint16_t uid,
-                                     const std::string& parentCategoryName,
-                                     uint16_t counterClass,
-                                     uint16_t interpolation,
-                                     double multiplier,
-                                     const std::string& name,
-                                     const std::string& description,
-                                     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;
+        const std::string& parentCategoryName,
+        uint16_t counterClass,
+        uint16_t interpolation,
+        double multiplier,
+        const std::string& name,
+        const std::string& description,
+        const arm::pipe::Optional<std::string>& units      = arm::pipe::EmptyOptional(),
+        const arm::pipe::Optional<uint16_t>& numberOfCores = arm::pipe::EmptyOptional(),
+        const arm::pipe::Optional<uint16_t>& deviceUid     = arm::pipe::EmptyOptional(),
+        const arm::pipe::Optional<uint16_t>& counterSetUid = arm::pipe::EmptyOptional()) = 0;
 
     virtual ~IRegisterBackendCounters() {}
 };
diff --git a/include/armnn/backends/profiling/IBackendProfilingContext.hpp b/include/armnn/backends/profiling/IBackendProfilingContext.hpp
index 0b0b0fa..a1ed05e 100644
--- a/include/armnn/backends/profiling/IBackendProfilingContext.hpp
+++ b/include/armnn/backends/profiling/IBackendProfilingContext.hpp
@@ -18,8 +18,8 @@
     virtual ~IBackendProfilingContext()
     {}
     virtual uint16_t RegisterCounters(uint16_t currentMaxGlobalCounterID) = 0;
-    virtual armnn::Optional<std::string> ActivateCounters(uint32_t capturePeriod, const std::vector<uint16_t>&
-        counterIds) = 0;
+    virtual arm::pipe::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;
diff --git a/include/armnnTestUtils/MockBackend.hpp b/include/armnnTestUtils/MockBackend.hpp
index 425062a..266c049 100644
--- a/include/armnnTestUtils/MockBackend.hpp
+++ b/include/armnnTestUtils/MockBackend.hpp
@@ -162,7 +162,7 @@
         return nextMaxGlobalCounterId;
     }
 
-    Optional<std::string> ActivateCounters(uint32_t capturePeriod, const std::vector<uint16_t>& counterIds)
+    arm::pipe::Optional<std::string> ActivateCounters(uint32_t capturePeriod, const std::vector<uint16_t>& counterIds)
     {
         if (capturePeriod == 0 || counterIds.size() == 0)
         {
@@ -170,11 +170,11 @@
         }
         else if (capturePeriod == 15939u)
         {
-            return armnn::Optional<std::string>("ActivateCounters example test error");
+            return arm::pipe::Optional<std::string>("ActivateCounters example test error");
         }
         m_CapturePeriod  = capturePeriod;
         m_ActiveCounters = counterIds;
-        return armnn::Optional<std::string>();
+        return arm::pipe::Optional<std::string>();
     }
 
     std::vector<arm::pipe::Timestamp> ReportCounterValues()
diff --git a/profiling/common/include/Optional.hpp b/profiling/common/include/Optional.hpp
new file mode 100644
index 0000000..e2d6c67
--- /dev/null
+++ b/profiling/common/include/Optional.hpp
@@ -0,0 +1,314 @@
+//
+// Copyright © 2022 Arm Ltd. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+#pragma once
+
+#include "ProfilingException.hpp"
+
+#include <cstring>
+#include <type_traits>
+
+/// Optional is a drop in replacement for std::optional until we migrate
+/// to c++-17. Only a subset of the optional features are implemented that
+/// we intend to use in ArmNN.
+
+/// There are two distinct implementations here:
+///
+///   1, for normal constructable/destructable types and reference types
+///   2, for reference types
+
+/// The std::optional features we support are:
+///
+/// - has_value() and operator bool() to tell if the optional has a value
+/// - value() returns a reference to the held object
+///
+
+namespace arm
+{
+
+namespace pipe
+{
+
+/// EmptyOptional is used to initialize the Optional class in case we want
+/// to have default value for an Optional in a function declaration.
+struct EmptyOptional {};
+
+/// Disambiguation tag that can be passed to the constructor to indicate that
+/// the contained object should be constructed in-place
+struct ConstructInPlace
+{
+    explicit ConstructInPlace() = default;
+};
+
+#define ARM_PIPE_CONSTRUCT_IN_PLACE arm::pipe::ConstructInPlace{}
+
+/// OptionalBase is the common functionality between reference and non-reference
+/// optional types.
+class OptionalBase
+{
+public:
+    OptionalBase() noexcept
+        : m_HasValue{false}
+    {
+    }
+
+    bool has_value() const noexcept
+    {
+        return m_HasValue;
+    }
+
+    /// Conversion to bool, so can be used in if-statements and similar contexts expecting a bool.
+    /// Note this is explicit so that it doesn't get implicitly converted to a bool in unwanted cases,
+    /// for example "Optional<TypeA> == Optional<TypeB>" should not compile.
+    explicit operator bool() const noexcept
+    {
+        return has_value();
+    }
+
+protected:
+    OptionalBase(bool hasValue) noexcept
+        : m_HasValue{hasValue}
+    {
+    }
+
+    bool m_HasValue;
+};
+
+///
+/// The default implementation is the non-reference case. This
+/// has an unsigned char array for storing the optional value which
+/// is in-place constructed there.
+///
+template <bool IsReference, typename T>
+class OptionalReferenceSwitch : public OptionalBase
+{
+public:
+    using Base = OptionalBase;
+
+    OptionalReferenceSwitch() noexcept : Base{} {}
+    OptionalReferenceSwitch(EmptyOptional) noexcept : Base{} {}
+
+    OptionalReferenceSwitch(const T& value)
+        : Base{}
+    {
+        Construct(value);
+    }
+
+    template<class... Args>
+    OptionalReferenceSwitch(ConstructInPlace, Args&&... args)
+        : Base{}
+    {
+        Construct(ARM_PIPE_CONSTRUCT_IN_PLACE, std::forward<Args>(args)...);
+    }
+
+    OptionalReferenceSwitch(const OptionalReferenceSwitch& other)
+        : Base{}
+    {
+        *this = other;
+    }
+
+    OptionalReferenceSwitch& operator=(const T& value)
+    {
+        reset();
+        Construct(value);
+        return *this;
+    }
+
+    OptionalReferenceSwitch& operator=(const OptionalReferenceSwitch& other)
+    {
+        reset();
+        if (other.has_value())
+        {
+            Construct(other.value());
+        }
+
+        return *this;
+    }
+
+    OptionalReferenceSwitch& operator=(EmptyOptional)
+    {
+        reset();
+        return *this;
+    }
+
+    ~OptionalReferenceSwitch()
+    {
+        reset();
+    }
+
+    void reset()
+    {
+        if (Base::has_value())
+        {
+            value().T::~T();
+            Base::m_HasValue = false;
+        }
+    }
+
+    const T& value() const
+    {
+        if (!Base::has_value())
+        {
+            throw BadOptionalAccessException("Optional has no value");
+        }
+
+        auto valuePtr = reinterpret_cast<const T*>(m_Storage);
+        return *valuePtr;
+    }
+
+    T& value()
+    {
+        if (!Base::has_value())
+        {
+            throw BadOptionalAccessException("Optional has no value");
+        }
+
+        auto valuePtr = reinterpret_cast<T*>(m_Storage);
+        return *valuePtr;
+    }
+
+private:
+    void Construct(const T& value)
+    {
+        new (m_Storage) T(value);
+        m_HasValue = true;
+    }
+
+    template<class... Args>
+    void Construct(ConstructInPlace, Args&&... args)
+    {
+        new (m_Storage) T(std::forward<Args>(args)...);
+        m_HasValue = true;
+    }
+
+    alignas(alignof(T)) unsigned char m_Storage[sizeof(T)];
+};
+
+///
+/// This is the special case for reference types. This holds a pointer
+/// to the referenced type. This doesn't own the referenced memory and
+/// it never calls delete on the pointer.
+///
+template <typename T>
+class OptionalReferenceSwitch<true, T> : public OptionalBase
+{
+public:
+    using Base = OptionalBase;
+    using NonRefT = typename std::remove_reference<T>::type;
+
+    OptionalReferenceSwitch() noexcept : Base{}, m_Storage{nullptr} {}
+    OptionalReferenceSwitch(EmptyOptional) noexcept : Base{}, m_Storage{nullptr} {}
+
+    OptionalReferenceSwitch(const OptionalReferenceSwitch& other) : Base{}
+    {
+        *this = other;
+    }
+
+    OptionalReferenceSwitch(T value)
+        : Base{true}
+        , m_Storage{&value}
+    {
+    }
+
+    template<class... Args>
+    OptionalReferenceSwitch(ConstructInPlace, Args&&... args) = delete;
+
+    OptionalReferenceSwitch& operator=(const T value)
+    {
+        m_Storage = &value;
+        Base::m_HasValue = true;
+        return *this;
+    }
+
+    OptionalReferenceSwitch& operator=(const OptionalReferenceSwitch& other)
+    {
+        m_Storage = other.m_Storage;
+        Base::m_HasValue = other.has_value();
+        return *this;
+    }
+
+    OptionalReferenceSwitch& operator=(EmptyOptional)
+    {
+        reset();
+        return *this;
+    }
+
+    ~OptionalReferenceSwitch()
+    {
+        reset();
+    }
+
+    void reset()
+    {
+        Base::m_HasValue = false;
+        m_Storage = nullptr;
+    }
+
+    const T value() const
+    {
+        if (!Base::has_value())
+        {
+            throw BadOptionalAccessException("Optional has no value");
+        }
+
+        return *m_Storage;
+    }
+
+    T value()
+    {
+        if (!Base::has_value())
+        {
+            throw BadOptionalAccessException("Optional has no value");
+        }
+
+        return *m_Storage;
+    }
+
+private:
+    NonRefT* m_Storage;
+};
+
+template <typename T>
+class Optional final : public OptionalReferenceSwitch<std::is_reference<T>::value, T>
+{
+public:
+    using BaseSwitch = OptionalReferenceSwitch<std::is_reference<T>::value, T>;
+
+    Optional() noexcept : BaseSwitch{} {}
+    Optional(const T& value) : BaseSwitch{value} {}
+    Optional& operator=(const Optional& other) = default;
+    Optional(EmptyOptional empty) : BaseSwitch{empty} {}
+    Optional(const Optional& other) : BaseSwitch{other} {}
+    Optional(const BaseSwitch& other) : BaseSwitch{other} {}
+
+    template<class... Args>
+    explicit Optional(ConstructInPlace, Args&&... args) :
+        BaseSwitch(ARM_PIPE_CONSTRUCT_IN_PLACE, std::forward<Args>(args)...) {}
+
+    /// Two optionals are considered equal if they are both empty or both contain values which
+    /// themselves are considered equal (via their own == operator).
+    bool operator==(const Optional<T>& rhs) const
+    {
+        if (!this->has_value() && !rhs.has_value())
+        {
+            return true;
+        }
+        if (this->has_value() && rhs.has_value() && this->value() == rhs.value())
+        {
+            return true;
+        }
+        return false;
+    }
+};
+
+/// Utility template that constructs an object of type T in-place and wraps
+/// it inside an Optional<T> object
+template<typename T, class... Args>
+Optional<T> MakeOptional(Args&&... args)
+{
+    return Optional<T>(ARM_PIPE_CONSTRUCT_IN_PLACE, std::forward<Args>(args)...);
+}
+
+} // namespace pipe
+} // namespace arm
diff --git a/profiling/common/include/ProfilingException.hpp b/profiling/common/include/ProfilingException.hpp
index 82b724a..1357988 100644
--- a/profiling/common/include/ProfilingException.hpp
+++ b/profiling/common/include/ProfilingException.hpp
@@ -70,6 +70,11 @@
     using ProfilingException::ProfilingException;
 };
 
+class BadOptionalAccessException : public ProfilingException
+{
+    using ProfilingException::ProfilingException;
+};
+
 class BufferExhaustion : public ProfilingException
 {
 public:
diff --git a/src/armnn/test/RuntimeTests.cpp b/src/armnn/test/RuntimeTests.cpp
index fc16dbb..fcfcc48 100644
--- a/src/armnn/test/RuntimeTests.cpp
+++ b/src/armnn/test/RuntimeTests.cpp
@@ -712,7 +712,7 @@
 
     // Entity - Type relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                optNetGuid,
                                                LabelsAndEventClasses::NETWORK_GUID,
                                                LabelsAndEventClasses::TYPE_GUID,
@@ -720,15 +720,15 @@
                                                offset);
 
     // Network - START OF LIFE
-    ProfilingGuid networkSolEventGuid = VerifyTimelineEventBinaryPacket(EmptyOptional(),
-                                                                        EmptyOptional(),
-                                                                        EmptyOptional(),
+    ProfilingGuid networkSolEventGuid = VerifyTimelineEventBinaryPacket(arm::pipe::EmptyOptional(),
+                                                                        arm::pipe::EmptyOptional(),
+                                                                        arm::pipe::EmptyOptional(),
                                                                         readableData,
                                                                         offset);
 
     // Network - START OF LIFE event relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                optNetGuid,
                                                networkSolEventGuid,
                                                LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS,
@@ -740,13 +740,13 @@
     std::stringstream ss;
     ss << processID;
     std::string processIdLabel = ss.str();
-    VerifyTimelineLabelBinaryPacketData(EmptyOptional(), processIdLabel, readableData, offset);
+    VerifyTimelineLabelBinaryPacketData(arm::pipe::EmptyOptional(), processIdLabel, readableData, offset);
 
     // Entity - Process ID relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                optNetGuid,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                LabelsAndEventClasses::PROCESS_ID_GUID,
                                                readableData,
                                                offset);
@@ -756,11 +756,12 @@
     VerifyTimelineEntityBinaryPacketData(input->GetGuid(), readableData, offset);
 
     // Name Entity
-    ProfilingGuid inputLabelGuid = VerifyTimelineLabelBinaryPacketData(EmptyOptional(), "input", readableData, offset);
+    ProfilingGuid inputLabelGuid = VerifyTimelineLabelBinaryPacketData(
+        arm::pipe::EmptyOptional(), "input", readableData, offset);
 
     // Entity - Name relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                input->GetGuid(),
                                                inputLabelGuid,
                                                LabelsAndEventClasses::NAME_GUID,
@@ -769,7 +770,7 @@
 
     // Entity - Type relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                input->GetGuid(),
                                                LabelsAndEventClasses::LAYER_GUID,
                                                LabelsAndEventClasses::TYPE_GUID,
@@ -778,7 +779,7 @@
 
     // Network - Input layer relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                optNetGuid,
                                                input->GetGuid(),
                                                LabelsAndEventClasses::CHILD_GUID,
@@ -791,11 +792,11 @@
 
     // Name entity
     ProfilingGuid normalizationLayerNameGuid = VerifyTimelineLabelBinaryPacketData(
-        EmptyOptional(), "normalization", readableData, offset);
+        arm::pipe::EmptyOptional(), "normalization", readableData, offset);
 
     // Entity - Name relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                normalize->GetGuid(),
                                                normalizationLayerNameGuid,
                                                LabelsAndEventClasses::NAME_GUID,
@@ -804,7 +805,7 @@
 
     // Entity - Type relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                normalize->GetGuid(),
                                                LabelsAndEventClasses::LAYER_GUID,
                                                LabelsAndEventClasses::TYPE_GUID,
@@ -813,7 +814,7 @@
 
     // Network - Normalize layer relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                optNetGuid,
                                                normalize->GetGuid(),
                                                LabelsAndEventClasses::CHILD_GUID,
@@ -822,7 +823,7 @@
 
     // Input layer - Normalize layer relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                input->GetGuid(),
                                                normalize->GetGuid(),
                                                LabelsAndEventClasses::CONNECTION_GUID,
@@ -832,11 +833,11 @@
     // Normalization workload
     // Normalization workload entity
     ProfilingGuid normalizationWorkloadGuid = VerifyTimelineEntityBinaryPacketData(
-        EmptyOptional(), readableData, offset);
+        arm::pipe::EmptyOptional(), readableData, offset);
 
     // Entity - Type relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                normalizationWorkloadGuid,
                                                LabelsAndEventClasses::WORKLOAD_GUID,
                                                LabelsAndEventClasses::TYPE_GUID,
@@ -845,11 +846,11 @@
 
     // BackendId entity
     ProfilingGuid cpuRefLabelGuid = VerifyTimelineLabelBinaryPacketData(
-        EmptyOptional(), "CpuRef", readableData, offset);
+        arm::pipe::EmptyOptional(), "CpuRef", readableData, offset);
 
     // Entity - BackendId relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                normalizationWorkloadGuid,
                                                cpuRefLabelGuid,
                                                LabelsAndEventClasses::BACKENDID_GUID,
@@ -858,7 +859,7 @@
 
     // Normalize layer - Normalize workload relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                normalize->GetGuid(),
                                                normalizationWorkloadGuid,
                                                LabelsAndEventClasses::CHILD_GUID,
@@ -871,11 +872,11 @@
 
     // Name entity
     ProfilingGuid outputLabelGuid = VerifyTimelineLabelBinaryPacketData(
-        EmptyOptional(), "output", readableData, offset);
+        arm::pipe::EmptyOptional(), "output", readableData, offset);
 
     // Entity - Name relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                output->GetGuid(),
                                                outputLabelGuid,
                                                LabelsAndEventClasses::NAME_GUID,
@@ -884,7 +885,7 @@
 
     // Entity - Type relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                output->GetGuid(),
                                                LabelsAndEventClasses::LAYER_GUID,
                                                LabelsAndEventClasses::TYPE_GUID,
@@ -893,7 +894,7 @@
 
     // Network - Output layer relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                optNetGuid,
                                                output->GetGuid(),
                                                LabelsAndEventClasses::CHILD_GUID,
@@ -902,7 +903,7 @@
 
     // Normalize layer - Output layer relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                normalize->GetGuid(),
                                                output->GetGuid(),
                                                LabelsAndEventClasses::CONNECTION_GUID,
@@ -955,11 +956,12 @@
 
     // Input workload
     // Input workload entity
-    ProfilingGuid inputWorkloadGuid = VerifyTimelineEntityBinaryPacketData(EmptyOptional(), readableData, offset);
+    ProfilingGuid inputWorkloadGuid = VerifyTimelineEntityBinaryPacketData(
+        arm::pipe::EmptyOptional(), readableData, offset);
 
     // Entity - Type relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                inputWorkloadGuid,
                                                LabelsAndEventClasses::WORKLOAD_GUID,
                                                LabelsAndEventClasses::TYPE_GUID,
@@ -968,11 +970,11 @@
 
     // BackendId entity
     ProfilingGuid CpuRefLabelGuid = VerifyTimelineLabelBinaryPacketData(
-        EmptyOptional(), "CpuRef", readableData, offset);
+        arm::pipe::EmptyOptional(), "CpuRef", readableData, offset);
 
     // Entity - BackendId relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                inputWorkloadGuid,
                                                CpuRefLabelGuid,
                                                LabelsAndEventClasses::BACKENDID_GUID,
@@ -981,7 +983,7 @@
 
     // Input layer - Input workload relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                input->GetGuid(),
                                                inputWorkloadGuid,
                                                LabelsAndEventClasses::CHILD_GUID,
@@ -1004,11 +1006,12 @@
 
     // Output workload
     // Output workload entity
-    ProfilingGuid outputWorkloadGuid = VerifyTimelineEntityBinaryPacketData(EmptyOptional(), readableData, offset);
+    ProfilingGuid outputWorkloadGuid = VerifyTimelineEntityBinaryPacketData(
+        arm::pipe::EmptyOptional(), readableData, offset);
 
     // Entity - Type relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                outputWorkloadGuid,
                                                LabelsAndEventClasses::WORKLOAD_GUID,
                                                LabelsAndEventClasses::TYPE_GUID,
@@ -1016,11 +1019,11 @@
                                                offset);
 
     // BackendId entity
-    VerifyTimelineLabelBinaryPacketData(EmptyOptional(), "CpuRef", readableData, offset);
+    VerifyTimelineLabelBinaryPacketData(arm::pipe::EmptyOptional(), "CpuRef", readableData, offset);
 
     // Entity - BackendId relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                outputWorkloadGuid,
                                                CpuRefLabelGuid,
                                                LabelsAndEventClasses::BACKENDID_GUID,
@@ -1029,7 +1032,7 @@
 
     // Output layer - Output workload relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                output->GetGuid(),
                                                outputWorkloadGuid,
                                                LabelsAndEventClasses::CHILD_GUID,
@@ -1052,11 +1055,12 @@
 
     // Inference timeline trace
     // Inference entity
-    ProfilingGuid inferenceGuid = VerifyTimelineEntityBinaryPacketData(EmptyOptional(), readableData, offset);
+    ProfilingGuid inferenceGuid = VerifyTimelineEntityBinaryPacketData(
+        arm::pipe::EmptyOptional(), readableData, offset);
 
     // Entity - Type relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                inferenceGuid,
                                                LabelsAndEventClasses::INFERENCE_GUID,
                                                LabelsAndEventClasses::TYPE_GUID,
@@ -1065,7 +1069,7 @@
 
     // Network - Inference relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                optNetGuid,
                                                inferenceGuid,
                                                LabelsAndEventClasses::EXECUTION_OF_GUID,
@@ -1075,11 +1079,11 @@
     // Start Inference life
     // Event packet - timeline, threadId, eventGuid
     ProfilingGuid inferenceEventGuid = VerifyTimelineEventBinaryPacket(
-        EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset);
+        arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
 
     // Inference - event relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                inferenceGuid,
                                                inferenceEventGuid,
                                                LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS,
@@ -1090,11 +1094,11 @@
     // Input workload execution
     // Input workload execution entity
     ProfilingGuid inputWorkloadExecutionGuid = VerifyTimelineEntityBinaryPacketData(
-        EmptyOptional(), readableData, offset);
+        arm::pipe::EmptyOptional(), readableData, offset);
 
     // Entity - Type relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                inputWorkloadExecutionGuid,
                                                LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID,
                                                LabelsAndEventClasses::TYPE_GUID,
@@ -1103,7 +1107,7 @@
 
     // Inference - Workload execution relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                inferenceGuid,
                                                inputWorkloadExecutionGuid,
                                                LabelsAndEventClasses::CHILD_GUID,
@@ -1112,7 +1116,7 @@
 
     // Workload - Workload execution relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                inputWorkloadGuid,
                                                inputWorkloadExecutionGuid,
                                                LabelsAndEventClasses::EXECUTION_OF_GUID,
@@ -1122,11 +1126,11 @@
     // Start Input workload execution life
     // Event packet - timeline, threadId, eventGuid
     ProfilingGuid inputWorkloadExecutionSOLEventId = VerifyTimelineEventBinaryPacket(
-        EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset);
+        arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
 
     // Input workload execution - event relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                inputWorkloadExecutionGuid,
                                                inputWorkloadExecutionSOLEventId,
                                                LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS,
@@ -1136,11 +1140,11 @@
     // End of Input workload execution life
     // Event packet - timeline, threadId, eventGuid
     ProfilingGuid inputWorkloadExecutionEOLEventId = VerifyTimelineEventBinaryPacket(
-        EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset);
+        arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
 
     // Input workload execution - event relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                inputWorkloadExecutionGuid,
                                                inputWorkloadExecutionEOLEventId,
                                                LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS,
@@ -1150,11 +1154,11 @@
     // Normalize workload execution
     // Normalize workload execution entity
     ProfilingGuid normalizeWorkloadExecutionGuid = VerifyTimelineEntityBinaryPacketData(
-        EmptyOptional(), readableData, offset);
+        arm::pipe::EmptyOptional(), readableData, offset);
 
     // Entity - Type relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                normalizeWorkloadExecutionGuid,
                                                LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID,
                                                LabelsAndEventClasses::TYPE_GUID,
@@ -1163,7 +1167,7 @@
 
     // Inference - Workload execution relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                inferenceGuid,
                                                normalizeWorkloadExecutionGuid,
                                                LabelsAndEventClasses::CHILD_GUID,
@@ -1172,7 +1176,7 @@
 
     // Workload - Workload execution relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                normalizationWorkloadGuid,
                                                normalizeWorkloadExecutionGuid,
                                                LabelsAndEventClasses::EXECUTION_OF_GUID,
@@ -1182,11 +1186,11 @@
     // Start Normalize workload execution life
     // Event packet - timeline, threadId, eventGuid
     ProfilingGuid normalizationWorkloadExecutionSOLEventGuid = VerifyTimelineEventBinaryPacket(
-        EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset);
+        arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
 
     // Normalize workload execution - event relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                normalizeWorkloadExecutionGuid,
                                                normalizationWorkloadExecutionSOLEventGuid,
                                                LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS,
@@ -1196,11 +1200,11 @@
     // End of Normalize workload execution life
     // Event packet - timeline, threadId, eventGuid
     ProfilingGuid normalizationWorkloadExecutionEOLEventGuid = VerifyTimelineEventBinaryPacket(
-        EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset);
+        arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
 
     // Normalize workload execution - event relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                normalizeWorkloadExecutionGuid,
                                                normalizationWorkloadExecutionEOLEventGuid,
                                                LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS,
@@ -1210,11 +1214,11 @@
     // Output workload execution
     // Output workload execution entity
     ProfilingGuid outputWorkloadExecutionGuid = VerifyTimelineEntityBinaryPacketData(
-        EmptyOptional(), readableData, offset);
+        arm::pipe::EmptyOptional(), readableData, offset);
 
     // Entity - Type relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                outputWorkloadExecutionGuid,
                                                LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID,
                                                LabelsAndEventClasses::TYPE_GUID,
@@ -1223,7 +1227,7 @@
 
     // Inference - Workload execution relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                inferenceGuid,
                                                outputWorkloadExecutionGuid,
                                                LabelsAndEventClasses::CHILD_GUID,
@@ -1232,7 +1236,7 @@
 
     // Workload - Workload execution relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                outputWorkloadGuid,
                                                outputWorkloadExecutionGuid,
                                                LabelsAndEventClasses::EXECUTION_OF_GUID,
@@ -1242,11 +1246,11 @@
     // Start Output workload execution life
     // Event packet - timeline, threadId, eventGuid
     ProfilingGuid outputWorkloadExecutionSOLEventGuid = VerifyTimelineEventBinaryPacket(
-        EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset);
+        arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
 
     // Output workload execution - event relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                outputWorkloadExecutionGuid,
                                                outputWorkloadExecutionSOLEventGuid,
                                                LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS,
@@ -1256,11 +1260,11 @@
     // End of Normalize workload execution life
     // Event packet - timeline, threadId, eventGuid
     ProfilingGuid outputWorkloadExecutionEOLEventGuid = VerifyTimelineEventBinaryPacket(
-        EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset);
+        arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
 
     // Output workload execution - event relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                outputWorkloadExecutionGuid,
                                                outputWorkloadExecutionEOLEventGuid,
                                                LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS,
@@ -1270,11 +1274,11 @@
     // End of Inference life
     // Event packet - timeline, threadId, eventGuid
     ProfilingGuid inferenceEOLEventGuid = VerifyTimelineEventBinaryPacket(
-        EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset);
+        arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
 
     // Inference - event relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                inferenceGuid,
                                                inferenceEOLEventGuid,
                                                LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS,
diff --git a/src/profiling/ActivateTimelineReportingCommandHandler.hpp b/src/profiling/ActivateTimelineReportingCommandHandler.hpp
index ecc7076..6b311fe 100644
--- a/src/profiling/ActivateTimelineReportingCommandHandler.hpp
+++ b/src/profiling/ActivateTimelineReportingCommandHandler.hpp
@@ -10,12 +10,10 @@
 #include "IReportStructure.hpp"
 #include "INotifyBackends.hpp"
 
-#include "armnn/Optional.hpp"
-
 #include <common/include/CommandHandlerFunctor.hpp>
+#include <common/include/Optional.hpp>
 #include <common/include/Packet.hpp>
 
-
 namespace arm
 {
 
@@ -30,7 +28,7 @@
                                             uint32_t version,
                                             SendTimelinePacket& sendTimelinePacket,
                                             ProfilingStateMachine& profilingStateMachine,
-                                            armnn::Optional<IReportStructure&> reportStructure,
+                                            arm::pipe::Optional<IReportStructure&> reportStructure,
                                             std::atomic<bool>& timelineReporting,
                                             INotifyBackends& notifyBackends)
         : CommandHandlerFunctor(familyId, packetId, version),
@@ -49,7 +47,7 @@
     std::atomic<bool>&     m_TimelineReporting;
     INotifyBackends&       m_BackendNotifier;
 
-    armnn::Optional<IReportStructure&> m_ReportStructure;
+    arm::pipe::Optional<IReportStructure&> m_ReportStructure;
 };
 
 } // namespace pipe
diff --git a/src/profiling/ConnectionAcknowledgedCommandHandler.hpp b/src/profiling/ConnectionAcknowledgedCommandHandler.hpp
index 9ea3bd4..d69e0be 100644
--- a/src/profiling/ConnectionAcknowledgedCommandHandler.hpp
+++ b/src/profiling/ConnectionAcknowledgedCommandHandler.hpp
@@ -35,8 +35,8 @@
                                          ISendTimelinePacket& sendTimelinePacket,
                                          ProfilingStateMachine& profilingStateMachine,
                                          IProfilingServiceStatus& profilingServiceStatus,
-                                         armnn::Optional<BackendProfilingContexts> backendProfilingContexts =
-                                             armnn::EmptyOptional())
+                                         arm::pipe::Optional<BackendProfilingContexts> backendProfilingContexts =
+                                         arm::pipe::EmptyOptional())
         : CommandHandlerFunctor(familyId, packetId, version)
         , m_CounterDirectory(counterDirectory)
         , m_SendCounterPacket(sendCounterPacket)
@@ -60,11 +60,10 @@
     ISendTimelinePacket&     m_SendTimelinePacket;
     ProfilingStateMachine&   m_StateMachine;
     IProfilingServiceStatus& m_ProfilingServiceStatus;
-    armnn::Optional<BackendProfilingContexts> m_BackendProfilingContext;
+    arm::pipe::Optional<BackendProfilingContexts> m_BackendProfilingContext;
     std::atomic<bool> m_TimelineEnabled;
 };
 
 } // namespace pipe
 
 } // namespace arm
-
diff --git a/src/profiling/CounterDirectory.cpp b/src/profiling/CounterDirectory.cpp
index b8eddb4..0f6147f 100644
--- a/src/profiling/CounterDirectory.cpp
+++ b/src/profiling/CounterDirectory.cpp
@@ -50,7 +50,7 @@
 
 const Device* CounterDirectory::RegisterDevice(const std::string& deviceName,
                                                uint16_t cores,
-                                               const armnn::Optional<std::string>& parentCategoryName)
+                                               const arm::pipe::Optional<std::string>& parentCategoryName)
 {
     // Check that the given device name is valid
     if (deviceName.empty() ||
@@ -112,7 +112,7 @@
 
 const CounterSet* CounterDirectory::RegisterCounterSet(const std::string& counterSetName,
                                                        uint16_t count,
-                                                       const armnn::Optional<std::string>& parentCategoryName)
+                                                       const arm::pipe::Optional<std::string>& parentCategoryName)
 {
     // Check that the given counter set name is valid
     if (counterSetName.empty() ||
@@ -184,10 +184,10 @@
                                                  double multiplier,
                                                  const std::string& name,
                                                  const std::string& description,
-                                                 const armnn::Optional<std::string>& units,
-                                                 const armnn::Optional<uint16_t>& numberOfCores,
-                                                 const armnn::Optional<uint16_t>& deviceUid,
-                                                 const armnn::Optional<uint16_t>& counterSetUid)
+                                                 const arm::pipe::Optional<std::string>& units,
+                                                 const arm::pipe::Optional<uint16_t>& numberOfCores,
+                                                 const arm::pipe::Optional<uint16_t>& deviceUid,
+                                                 const arm::pipe::Optional<uint16_t>& counterSetUid)
 {
     // Check that the given parent category name is valid
     if (parentCategoryName.empty() ||
@@ -498,7 +498,7 @@
     });
 }
 
-uint16_t CounterDirectory::GetNumberOfCores(const armnn::Optional<uint16_t>& numberOfCores,
+uint16_t CounterDirectory::GetNumberOfCores(const arm::pipe::Optional<uint16_t>& numberOfCores,
                                             uint16_t deviceUid)
 {
     // To get the number of cores, apply the following rules:
diff --git a/src/profiling/CounterDirectory.hpp b/src/profiling/CounterDirectory.hpp
index b655f92..ecc349e 100644
--- a/src/profiling/CounterDirectory.hpp
+++ b/src/profiling/CounterDirectory.hpp
@@ -30,24 +30,24 @@
     const Category*   RegisterCategory  (const std::string& categoryName) override;
     const Device*     RegisterDevice    (const std::string& deviceName,
                                          uint16_t cores = 0,
-                                         const armnn::Optional<std::string>& parentCategoryName
-                                            = armnn::EmptyOptional()) override;
+                                         const arm::pipe::Optional<std::string>& parentCategoryName
+                                         = arm::pipe::EmptyOptional()) override;
     const CounterSet* RegisterCounterSet(const std::string& counterSetName,
                                          uint16_t count = 0,
-                                         const armnn::Optional<std::string>& parentCategoryName
-                                            = armnn::EmptyOptional()) override;
+                                         const arm::pipe::Optional<std::string>& parentCategoryName
+                                            = arm::pipe::EmptyOptional()) override;
     const Counter* RegisterCounter(const std::string& backendId,
-                                   const uint16_t uid,
-                                   const std::string& parentCategoryName,
-                                   uint16_t counterClass,
-                                   uint16_t interpolation,
-                                   double multiplier,
-                                   const std::string& name,
-                                   const std::string& description,
-                                   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()) override;
+        const uint16_t uid,
+        const std::string& parentCategoryName,
+        uint16_t counterClass,
+        uint16_t interpolation,
+        double multiplier,
+        const std::string& name,
+        const std::string& description,
+        const arm::pipe::Optional<std::string>& units = arm::pipe::EmptyOptional(),
+        const arm::pipe::Optional<uint16_t>& numberOfCores = arm::pipe::EmptyOptional(),
+        const arm::pipe::Optional<uint16_t>& deviceUid = arm::pipe::EmptyOptional(),
+        const arm::pipe::Optional<uint16_t>& counterSetUid = arm::pipe::EmptyOptional()) override;
 
     // Getters for counts
     uint16_t GetCategoryCount()   const override { return arm::pipe::numeric_cast<uint16_t>(m_Categories.size());  }
@@ -94,7 +94,7 @@
     CounterSetsIt FindCounterSet(const std::string& counterSetName) const;
     CountersIt    FindCounter(uint16_t counterUid) const;
     CountersIt    FindCounter(const std::string& counterName) const;
-    uint16_t      GetNumberOfCores(const armnn::Optional<uint16_t>& numberOfCores,
+    uint16_t      GetNumberOfCores(const arm::pipe::Optional<uint16_t>& numberOfCores,
                                    uint16_t deviceUid);
 };
 
diff --git a/src/profiling/DirectoryCaptureCommandHandler.cpp b/src/profiling/DirectoryCaptureCommandHandler.cpp
index ac11f68..4011c9b 100644
--- a/src/profiling/DirectoryCaptureCommandHandler.cpp
+++ b/src/profiling/DirectoryCaptureCommandHandler.cpp
@@ -289,7 +289,7 @@
                                                                              descriptionOffset +
                                                                              uint32_t_size);
 
-        eventRecords[i].m_CounterUnits = unitsOffset == 0 ? armnn::Optional<std::string>() :
+        eventRecords[i].m_CounterUnits = unitsOffset == 0 ? arm::pipe::Optional<std::string>() :
                 GetStringNameFromBuffer(data, eventRecordsOffsets[i] + offset + unitsOffset + uint32_t_size);
     }
 
diff --git a/src/profiling/DirectoryCaptureCommandHandler.hpp b/src/profiling/DirectoryCaptureCommandHandler.hpp
index 751eae3..007cf05 100644
--- a/src/profiling/DirectoryCaptureCommandHandler.hpp
+++ b/src/profiling/DirectoryCaptureCommandHandler.hpp
@@ -26,7 +26,7 @@
     std::string m_CounterName;
     uint16_t m_CounterSetUid;
     uint16_t m_CounterUid;
-    armnn::Optional<std::string> m_CounterUnits;
+    arm::pipe::Optional<std::string> m_CounterUnits;
     uint16_t m_DeviceUid;
     uint16_t m_MaxCounterUid;
 };
diff --git a/src/profiling/FileOnlyProfilingConnection.hpp b/src/profiling/FileOnlyProfilingConnection.hpp
index 190803f..48fb4d3 100644
--- a/src/profiling/FileOnlyProfilingConnection.hpp
+++ b/src/profiling/FileOnlyProfilingConnection.hpp
@@ -6,9 +6,11 @@
 #pragma once
 
 #include <armnn/profiling/ILocalPacketHandler.hpp>
+#include <armnn/profiling/ProfilingOptions.hpp>
+
+#include "DirectoryCaptureCommandHandler.hpp"
 #include "IProfilingConnection.hpp"
 #include "ProfilingUtils.hpp"
-#include "Runtime.hpp"
 
 #include <common/include/Assert.hpp>
 #include <common/include/Packet.hpp>
@@ -16,6 +18,7 @@
 #include <atomic>
 #include <condition_variable>
 #include <fstream>
+#include <map>
 #include <mutex>
 #include <queue>
 #include <thread>
diff --git a/src/profiling/ICounterRegistry.hpp b/src/profiling/ICounterRegistry.hpp
index 72b08a6..5c34e7a 100644
--- a/src/profiling/ICounterRegistry.hpp
+++ b/src/profiling/ICounterRegistry.hpp
@@ -5,7 +5,7 @@
 
 #pragma once
 
-#include <armnn/Optional.hpp>
+#include <common/include/Optional.hpp>
 
 namespace arm
 {
@@ -23,24 +23,24 @@
 
     virtual const Device*     RegisterDevice    (const std::string& deviceName,
                                                  uint16_t cores,
-                                                 const armnn::Optional<std::string>& parentCategoryName) = 0;
+                                                 const arm::pipe::Optional<std::string>& parentCategoryName) = 0;
 
     virtual const CounterSet* RegisterCounterSet(const std::string& counterSetName,
                                                  uint16_t count,
-                                                 const armnn::Optional<std::string>& parentCategoryName) = 0;
+                                                 const arm::pipe::Optional<std::string>& parentCategoryName) = 0;
 
     virtual const Counter* RegisterCounter(const std::string& backendId,
-                                           const uint16_t uid,
-                                           const std::string& parentCategoryName,
-                                           uint16_t counterClass,
-                                           uint16_t interpolation,
-                                           double multiplier,
-                                           const std::string& name,
-                                           const std::string& description,
-                                           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;
+        const uint16_t uid,
+        const std::string& parentCategoryName,
+        uint16_t counterClass,
+        uint16_t interpolation,
+        double multiplier,
+        const std::string& name,
+        const std::string& description,
+        const arm::pipe::Optional<std::string>& units = arm::pipe::EmptyOptional(),
+        const arm::pipe::Optional<uint16_t>& numberOfCores = arm::pipe::EmptyOptional(),
+        const arm::pipe::Optional<uint16_t>& deviceUid = arm::pipe::EmptyOptional(),
+        const arm::pipe::Optional<uint16_t>& counterSetUid = arm::pipe::EmptyOptional()) = 0;
 
 };
 
diff --git a/src/profiling/IProfilingService.cpp b/src/profiling/IProfilingService.cpp
index cd85bb9..3bae941 100644
--- a/src/profiling/IProfilingService.cpp
+++ b/src/profiling/IProfilingService.cpp
@@ -15,7 +15,7 @@
 std::unique_ptr<IProfilingService> IProfilingService::CreateProfilingService(
     uint16_t maxGlobalCounterId,
     IInitialiseProfilingService& initialiser,
-    armnn::Optional<IReportStructure&> reportStructure)
+    arm::pipe::Optional<IReportStructure&> reportStructure)
 {
     return std::make_unique<ProfilingService>(maxGlobalCounterId, initialiser, reportStructure);
 }
diff --git a/src/profiling/IProfilingService.hpp b/src/profiling/IProfilingService.hpp
index 912265e..bc16860 100644
--- a/src/profiling/IProfilingService.hpp
+++ b/src/profiling/IProfilingService.hpp
@@ -17,7 +17,8 @@
 
 #include <armnn/backends/profiling/IBackendProfilingContext.hpp>
 #include <armnn/profiling/ProfilingOptions.hpp>
-#include <armnn/Optional.hpp>
+
+#include <common/include/Optional.hpp>
 #include <common/include/ProfilingGuidGenerator.hpp>
 
 namespace arm
@@ -34,7 +35,7 @@
     static std::unique_ptr<IProfilingService> CreateProfilingService(
         uint16_t maxGlobalCounterId,
         IInitialiseProfilingService& initialiser,
-        armnn::Optional<IReportStructure&> reportStructure = armnn::EmptyOptional());
+        arm::pipe::Optional<IReportStructure&> reportStructure = arm::pipe::EmptyOptional());
     virtual ~IProfilingService() {};
     virtual std::unique_ptr<ISendTimelinePacket> GetSendTimelinePacket() const = 0;
     virtual const ICounterMappings& GetCounterMappings() const = 0;
diff --git a/src/profiling/PeriodicCounterSelectionCommandHandler.hpp b/src/profiling/PeriodicCounterSelectionCommandHandler.hpp
index 98a8ee0..103258a 100644
--- a/src/profiling/PeriodicCounterSelectionCommandHandler.hpp
+++ b/src/profiling/PeriodicCounterSelectionCommandHandler.hpp
@@ -81,7 +81,7 @@
                                  const uint32_t capturePeriod,
                                  const std::vector<uint16_t> counterIds)
     {
-        armnn::Optional<std::string> errorMsg =
+        arm::pipe::Optional<std::string> errorMsg =
                 m_BackendProfilingContexts.at(backendId)->ActivateCounters(capturePeriod, counterIds);
 
         if(errorMsg.has_value())
diff --git a/src/profiling/ProfilingConnectionDumpToFileDecorator.hpp b/src/profiling/ProfilingConnectionDumpToFileDecorator.hpp
index 2cbd98f..5807947 100644
--- a/src/profiling/ProfilingConnectionDumpToFileDecorator.hpp
+++ b/src/profiling/ProfilingConnectionDumpToFileDecorator.hpp
@@ -8,8 +8,7 @@
 #include "IProfilingConnection.hpp"
 #include "ProfilingUtils.hpp"
 
-#include <Runtime.hpp>
-#include <armnn/Optional.hpp>
+#include <armnn/profiling/ProfilingOptions.hpp>
 
 #include <fstream>
 #include <memory>
diff --git a/src/profiling/ProfilingService.hpp b/src/profiling/ProfilingService.hpp
index 22349d0..e43642c 100644
--- a/src/profiling/ProfilingService.hpp
+++ b/src/profiling/ProfilingService.hpp
@@ -52,7 +52,7 @@
 
     ProfilingService(uint16_t maxGlobalCounterId,
                      IInitialiseProfilingService& initialiser,
-                     armnn::Optional<IReportStructure&> reportStructure = armnn::EmptyOptional())
+                     arm::pipe::Optional<IReportStructure&> reportStructure = arm::pipe::EmptyOptional())
         : m_Options()
         , m_TimelineReporting(false)
         , m_ProfilingConnectionFactory(new ProfilingConnectionFactory())
diff --git a/src/profiling/RegisterBackendCounters.cpp b/src/profiling/RegisterBackendCounters.cpp
index dcafe3b..79ffa20 100644
--- a/src/profiling/RegisterBackendCounters.cpp
+++ b/src/profiling/RegisterBackendCounters.cpp
@@ -18,7 +18,7 @@
 
 uint16_t RegisterBackendCounters::RegisterDevice(const std::string& deviceName,
                                                  uint16_t cores,
-                                                 const armnn::Optional<std::string>& parentCategoryName)
+                                                 const arm::pipe::Optional<std::string>& parentCategoryName)
 {
     const Device* devicePtr = m_CounterDirectory.RegisterDevice(deviceName, cores, parentCategoryName);
     return devicePtr->m_Uid;
@@ -26,7 +26,7 @@
 
 uint16_t RegisterBackendCounters::RegisterCounterSet(const std::string& counterSetName,
                                                      uint16_t count,
-                                                     const armnn::Optional<std::string>& parentCategoryName)
+                                                     const arm::pipe::Optional<std::string>& parentCategoryName)
 {
     const CounterSet* counterSetPtr = m_CounterDirectory.RegisterCounterSet(counterSetName, count, parentCategoryName);
     return counterSetPtr->m_Uid;
@@ -39,10 +39,10 @@
                                                   double multiplier,
                                                   const std::string& name,
                                                   const std::string& description,
-                                                  const armnn::Optional<std::string>& units,
-                                                  const armnn::Optional<uint16_t>& numberOfCores,
-                                                  const armnn::Optional<uint16_t>& deviceUid,
-                                                  const armnn::Optional<uint16_t>& counterSetUid)
+                                                  const arm::pipe::Optional<std::string>& units,
+                                                  const arm::pipe::Optional<uint16_t>& numberOfCores,
+                                                  const arm::pipe::Optional<uint16_t>& deviceUid,
+                                                  const arm::pipe::Optional<uint16_t>& counterSetUid)
 {
     ++m_CurrentMaxGlobalCounterID;
     const Counter* counterPtr = m_CounterDirectory.RegisterCounter(m_BackendId,
diff --git a/src/profiling/RegisterBackendCounters.hpp b/src/profiling/RegisterBackendCounters.hpp
index 88234df..e3045b2 100644
--- a/src/profiling/RegisterBackendCounters.hpp
+++ b/src/profiling/RegisterBackendCounters.hpp
@@ -33,12 +33,13 @@
 
     uint16_t RegisterDevice(const std::string& deviceName,
                             uint16_t cores = 0,
-                            const armnn::Optional<std::string>& parentCategoryName = armnn::EmptyOptional()) override;
+                            const arm::pipe::Optional<std::string>& parentCategoryName =
+                                arm::pipe::EmptyOptional()) override;
 
     uint16_t RegisterCounterSet(const std::string& counterSetName,
                                 uint16_t count = 0,
-                                const armnn::Optional<std::string>& parentCategoryName
-                                    = armnn::EmptyOptional()) override;
+                                const arm::pipe::Optional<std::string>& parentCategoryName
+                                    = arm::pipe::EmptyOptional()) override;
 
     uint16_t RegisterCounter(const uint16_t uid,
                              const std::string& parentCategoryName,
@@ -47,10 +48,10 @@
                              double multiplier,
                              const std::string& name,
                              const std::string& description,
-                             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()) override;
+                             const arm::pipe::Optional<std::string>& units      = arm::pipe::EmptyOptional(),
+                             const arm::pipe::Optional<uint16_t>& numberOfCores = arm::pipe::EmptyOptional(),
+                             const arm::pipe::Optional<uint16_t>& deviceUid     = arm::pipe::EmptyOptional(),
+                             const arm::pipe::Optional<uint16_t>& counterSetUid = arm::pipe::EmptyOptional()) override;
 
 private:
     uint16_t m_CurrentMaxGlobalCounterID;
diff --git a/src/profiling/SocketProfilingConnection.cpp b/src/profiling/SocketProfilingConnection.cpp
index 4787136..a211567 100644
--- a/src/profiling/SocketProfilingConnection.cpp
+++ b/src/profiling/SocketProfilingConnection.cpp
@@ -5,9 +5,10 @@
 
 #include "SocketProfilingConnection.hpp"
 
-#include "common/include/SocketConnectionException.hpp"
+#include <common/include/SocketConnectionException.hpp>
 
 #include <cerrno>
+#include <cstring>
 #include <fcntl.h>
 #include <string>
 
@@ -149,7 +150,7 @@
         {
             // This is a corner case. The socket as been woken up but not with any data.
             // We'll throw a timeout exception to loop around again.
-            throw armnn::TimeoutException(
+            throw arm::pipe::TimeoutException(
                 "SocketProfilingConnection: File descriptor was polled but no data was available to receive.");
         }
 
diff --git a/src/profiling/SocketProfilingConnection.hpp b/src/profiling/SocketProfilingConnection.hpp
index 31b17aa..52616c9 100644
--- a/src/profiling/SocketProfilingConnection.hpp
+++ b/src/profiling/SocketProfilingConnection.hpp
@@ -5,7 +5,6 @@
 
 #include "IProfilingConnection.hpp"
 
-#include <Runtime.hpp>
 #include <common/include/NetworkSockets.hpp>
 
 #pragma once
diff --git a/src/profiling/test/ProfilingMocks.hpp b/src/profiling/test/ProfilingMocks.hpp
index 4da167a..1b5a366 100644
--- a/src/profiling/test/ProfilingMocks.hpp
+++ b/src/profiling/test/ProfilingMocks.hpp
@@ -13,11 +13,10 @@
 #include <SendCounterPacket.hpp>
 #include <SendThread.hpp>
 
-#include <armnn/Optional.hpp>
-
 #include <common/include/Assert.hpp>
 #include <common/include/IgnoreUnused.hpp>
 #include <common/include/NumericCast.hpp>
+#include <common/include/Optional.hpp>
 #include <common/include/ProfilingException.hpp>
 #include <common/include/ProfilingGuidGenerator.hpp>
 
@@ -512,10 +511,10 @@
                                    double multiplier,
                                    const std::string& name,
                                    const std::string& description,
-                                   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())
+                                   const arm::pipe::Optional<std::string>& units = arm::pipe::EmptyOptional(),
+                                   const arm::pipe::Optional<uint16_t>& numberOfCores = arm::pipe::EmptyOptional(),
+                                   const arm::pipe::Optional<uint16_t>& deviceUid = arm::pipe::EmptyOptional(),
+                                   const arm::pipe::Optional<uint16_t>& counterSetUid = arm::pipe::EmptyOptional())
     {
         arm::pipe::IgnoreUnused(backendId);
 
diff --git a/src/profiling/test/ProfilingTestUtils.cpp b/src/profiling/test/ProfilingTestUtils.cpp
index 2cd20b4..7fe7069 100644
--- a/src/profiling/test/ProfilingTestUtils.cpp
+++ b/src/profiling/test/ProfilingTestUtils.cpp
@@ -102,7 +102,7 @@
     offset += uint32_t_size;
 }
 
-ProfilingGuid VerifyTimelineLabelBinaryPacketData(Optional<ProfilingGuid> guid,
+ProfilingGuid VerifyTimelineLabelBinaryPacketData(arm::pipe::Optional<ProfilingGuid> guid,
                                                   const std::string& label,
                                                   const unsigned char* readableData,
                                                   unsigned int& offset)
@@ -177,10 +177,10 @@
 }
 
 void VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType relationshipType,
-                                                Optional<ProfilingGuid> relationshipGuid,
-                                                Optional<ProfilingGuid> headGuid,
-                                                Optional<ProfilingGuid> tailGuid,
-                                                Optional<ProfilingGuid> attributeGuid,
+                                                arm::pipe::Optional<ProfilingGuid> relationshipGuid,
+                                                arm::pipe::Optional<ProfilingGuid> headGuid,
+                                                arm::pipe::Optional<ProfilingGuid> tailGuid,
+                                                arm::pipe::Optional<ProfilingGuid> attributeGuid,
                                                 const unsigned char* readableData,
                                                 unsigned int& offset)
 {
@@ -270,7 +270,7 @@
     offset += uint64_t_size;
 }
 
-ProfilingGuid VerifyTimelineEntityBinaryPacketData(Optional<ProfilingGuid> guid,
+ProfilingGuid VerifyTimelineEntityBinaryPacketData(arm::pipe::Optional<ProfilingGuid> guid,
                                                    const unsigned char* readableData,
                                                    unsigned int& offset)
 {
@@ -304,9 +304,9 @@
     return entityGuid;
 }
 
-ProfilingGuid VerifyTimelineEventBinaryPacket(Optional<uint64_t> timestamp,
-                                              Optional<int> threadId,
-                                              Optional<ProfilingGuid> eventGuid,
+ProfilingGuid VerifyTimelineEventBinaryPacket(arm::pipe::Optional<uint64_t> timestamp,
+                                              arm::pipe::Optional<int> threadId,
+                                              arm::pipe::Optional<ProfilingGuid> eventGuid,
                                               const unsigned char* readableData,
                                               unsigned int& offset)
 {
@@ -403,10 +403,10 @@
     };
     ConstTensor weights(weightInfo, weightsData);
 
-    Optional<ConstTensor> optionalBiases;
+    armnn::Optional<ConstTensor> optionalBiases;
     std::vector<float> biasesData{ 1.0f, 0.0f, 0.0f };
     ConstTensor biases(biasInfo, biasesData);
-    optionalBiases = Optional<ConstTensor>(biases);
+    optionalBiases = armnn::Optional<ConstTensor>(biases);
 
     // Input layer
     IConnectableLayer* input = net->AddInputLayer(0, "input");
@@ -468,7 +468,7 @@
 
     // Entity - Type relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                optNetGuid,
                                                LabelsAndEventClasses::NETWORK_GUID,
                                                LabelsAndEventClasses::TYPE_GUID,
@@ -476,15 +476,15 @@
                                                offset);
 
     // Network - START OF LIFE
-    ProfilingGuid networkSolEventGuid = VerifyTimelineEventBinaryPacket(EmptyOptional(),
-                                                                        EmptyOptional(),
-                                                                        EmptyOptional(),
+    ProfilingGuid networkSolEventGuid = VerifyTimelineEventBinaryPacket(arm::pipe::EmptyOptional(),
+                                                                        arm::pipe::EmptyOptional(),
+                                                                        arm::pipe::EmptyOptional(),
                                                                         readableData,
                                                                         offset);
 
     // Network - START OF LIFE event relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                optNetGuid,
                                                networkSolEventGuid,
                                                LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS,
@@ -496,13 +496,14 @@
     std::stringstream ss;
     ss << processID;
     std::string processIdLabel = ss.str();
-    VerifyTimelineLabelBinaryPacketData(EmptyOptional(), processIdLabel, readableData, offset);
+    VerifyTimelineLabelBinaryPacketData(
+        arm::pipe::EmptyOptional(), processIdLabel, readableData, offset);
 
     // Entity - Process ID relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                optNetGuid,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                LabelsAndEventClasses::PROCESS_ID_GUID,
                                                readableData,
                                                offset);
@@ -512,11 +513,12 @@
     VerifyTimelineEntityBinaryPacketData(input->GetGuid(), readableData, offset);
 
     // Name Entity
-    ProfilingGuid inputLabelGuid = VerifyTimelineLabelBinaryPacketData(EmptyOptional(), "input", readableData, offset);
+    ProfilingGuid inputLabelGuid = VerifyTimelineLabelBinaryPacketData(
+        arm::pipe::EmptyOptional(), "input", readableData, offset);
 
     // Entity - Name relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                input->GetGuid(),
                                                inputLabelGuid,
                                                LabelsAndEventClasses::NAME_GUID,
@@ -525,7 +527,7 @@
 
     // Entity - Type relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                input->GetGuid(),
                                                LabelsAndEventClasses::LAYER_GUID,
                                                LabelsAndEventClasses::TYPE_GUID,
@@ -534,7 +536,7 @@
 
     // Network - Input layer relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                optNetGuid,
                                                input->GetGuid(),
                                                LabelsAndEventClasses::CHILD_GUID,
@@ -547,11 +549,11 @@
 
     // Name entity
     ProfilingGuid conv2dNameLabelGuid = VerifyTimelineLabelBinaryPacketData(
-        EmptyOptional(), "<Unnamed>", readableData, offset);
+        arm::pipe::EmptyOptional(), "<Unnamed>", readableData, offset);
 
     // Entity - Name relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                conv2d->GetGuid(),
                                                conv2dNameLabelGuid,
                                                LabelsAndEventClasses::NAME_GUID,
@@ -560,7 +562,7 @@
 
     // Entity - Type relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                conv2d->GetGuid(),
                                                LabelsAndEventClasses::LAYER_GUID,
                                                LabelsAndEventClasses::TYPE_GUID,
@@ -569,7 +571,7 @@
 
     // Network - Conv2d layer relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                optNetGuid,
                                                conv2d->GetGuid(),
                                                LabelsAndEventClasses::CHILD_GUID,
@@ -578,7 +580,7 @@
 
     // Input layer - Conv2d layer relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                input->GetGuid(),
                                                conv2d->GetGuid(),
                                                LabelsAndEventClasses::CONNECTION_GUID,
@@ -587,11 +589,12 @@
 
     // Conv2d workload
     // Conv2d workload entity
-    ProfilingGuid conv2DWorkloadGuid = VerifyTimelineEntityBinaryPacketData(EmptyOptional(), readableData, offset);
+    ProfilingGuid conv2DWorkloadGuid = VerifyTimelineEntityBinaryPacketData(
+        arm::pipe::EmptyOptional(), readableData, offset);
 
     // Entity - Type relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                conv2DWorkloadGuid,
                                                LabelsAndEventClasses::WORKLOAD_GUID,
                                                LabelsAndEventClasses::TYPE_GUID,
@@ -600,11 +603,11 @@
 
     // BackendId entity
     ProfilingGuid backendIdLabelGuid = VerifyTimelineLabelBinaryPacketData(
-        EmptyOptional(), backendId.Get(), readableData, offset);
+        arm::pipe::EmptyOptional(), backendId.Get(), readableData, offset);
 
     // Entity - BackendId relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                conv2DWorkloadGuid,
                                                backendIdLabelGuid,
                                                LabelsAndEventClasses::BACKENDID_GUID,
@@ -614,7 +617,7 @@
 
     // Conv2d layer - Conv2d workload relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                conv2d->GetGuid(),
                                                conv2DWorkloadGuid,
                                                LabelsAndEventClasses::CHILD_GUID,
@@ -627,11 +630,11 @@
 
     // Name entity
     ProfilingGuid absLabelGuid = VerifyTimelineLabelBinaryPacketData(
-        EmptyOptional(), "abs", readableData, offset);
+        arm::pipe::EmptyOptional(), "abs", readableData, offset);
 
     // Entity - Name relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                abs->GetGuid(),
                                                absLabelGuid,
                                                LabelsAndEventClasses::NAME_GUID,
@@ -640,7 +643,7 @@
 
     // Entity - Type relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                abs->GetGuid(),
                                                LabelsAndEventClasses::LAYER_GUID,
                                                LabelsAndEventClasses::TYPE_GUID,
@@ -649,7 +652,7 @@
 
     // Network - Abs layer relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                optNetGuid,
                                                abs->GetGuid(),
                                                LabelsAndEventClasses::CHILD_GUID,
@@ -658,7 +661,7 @@
 
     // Conv2d layer - Abs layer relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                conv2d->GetGuid(),
                                                abs->GetGuid(),
                                                LabelsAndEventClasses::CONNECTION_GUID,
@@ -667,11 +670,12 @@
 
     // Abs workload
     // Abs workload entity
-    ProfilingGuid absWorkloadGuid = VerifyTimelineEntityBinaryPacketData(EmptyOptional(), readableData, offset);
+    ProfilingGuid absWorkloadGuid = VerifyTimelineEntityBinaryPacketData(
+        arm::pipe::EmptyOptional(), readableData, offset);
 
     // Entity - Type relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                absWorkloadGuid,
                                                LabelsAndEventClasses::WORKLOAD_GUID,
                                                LabelsAndEventClasses::TYPE_GUID,
@@ -679,11 +683,11 @@
                                                offset);
 
     // BackendId entity
-    VerifyTimelineLabelBinaryPacketData(EmptyOptional(), backendId.Get(), readableData, offset);
+    VerifyTimelineLabelBinaryPacketData(arm::pipe::EmptyOptional(), backendId.Get(), readableData, offset);
 
     // Entity - BackendId relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                absWorkloadGuid,
                                                backendIdLabelGuid,
                                                LabelsAndEventClasses::BACKENDID_GUID,
@@ -692,7 +696,7 @@
 
     // Abs layer - Abs workload relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                abs->GetGuid(),
                                                absWorkloadGuid,
                                                LabelsAndEventClasses::CHILD_GUID,
@@ -705,11 +709,11 @@
 
     // Name entity
     ProfilingGuid outputLabelGuid = VerifyTimelineLabelBinaryPacketData(
-        EmptyOptional(), "output", readableData, offset);
+        arm::pipe::EmptyOptional(), "output", readableData, offset);
 
     // Entity - Name relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                output->GetGuid(),
                                                outputLabelGuid,
                                                LabelsAndEventClasses::NAME_GUID,
@@ -718,7 +722,7 @@
 
     // Entity - Type relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                output->GetGuid(),
                                                LabelsAndEventClasses::LAYER_GUID,
                                                LabelsAndEventClasses::TYPE_GUID,
@@ -727,7 +731,7 @@
 
     // Network - Output layer relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                optNetGuid,
                                                output->GetGuid(),
                                                LabelsAndEventClasses::CHILD_GUID,
@@ -736,7 +740,7 @@
 
     // Abs layer - Output layer relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                abs->GetGuid(),
                                                output->GetGuid(),
                                                LabelsAndEventClasses::CONNECTION_GUID,
@@ -789,11 +793,12 @@
 
     // Input workload
     // Input workload entity
-    ProfilingGuid inputWorkloadGuid = VerifyTimelineEntityBinaryPacketData(EmptyOptional(), readableData, offset);
+    ProfilingGuid inputWorkloadGuid = VerifyTimelineEntityBinaryPacketData(
+        arm::pipe::EmptyOptional(), readableData, offset);
 
     // Entity - Type relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                inputWorkloadGuid,
                                                LabelsAndEventClasses::WORKLOAD_GUID,
                                                LabelsAndEventClasses::TYPE_GUID,
@@ -801,11 +806,11 @@
                                                offset);
 
     // BackendId entity
-    VerifyTimelineLabelBinaryPacketData(EmptyOptional(), backendId.Get(), readableData, offset);
+    VerifyTimelineLabelBinaryPacketData(arm::pipe::EmptyOptional(), backendId.Get(), readableData, offset);
 
     // Entity - BackendId relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                inputWorkloadGuid,
                                                backendIdLabelGuid,
                                                LabelsAndEventClasses::BACKENDID_GUID,
@@ -814,7 +819,7 @@
 
     // Input layer - Input workload relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                input->GetGuid(),
                                                inputWorkloadGuid,
                                                LabelsAndEventClasses::CHILD_GUID,
@@ -837,11 +842,12 @@
 
     // Output workload
     // Output workload entity
-    ProfilingGuid outputWorkloadGuid = VerifyTimelineEntityBinaryPacketData(EmptyOptional(), readableData, offset);
+    ProfilingGuid outputWorkloadGuid = VerifyTimelineEntityBinaryPacketData(
+        arm::pipe::EmptyOptional(), readableData, offset);
 
     // Entity - Type relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                outputWorkloadGuid,
                                                LabelsAndEventClasses::WORKLOAD_GUID,
                                                LabelsAndEventClasses::TYPE_GUID,
@@ -849,11 +855,11 @@
                                                offset);
 
     // BackendId entity
-    VerifyTimelineLabelBinaryPacketData(EmptyOptional(), backendId.Get(), readableData, offset);
+    VerifyTimelineLabelBinaryPacketData(arm::pipe::EmptyOptional(), backendId.Get(), readableData, offset);
 
     // Entity - BackendId relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                outputWorkloadGuid,
                                                backendIdLabelGuid,
                                                LabelsAndEventClasses::BACKENDID_GUID,
@@ -862,7 +868,7 @@
 
     // Output layer - Output workload relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                output->GetGuid(),
                                                outputWorkloadGuid,
                                                LabelsAndEventClasses::CHILD_GUID,
@@ -886,11 +892,12 @@
 
     // Inference timeline trace
     // Inference entity
-    ProfilingGuid inferenceGuid = VerifyTimelineEntityBinaryPacketData(EmptyOptional(), readableData, offset);
+    ProfilingGuid inferenceGuid = VerifyTimelineEntityBinaryPacketData(
+        arm::pipe::EmptyOptional(), readableData, offset);
 
     // Entity - Type relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                inferenceGuid,
                                                LabelsAndEventClasses::INFERENCE_GUID,
                                                LabelsAndEventClasses::TYPE_GUID,
@@ -899,7 +906,7 @@
 
     // Network - Inference relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                optNetGuid,
                                                inferenceGuid,
                                                LabelsAndEventClasses::EXECUTION_OF_GUID,
@@ -909,11 +916,11 @@
     // Start Inference life
     // Event packet - timeline, threadId, eventGuid
     ProfilingGuid inferenceEventGuid = VerifyTimelineEventBinaryPacket(
-        EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset);
+        arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
 
     // Inference - event relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                inferenceGuid,
                                                inferenceEventGuid,
                                                LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS,
@@ -924,11 +931,11 @@
     // Input workload execution
     // Input workload execution entity
     ProfilingGuid inputWorkloadExecutionGuid = VerifyTimelineEntityBinaryPacketData(
-        EmptyOptional(), readableData, offset);
+        arm::pipe::EmptyOptional(), readableData, offset);
 
     // Entity - Type relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                inputWorkloadExecutionGuid,
                                                LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID,
                                                LabelsAndEventClasses::TYPE_GUID,
@@ -937,7 +944,7 @@
 
     // Inference - Workload execution relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                inferenceGuid,
                                                inputWorkloadExecutionGuid,
                                                LabelsAndEventClasses::CHILD_GUID,
@@ -946,7 +953,7 @@
 
     // Workload - Workload execution relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                inputWorkloadGuid,
                                                inputWorkloadExecutionGuid,
                                                LabelsAndEventClasses::EXECUTION_OF_GUID,
@@ -956,11 +963,11 @@
     // Start Input workload execution life
     // Event packet - timeline, threadId, eventGuid
     ProfilingGuid inputWorkloadExecutionSOLEventId = VerifyTimelineEventBinaryPacket(
-        EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset);
+        arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
 
     // Input workload execution - event relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                inputWorkloadExecutionGuid,
                                                inputWorkloadExecutionSOLEventId,
                                                LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS,
@@ -970,11 +977,11 @@
     // End of Input workload execution life
     // Event packet - timeline, threadId, eventGuid
     ProfilingGuid inputWorkloadExecutionEOLEventId = VerifyTimelineEventBinaryPacket(
-        EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset);
+        arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
 
     // Input workload execution - event relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                inputWorkloadExecutionGuid,
                                                inputWorkloadExecutionEOLEventId,
                                                LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS,
@@ -984,11 +991,11 @@
     // Conv2d workload execution
     // Conv2d workload execution entity
     ProfilingGuid conv2DWorkloadExecutionGuid = VerifyTimelineEntityBinaryPacketData(
-        EmptyOptional(), readableData, offset);
+        arm::pipe::EmptyOptional(), readableData, offset);
 
     // Entity - Type relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                conv2DWorkloadExecutionGuid,
                                                LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID,
                                                LabelsAndEventClasses::TYPE_GUID,
@@ -997,7 +1004,7 @@
 
     // Inference - Workload execution relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                inferenceGuid,
                                                conv2DWorkloadExecutionGuid,
                                                LabelsAndEventClasses::CHILD_GUID,
@@ -1006,7 +1013,7 @@
 
     // Workload - Workload execution relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                conv2DWorkloadGuid,
                                                conv2DWorkloadExecutionGuid,
                                                LabelsAndEventClasses::EXECUTION_OF_GUID,
@@ -1016,11 +1023,11 @@
     // Start Conv2d workload execution life
     // Event packet - timeline, threadId, eventGuid
     ProfilingGuid conv2DWorkloadExecutionSOLEventGuid = VerifyTimelineEventBinaryPacket(
-        EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset);
+        arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
 
     // Conv2d workload execution - event relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                conv2DWorkloadExecutionGuid,
                                                conv2DWorkloadExecutionSOLEventGuid,
                                                LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS,
@@ -1030,11 +1037,11 @@
     // End of Conv2d workload execution life
     // Event packet - timeline, threadId, eventGuid
     ProfilingGuid conv2DWorkloadExecutionEOLEventGuid = VerifyTimelineEventBinaryPacket(
-        EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset);
+        arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
 
     // Conv2d workload execution - event relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                conv2DWorkloadExecutionGuid,
                                                conv2DWorkloadExecutionEOLEventGuid,
                                                LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS,
@@ -1044,11 +1051,11 @@
     // Abs workload execution
     // Abs workload execution entity
     ProfilingGuid absWorkloadExecutionGuid = VerifyTimelineEntityBinaryPacketData(
-        EmptyOptional(), readableData, offset);
+        arm::pipe::EmptyOptional(), readableData, offset);
 
     // Entity - Type relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                absWorkloadExecutionGuid,
                                                LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID,
                                                LabelsAndEventClasses::TYPE_GUID,
@@ -1057,7 +1064,7 @@
 
     // Inference - Workload execution relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                inferenceGuid,
                                                absWorkloadExecutionGuid,
                                                LabelsAndEventClasses::CHILD_GUID,
@@ -1066,7 +1073,7 @@
 
     // Workload - Workload execution relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                absWorkloadGuid,
                                                absWorkloadExecutionGuid,
                                                LabelsAndEventClasses::EXECUTION_OF_GUID,
@@ -1076,11 +1083,11 @@
     // Start Abs workload execution life
     // Event packet - timeline, threadId, eventGuid
     ProfilingGuid absWorkloadExecutionSOLEventGuid = VerifyTimelineEventBinaryPacket(
-        EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset);
+        arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
 
     // Abs workload execution - event relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                absWorkloadExecutionGuid,
                                                absWorkloadExecutionSOLEventGuid,
                                                LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS,
@@ -1090,11 +1097,11 @@
     // End of Abs workload execution life
     // Event packet - timeline, threadId, eventGuid
     ProfilingGuid absWorkloadExecutionEOLEventGuid = VerifyTimelineEventBinaryPacket(
-        EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset);
+        arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
 
     // Abs workload execution - event relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                absWorkloadExecutionGuid,
                                                absWorkloadExecutionEOLEventGuid,
                                                LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS,
@@ -1104,11 +1111,11 @@
     // Output workload execution
     // Output workload execution entity
     ProfilingGuid outputWorkloadExecutionGuid = VerifyTimelineEntityBinaryPacketData(
-        EmptyOptional(), readableData, offset);
+        arm::pipe::EmptyOptional(), readableData, offset);
 
     // Entity - Type relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                outputWorkloadExecutionGuid,
                                                LabelsAndEventClasses::WORKLOAD_EXECUTION_GUID,
                                                LabelsAndEventClasses::TYPE_GUID,
@@ -1117,7 +1124,7 @@
 
     // Inference - Workload execution relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                inferenceGuid,
                                                outputWorkloadExecutionGuid,
                                                LabelsAndEventClasses::CHILD_GUID,
@@ -1126,7 +1133,7 @@
 
     // Workload - Workload execution relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                outputWorkloadGuid,
                                                outputWorkloadExecutionGuid,
                                                LabelsAndEventClasses::EXECUTION_OF_GUID,
@@ -1136,11 +1143,11 @@
     // Start Output workload execution life
     // Event packet - timeline, threadId, eventGuid
     ProfilingGuid outputWorkloadExecutionSOLEventGuid = VerifyTimelineEventBinaryPacket(
-        EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset);
+        arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
 
     // Output workload execution - event relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                outputWorkloadExecutionGuid,
                                                outputWorkloadExecutionSOLEventGuid,
                                                LabelsAndEventClasses::ARMNN_PROFILING_SOL_EVENT_CLASS,
@@ -1150,11 +1157,11 @@
     // End of Normalize workload execution life
     // Event packet - timeline, threadId, eventGuid
     ProfilingGuid outputWorkloadExecutionEOLEventGuid = VerifyTimelineEventBinaryPacket(
-        EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset);
+        arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
 
     // Output workload execution - event relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                outputWorkloadExecutionGuid,
                                                outputWorkloadExecutionEOLEventGuid,
                                                LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS,
@@ -1164,11 +1171,11 @@
     // End of Inference life
     // Event packet - timeline, threadId, eventGuid
     ProfilingGuid inferenceEOLEventGuid = VerifyTimelineEventBinaryPacket(
-        EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset);
+        arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
 
     // Inference - event relationship
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                inferenceGuid,
                                                inferenceEOLEventGuid,
                                                LabelsAndEventClasses::ARMNN_PROFILING_EOL_EVENT_CLASS,
diff --git a/src/profiling/test/ProfilingTestUtils.hpp b/src/profiling/test/ProfilingTestUtils.hpp
index 32db72a..b4aa372 100644
--- a/src/profiling/test/ProfilingTestUtils.hpp
+++ b/src/profiling/test/ProfilingTestUtils.hpp
@@ -8,10 +8,10 @@
 #include "ProfilingUtils.hpp"
 #include "Runtime.hpp"
 
-#include <armnn/Optional.hpp>
 #include <BufferManager.hpp>
 #include <ProfilingService.hpp>
 
+#include <common/include/Optional.hpp>
 #include <common/include/ProfilingGuid.hpp>
 
 using namespace armnn;
@@ -30,7 +30,7 @@
                                 unsigned int& offset,
                                 uint32_t packetDataLength);
 
-ProfilingGuid VerifyTimelineLabelBinaryPacketData(Optional<ProfilingGuid> guid,
+ProfilingGuid VerifyTimelineLabelBinaryPacketData(arm::pipe::Optional<ProfilingGuid> guid,
                                                   const std::string& label,
                                                   const unsigned char* readableData,
                                                   unsigned int& offset);
@@ -41,20 +41,20 @@
                                               unsigned int& offset);
 
 void VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType relationshipType,
-                                                Optional<ProfilingGuid> relationshipGuid,
-                                                Optional<ProfilingGuid> headGuid,
-                                                Optional<ProfilingGuid> tailGuid,
-                                                Optional<ProfilingGuid> attributeGuid,
+                                                arm::pipe::Optional<ProfilingGuid> relationshipGuid,
+                                                arm::pipe::Optional<ProfilingGuid> headGuid,
+                                                arm::pipe::Optional<ProfilingGuid> tailGuid,
+                                                arm::pipe::Optional<ProfilingGuid> attributeGuid,
                                                 const unsigned char* readableData,
                                                 unsigned int& offset);
 
-ProfilingGuid VerifyTimelineEntityBinaryPacketData(Optional<ProfilingGuid> guid,
+ProfilingGuid VerifyTimelineEntityBinaryPacketData(arm::pipe::Optional<ProfilingGuid> guid,
                                                    const unsigned char* readableData,
                                                    unsigned int& offset);
 
-ProfilingGuid VerifyTimelineEventBinaryPacket(Optional<uint64_t> timestamp,
-                                              Optional<int> threadId,
-                                              Optional<ProfilingGuid> eventGuid,
+ProfilingGuid VerifyTimelineEventBinaryPacket(arm::pipe::Optional<uint64_t> timestamp,
+                                              arm::pipe::Optional<int> threadId,
+                                              arm::pipe::Optional<ProfilingGuid> eventGuid,
                                               const unsigned char* readableData,
                                               unsigned int& offset);
 
diff --git a/src/profiling/test/ProfilingTests.cpp b/src/profiling/test/ProfilingTests.cpp
index 0851318..d635ca3 100644
--- a/src/profiling/test/ProfilingTests.cpp
+++ b/src/profiling/test/ProfilingTests.cpp
@@ -1432,8 +1432,8 @@
                                                                      123.45f,
                                                                      "valid name 3",
                                                                      "valid description",
-                                                                     armnn::EmptyOptional(),// Units
-                                                                     armnn::EmptyOptional(),// Number of cores
+                                                                     arm::pipe::EmptyOptional(),// Units
+                                                                     arm::pipe::EmptyOptional(),// Number of cores
                                                                      0));                   // Device UID
     CHECK(counterDirectory.GetCounterCount() == 3);
     CHECK(counterWoDevice);
@@ -1459,8 +1459,8 @@
                                                                 123.45f,
                                                                 "valid name 4",
                                                                 "valid description",
-                                                                armnn::EmptyOptional(),    // Units
-                                                                armnn::EmptyOptional(),    // Number of cores
+                                                                arm::pipe::EmptyOptional(),    // Units
+                                                                arm::pipe::EmptyOptional(),    // Number of cores
                                                                 100),                      // Device UID
                       arm::pipe::InvalidArgumentException);
     CHECK(counterDirectory.GetCounterCount() == 3);
@@ -1486,8 +1486,8 @@
                                                                     123.45f,
                                                                     "valid name 5",
                                                                     std::string("valid description"),
-                                                                    armnn::EmptyOptional(), // Units
-                                                                    armnn::EmptyOptional(), // Number of cores
+                                                                    arm::pipe::EmptyOptional(), // Units
+                                                                    arm::pipe::EmptyOptional(), // Number of cores
                                                                     device->m_Uid));        // Device UID
     CHECK(counterDirectory.GetCounterCount() == 4);
     CHECK(counterWDevice);
@@ -1514,9 +1514,9 @@
                                                                          123.45f,
                                                                          "valid name 6",
                                                                          "valid description",
-                                                                         armnn::EmptyOptional(),// Units
-                                                                         armnn::EmptyOptional(),// No of cores
-                                                                         armnn::EmptyOptional(),// Device UID
+                                                                         arm::pipe::EmptyOptional(),// Units
+                                                                         arm::pipe::EmptyOptional(),// No of cores
+                                                                         arm::pipe::EmptyOptional(),// Device UID
                                                                          0));               // CounterSet UID
     CHECK(counterDirectory.GetCounterCount() == 5);
     CHECK(counterWoCounterSet);
@@ -1543,8 +1543,8 @@
                                                                  "valid ",
                                                                  "name 7",
                                                                  std::string("valid description"),
-                                                                 armnn::EmptyOptional(),    // Units
-                                                                 armnn::EmptyOptional(),    // Number of cores
+                                                                 arm::pipe::EmptyOptional(),    // Units
+                                                                 arm::pipe::EmptyOptional(),    // Number of cores
                                                                  100),            // Counter set UID
                       arm::pipe::InvalidArgumentException);
     CHECK(counterDirectory.GetCounterCount() == 5);
@@ -1556,10 +1556,10 @@
     CHECK_NOTHROW(counterWNumberOfCores = counterDirectory.RegisterCounter(
                              armnn::profiling::BACKEND_ID, 50,
                              categoryName, 0, 1, 123.45f, "valid name 8", "valid description",
-                             armnn::EmptyOptional(),      // Units
+                             arm::pipe::EmptyOptional(),      // Units
                              numberOfCores,               // Number of cores
-                             armnn::EmptyOptional(),      // Device UID
-                             armnn::EmptyOptional()));    // Counter set UID
+                             arm::pipe::EmptyOptional(),      // Device UID
+                             arm::pipe::EmptyOptional()));    // Counter set UID
     CHECK(counterDirectory.GetCounterCount() == 20);
     CHECK(counterWNumberOfCores);
     CHECK(counterWNumberOfCores->m_Uid > counter->m_Uid);
@@ -1594,10 +1594,10 @@
     CHECK_NOTHROW(counterWMultiCoreDevice = counterDirectory.RegisterCounter(
                              armnn::profiling::BACKEND_ID, 19, categoryName, 0, 1,
                              123.45f, "valid name 9", "valid description",
-                             armnn::EmptyOptional(),      // Units
-                             armnn::EmptyOptional(),      // Number of cores
+                             arm::pipe::EmptyOptional(),      // Units
+                             arm::pipe::EmptyOptional(),      // Number of cores
                              multiCoreDevice->m_Uid,      // Device UID
-                             armnn::EmptyOptional()));    // Counter set UID
+                             arm::pipe::EmptyOptional()));    // Counter set UID
     CHECK(counterDirectory.GetCounterCount() == 24);
     CHECK(counterWMultiCoreDevice);
     CHECK(counterWMultiCoreDevice->m_Uid > counter->m_Uid);
@@ -1642,10 +1642,10 @@
                                                     123.45f,
                                                     "valid name 10",
                                                     "valid description",
-                                                    armnn::EmptyOptional(),  // Units
+                                                    arm::pipe::EmptyOptional(),  // Units
                                                     numberOfCourse,          // Number of cores
-                                                    armnn::EmptyOptional(),  // Device UID
-                                                    armnn::EmptyOptional()));// Counter set UID
+                                                    arm::pipe::EmptyOptional(),  // Device UID
+                                                    arm::pipe::EmptyOptional()));// Counter set UID
     CHECK(counterDirectory.GetCounterCount() == 26);
     CHECK(counterWMultiCoreDeviceWParentCategory);
     CHECK(counterWMultiCoreDeviceWParentCategory->m_Uid > counter->m_Uid);
@@ -1679,9 +1679,9 @@
     CHECK_NOTHROW(counterWCounterSet = counterDirectory.RegisterCounter(
                              armnn::profiling::BACKEND_ID, 300,
                              categoryName, 0, 1, 123.45f, "valid name 11", "valid description",
-                             armnn::EmptyOptional(),    // Units
+                             arm::pipe::EmptyOptional(),    // Units
                              0,                         // Number of cores
-                             armnn::EmptyOptional(),    // Device UID
+                             arm::pipe::EmptyOptional(),    // Device UID
                              counterSet->m_Uid));       // Counter set UID
     CHECK(counterDirectory.GetCounterCount() == 27);
     CHECK(counterWCounterSet);
@@ -1703,7 +1703,7 @@
     CHECK_NOTHROW(counterWDeviceWCounterSet = counterDirectory.RegisterCounter(
                              armnn::profiling::BACKEND_ID, 23,
                              categoryName, 0, 1, 123.45f, "valid name 12", "valid description",
-                             armnn::EmptyOptional(),    // Units
+                             arm::pipe::EmptyOptional(),    // Units
                              1,                         // Number of cores
                              device->m_Uid,             // Device UID
                              counterSet->m_Uid));       // Counter set UID
@@ -1737,8 +1737,8 @@
     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
+                                                                    arm::pipe::EmptyOptional(), // Units
+                                                                    arm::pipe::EmptyOptional(), // Number of cores
                                                                     device->m_Uid,          // Device UID
                                                                     counterSet->m_Uid));    // Counter set UID
     CHECK(counterDirectory.GetCounterCount() == 29);
diff --git a/src/profiling/test/SendCounterPacketTests.cpp b/src/profiling/test/SendCounterPacketTests.cpp
index abd4cee..bdc1d51 100644
--- a/src/profiling/test/SendCounterPacketTests.cpp
+++ b/src/profiling/test/SendCounterPacketTests.cpp
@@ -1251,7 +1251,7 @@
                                                               "counter2",
                                                               "counter2description",
                                                               std::string("counter2units"),
-                                                              armnn::EmptyOptional(),
+                                                              arm::pipe::EmptyOptional(),
                                                               device2->m_Uid,
                                                               0));
     CHECK(counterDirectory.GetCounterCount() == 5);
@@ -1267,7 +1267,7 @@
                                                               0.0000045399f,
                                                               "counter3",
                                                               "counter3description",
-                                                              armnn::EmptyOptional(),
+                                                              arm::pipe::EmptyOptional(),
                                                               numberOfCores,
                                                               device2->m_Uid,
                                                               counterSet1->m_Uid));
diff --git a/src/profiling/test/SendCounterPacketTests.hpp b/src/profiling/test/SendCounterPacketTests.hpp
index 1f1c3f0..626377a 100644
--- a/src/profiling/test/SendCounterPacketTests.hpp
+++ b/src/profiling/test/SendCounterPacketTests.hpp
@@ -10,8 +10,6 @@
 #include <ProfilingUtils.hpp>
 #include <IProfilingConnectionFactory.hpp>
 
-#include <armnn/Optional.hpp>
-
 #include <common/include/IgnoreUnused.hpp>
 #include <common/include/NumericCast.hpp>
 
diff --git a/src/profiling/test/TimelineUtilityMethodsTests.cpp b/src/profiling/test/TimelineUtilityMethodsTests.cpp
index 422bc13..7e95df1 100644
--- a/src/profiling/test/TimelineUtilityMethodsTests.cpp
+++ b/src/profiling/test/TimelineUtilityMethodsTests.cpp
@@ -60,13 +60,13 @@
     VerifyTimelineHeaderBinary(readableData, offset, 68);
 
     // First dataset sent: TimelineLabelBinaryPacket
-    VerifyTimelineLabelBinaryPacketData(EmptyOptional(), entityName, readableData, offset);
+    VerifyTimelineLabelBinaryPacketData(arm::pipe::EmptyOptional(), entityName, readableData, offset);
 
     // Second dataset sent: TimelineRelationshipBinaryPacket
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                entityGuid,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                labelTypeGuid,
                                                readableData,
                                                offset);
@@ -251,28 +251,28 @@
     VerifyTimelineHeaderBinary(readableData, offset, 188);
 
     // First dataset sent: TimelineEntityBinaryPacket
-    VerifyTimelineEntityBinaryPacketData(EmptyOptional(), readableData, offset);
+    VerifyTimelineEntityBinaryPacketData(arm::pipe::EmptyOptional(), readableData, offset);
 
     // Second dataset sent: TimelineLabelBinaryPacket
-    VerifyTimelineLabelBinaryPacketData(EmptyOptional(), entityName, readableData, offset);
+    VerifyTimelineLabelBinaryPacketData(arm::pipe::EmptyOptional(), entityName, readableData, offset);
 
     // Third dataset sent: TimelineRelationshipBinaryPacket
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
-                                               EmptyOptional(),
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                LabelsAndEventClasses::NAME_GUID,
                                                readableData,
                                                offset);
 
     // Fifth dataset sent: TimelineLabelBinaryPacket
-    VerifyTimelineLabelBinaryPacketData(EmptyOptional(), entityType, readableData, offset);
+    VerifyTimelineLabelBinaryPacketData(arm::pipe::EmptyOptional(), entityType, readableData, offset);
 
     // Sixth dataset sent: TimelineRelationshipBinaryPacket
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
-                                               EmptyOptional(),
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                LabelsAndEventClasses::TYPE_GUID,
                                                readableData,
                                                offset);
@@ -280,10 +280,10 @@
 
     // Eighth dataset sent: TimelineRelationshipBinaryPacket
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::RetentionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                parentEntityGuid,
-                                               EmptyOptional(),
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                readableData,
                                                offset);
 
@@ -386,26 +386,26 @@
 
     // Packets for Name Entity
     // First dataset sent: TimelineLabelBinaryPacket
-    VerifyTimelineLabelBinaryPacketData(EmptyOptional(), entityName, readableData, offset);
+    VerifyTimelineLabelBinaryPacketData(arm::pipe::EmptyOptional(), entityName, readableData, offset);
 
     // Second dataset sent: TimelineRelationshipBinaryPacket
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
-                                               EmptyOptional(),
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                LabelsAndEventClasses::NAME_GUID,
                                                readableData,
                                                offset);
 
     // Packets for Type Entity
     // First dataset sent: TimelineLabelBinaryPacket
-    VerifyTimelineLabelBinaryPacketData(EmptyOptional(), entityType, readableData, offset);
+    VerifyTimelineLabelBinaryPacketData(arm::pipe::EmptyOptional(), entityType, readableData, offset);
 
     // Second dataset sent: TimelineRelationshipBinaryPacket
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::LabelLink,
-                                               EmptyOptional(),
-                                               EmptyOptional(),
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                LabelsAndEventClasses::TYPE_GUID,
                                                readableData,
                                                offset);
@@ -451,11 +451,12 @@
     VerifyTimelineHeaderBinary(readableData, offset, 60 + ThreadIdSize);
 
     // First dataset sent: TimelineEntityBinaryPacket
-    VerifyTimelineEventBinaryPacket(EmptyOptional(), EmptyOptional(), EmptyOptional(), readableData, offset);
+    VerifyTimelineEventBinaryPacket(
+        arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), arm::pipe::EmptyOptional(), readableData, offset);
 
     // Second dataset sent: TimelineRelationshipBinaryPacket
     VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType::ExecutionLink,
-                                               EmptyOptional(),
+                                               arm::pipe::EmptyOptional(),
                                                entityGuid,
                                                eventGuid,
                                                eventClassGuid,