IVGCVSW-4246 Clean build profiling with -Wextra

Change-Id: Ieab870fa2194075433a0a26abdb13f69e1fbaaae
Signed-off-by: Derek Lamberti <derek.lamberti@arm.com>
diff --git a/src/profiling/CommandHandlerFunctor.hpp b/src/profiling/CommandHandlerFunctor.hpp
index 4d6dfa0..ea76d10 100644
--- a/src/profiling/CommandHandlerFunctor.hpp
+++ b/src/profiling/CommandHandlerFunctor.hpp
@@ -7,6 +7,8 @@
 
 #include <cstdint>
 
+#include <boost/core/ignore_unused.hpp>
+
 namespace armnn
 {
 
@@ -28,7 +30,7 @@
     uint32_t GetPacketId() const;
     uint32_t GetVersion()  const;
 
-    virtual void operator()(const Packet& packet) {}
+    virtual void operator()(const Packet& packet) = 0;
 
     virtual ~CommandHandlerFunctor() {}
 
diff --git a/src/profiling/FileOnlyProfilingConnection.cpp b/src/profiling/FileOnlyProfilingConnection.cpp
index 004e27d..7586261 100644
--- a/src/profiling/FileOnlyProfilingConnection.cpp
+++ b/src/profiling/FileOnlyProfilingConnection.cpp
@@ -40,6 +40,8 @@
 
 bool FileOnlyProfilingConnection::WaitForStreamMeta(const unsigned char* buffer, uint32_t length)
 {
+    boost::ignore_unused(length);
+
     // The first word, stream_metadata_identifer, should always be 0.
     if (ToUint32(buffer, TargetEndianness::BeWire) != 0)
     {
diff --git a/src/profiling/PacketVersionResolver.cpp b/src/profiling/PacketVersionResolver.cpp
index 3737e3c..869f09e 100644
--- a/src/profiling/PacketVersionResolver.cpp
+++ b/src/profiling/PacketVersionResolver.cpp
@@ -5,6 +5,8 @@
 
 #include "PacketVersionResolver.hpp"
 
+#include <boost/core/ignore_unused.hpp>
+
 namespace armnn
 {
 
@@ -52,6 +54,7 @@
 
 Version PacketVersionResolver::ResolvePacketVersion(uint32_t familyId, uint32_t packetId) const
 {
+    boost::ignore_unused(familyId, packetId);
     // NOTE: For now every packet specification is at version 1.0.0
     return Version(1, 0, 0);
 }
diff --git a/src/profiling/ProfilingStateMachine.hpp b/src/profiling/ProfilingStateMachine.hpp
index d070744..160de71 100644
--- a/src/profiling/ProfilingStateMachine.hpp
+++ b/src/profiling/ProfilingStateMachine.hpp
@@ -7,6 +7,8 @@
 
 #include <atomic>
 
+#include <boost/core/ignore_unused.hpp>
+
 namespace armnn
 {
 
@@ -33,6 +35,7 @@
 
     bool IsOneOfStates(ProfilingState state1)
     {
+        boost::ignore_unused(state1);
         return false;
     }
 
diff --git a/src/profiling/test/ProfilingTests.cpp b/src/profiling/test/ProfilingTests.cpp
index 647870a..1519cd4 100644
--- a/src/profiling/test/ProfilingTests.cpp
+++ b/src/profiling/test/ProfilingTests.cpp
@@ -718,7 +718,6 @@
     std::vector<uint16_t> counterUids;
     BOOST_CHECK_NO_THROW(counterUids = GetNextCounterUids(uid,0));
     BOOST_CHECK(counterUids.size() == 1);
-    BOOST_CHECK(counterUids[0] >= 0);
 
     std::vector<uint16_t> nextCounterUids;
     BOOST_CHECK_NO_THROW(nextCounterUids = GetNextCounterUids(nextUid, 2));
@@ -1318,7 +1317,6 @@
                                                    "valid description"));
     BOOST_CHECK(counterDirectory.GetCounterCount() == 1);
     BOOST_CHECK(counter);
-    BOOST_CHECK(counter->m_Uid >= 0);
     BOOST_CHECK(counter->m_MaxCounterUid == counter->m_Uid);
     BOOST_CHECK(counter->m_Class == 0);
     BOOST_CHECK(counter->m_Interpolation == 1);
@@ -1360,7 +1358,6 @@
                                                                              std::string("Mnnsq2")));    // Units
     BOOST_CHECK(counterDirectory.GetCounterCount() == 2);
     BOOST_CHECK(counterWUnits);
-    BOOST_CHECK(counterWUnits->m_Uid >= 0);
     BOOST_CHECK(counterWUnits->m_Uid > counter->m_Uid);
     BOOST_CHECK(counterWUnits->m_MaxCounterUid == counterWUnits->m_Uid);
     BOOST_CHECK(counterWUnits->m_Class == 0);
@@ -1389,7 +1386,6 @@
                                                                                0));                   // Device UID
     BOOST_CHECK(counterDirectory.GetCounterCount() == 3);
     BOOST_CHECK(counterWoDevice);
-    BOOST_CHECK(counterWoDevice->m_Uid >= 0);
     BOOST_CHECK(counterWoDevice->m_Uid > counter->m_Uid);
     BOOST_CHECK(counterWoDevice->m_MaxCounterUid == counterWoDevice->m_Uid);
     BOOST_CHECK(counterWoDevice->m_Class == 0);
@@ -1444,7 +1440,6 @@
                                                                            device->m_Uid));           // Device UID
     BOOST_CHECK(counterDirectory.GetCounterCount() == 4);
     BOOST_CHECK(counterWDevice);
-    BOOST_CHECK(counterWDevice->m_Uid >= 0);
     BOOST_CHECK(counterWDevice->m_Uid > counter->m_Uid);
     BOOST_CHECK(counterWDevice->m_MaxCounterUid == counterWDevice->m_Uid);
     BOOST_CHECK(counterWDevice->m_Class == 0);
@@ -1474,7 +1469,6 @@
                                                                                 0));                   // CounterSet UID
     BOOST_CHECK(counterDirectory.GetCounterCount() == 5);
     BOOST_CHECK(counterWoCounterSet);
-    BOOST_CHECK(counterWoCounterSet->m_Uid >= 0);
     BOOST_CHECK(counterWoCounterSet->m_Uid > counter->m_Uid);
     BOOST_CHECK(counterWoCounterSet->m_MaxCounterUid == counterWoCounterSet->m_Uid);
     BOOST_CHECK(counterWoCounterSet->m_Class == 0);
@@ -1517,7 +1511,6 @@
                              armnn::EmptyOptional()));    // Counter set UID
     BOOST_CHECK(counterDirectory.GetCounterCount() == 20);
     BOOST_CHECK(counterWNumberOfCores);
-    BOOST_CHECK(counterWNumberOfCores->m_Uid >= 0);
     BOOST_CHECK(counterWNumberOfCores->m_Uid > counter->m_Uid);
     BOOST_CHECK(counterWNumberOfCores->m_MaxCounterUid == counterWNumberOfCores->m_Uid + numberOfCores - 1);
     BOOST_CHECK(counterWNumberOfCores->m_Class == 0);
@@ -1556,7 +1549,6 @@
                              armnn::EmptyOptional()));    // Counter set UID
     BOOST_CHECK(counterDirectory.GetCounterCount() == 24);
     BOOST_CHECK(counterWMultiCoreDevice);
-    BOOST_CHECK(counterWMultiCoreDevice->m_Uid >= 0);
     BOOST_CHECK(counterWMultiCoreDevice->m_Uid > counter->m_Uid);
     BOOST_CHECK(counterWMultiCoreDevice->m_MaxCounterUid ==
                 counterWMultiCoreDevice->m_Uid + multiCoreDevice->m_Cores - 1);
@@ -1603,7 +1595,6 @@
                                                                              armnn::EmptyOptional()));// Counter set UID
     BOOST_CHECK(counterDirectory.GetCounterCount() == 26);
     BOOST_CHECK(counterWMultiCoreDeviceWParentCategory);
-    BOOST_CHECK(counterWMultiCoreDeviceWParentCategory->m_Uid >= 0);
     BOOST_CHECK(counterWMultiCoreDeviceWParentCategory->m_Uid > counter->m_Uid);
     BOOST_CHECK(counterWMultiCoreDeviceWParentCategory->m_MaxCounterUid ==
                 counterWMultiCoreDeviceWParentCategory->m_Uid + multiCoreDeviceWParentCategory->m_Cores - 1);
@@ -1643,7 +1634,6 @@
                              counterSet->m_Uid));       // Counter set UID
     BOOST_CHECK(counterDirectory.GetCounterCount() == 27);
     BOOST_CHECK(counterWCounterSet);
-    BOOST_CHECK(counterWCounterSet->m_Uid >= 0);
     BOOST_CHECK(counterWCounterSet->m_Uid > counter->m_Uid);
     BOOST_CHECK(counterWCounterSet->m_MaxCounterUid == counterWCounterSet->m_Uid);
     BOOST_CHECK(counterWCounterSet->m_Class == 0);
@@ -1668,7 +1658,6 @@
                              counterSet->m_Uid));       // Counter set UID
     BOOST_CHECK(counterDirectory.GetCounterCount() == 28);
     BOOST_CHECK(counterWDeviceWCounterSet);
-    BOOST_CHECK(counterWDeviceWCounterSet->m_Uid >= 0);
     BOOST_CHECK(counterWDeviceWCounterSet->m_Uid > counter->m_Uid);
     BOOST_CHECK(counterWDeviceWCounterSet->m_MaxCounterUid == counterWDeviceWCounterSet->m_Uid);
     BOOST_CHECK(counterWDeviceWCounterSet->m_Class == 0);
@@ -1705,7 +1694,6 @@
                                                                            counterSet->m_Uid));       // Counter set UID
     BOOST_CHECK(counterDirectory.GetCounterCount() == 29);
     BOOST_CHECK(anotherCounter);
-    BOOST_CHECK(anotherCounter->m_Uid >= 0);
     BOOST_CHECK(anotherCounter->m_MaxCounterUid == anotherCounter->m_Uid);
     BOOST_CHECK(anotherCounter->m_Class == 1);
     BOOST_CHECK(anotherCounter->m_Interpolation == 0);
@@ -1737,6 +1725,7 @@
     {
         bool IsCounterRegistered(uint16_t counterUid) const override
         {
+            boost::ignore_unused(counterUid);
             return true;
         }
         uint16_t GetCounterCount() const override
@@ -1745,6 +1734,7 @@
         }
         uint32_t GetCounterValue(uint16_t counterUid) const override
         {
+            boost::ignore_unused(counterUid);
             return 0;
         }
     };
@@ -2109,6 +2099,7 @@
         //not used
         bool IsCounterRegistered(uint16_t counterUid) const override
         {
+            boost::ignore_unused(counterUid);
             return false;
         }
 
diff --git a/src/profiling/test/ProfilingTests.hpp b/src/profiling/test/ProfilingTests.hpp
index cfac691..208fb80 100644
--- a/src/profiling/test/ProfilingTests.hpp
+++ b/src/profiling/test/ProfilingTests.hpp
@@ -75,7 +75,12 @@
 
     void Close() override {}
 
-    bool WritePacket(const unsigned char* buffer, uint32_t length) override { return false; }
+    bool WritePacket(const unsigned char* buffer, uint32_t length) override
+    {
+        boost::ignore_unused(buffer, length);
+
+        return false;
+    }
 
     Packet ReadPacket(uint32_t timeout) override
     {
@@ -134,6 +139,7 @@
 
     Packet ReadPacket(uint32_t timeout) override
     {
+        boost::ignore_unused(timeout);
         ++m_ReadRequests;
         throw armnn::Exception("Simulate a non-timeout error");
     }
@@ -156,6 +162,7 @@
 
     void operator()(const Packet& packet) override
     {
+        boost::ignore_unused(packet);
         m_Count++;
     }
 
diff --git a/src/profiling/test/SendCounterPacketTests.hpp b/src/profiling/test/SendCounterPacketTests.hpp
index 79ebcd6..d0b13b5 100644
--- a/src/profiling/test/SendCounterPacketTests.hpp
+++ b/src/profiling/test/SendCounterPacketTests.hpp
@@ -67,13 +67,15 @@
 
     Packet ReadPacket(uint32_t timeout) override
     {
+        boost::ignore_unused(timeout);
+
         // Simulate a delay in the reading process. The default timeout is way too long.
         std::this_thread::sleep_for(std::chrono::milliseconds(5));
         std::lock_guard<std::mutex> lock(m_Mutex);
         return std::move(m_Packet);
     }
 
-    const std::vector<uint32_t> GetWrittenData()
+    std::vector<uint32_t> GetWrittenData()
     {
         std::lock_guard<std::mutex> lock(m_Mutex);
 
@@ -82,7 +84,7 @@
         return writtenData;
     }
 
-    const bool HasWrittenData()
+    bool HasWrittenData() const
     {
         std::lock_guard<std::mutex> lock(m_Mutex);
         return !m_WrittenData.empty();
@@ -107,6 +109,7 @@
 public:
     IProfilingConnectionPtr GetProfilingConnection(const ExternalProfilingOptions& options) const override
     {
+        boost::ignore_unused(options);
         return std::make_unique<MockProfilingConnection>();
     }
 };
@@ -295,6 +298,8 @@
 
     void SendCounterDirectoryPacket(const ICounterDirectory& counterDirectory) override
     {
+        boost::ignore_unused(counterDirectory);
+
         std::string message("SendCounterDirectoryPacket");
         unsigned int reserved = 0;
         IPacketBufferPtr buffer = m_BufferManager.Reserve(1024, reserved);
@@ -305,6 +310,8 @@
     void SendPeriodicCounterCapturePacket(uint64_t timestamp,
                                           const std::vector<std::pair<uint16_t, uint32_t>>& values) override
     {
+        boost::ignore_unused(timestamp, values);
+
         std::string message("SendPeriodicCounterCapturePacket");
         unsigned int reserved = 0;
         IPacketBufferPtr buffer = m_BufferManager.Reserve(1024, reserved);
@@ -315,6 +322,8 @@
     void SendPeriodicCounterSelectionPacket(uint32_t capturePeriod,
                                             const std::vector<uint16_t>& selectedCounterIds) override
     {
+        boost::ignore_unused(capturePeriod, selectedCounterIds);
+
         std::string message("SendPeriodicCounterSelectionPacket");
         unsigned int reserved = 0;
         IPacketBufferPtr buffer = m_BufferManager.Reserve(1024, reserved);
@@ -515,16 +524,19 @@
 
     const Device* GetDevice(uint16_t uid) const override
     {
+        boost::ignore_unused(uid);
         return nullptr; // Not used by the unit tests
     }
 
     const CounterSet* GetCounterSet(uint16_t uid) const override
     {
+        boost::ignore_unused(uid);
         return nullptr; // Not used by the unit tests
     }
 
     const Counter* GetCounter(uint16_t uid) const override
     {
+        boost::ignore_unused(uid);
         return nullptr; // Not used by the unit tests
     }