IVGCVSW-5295 Remove boost::format from armnn profiling

 * Replace all instances of boost::format with fmt::format from armnn/src/profiling

Signed-off-by: Jan Eilers <jan.eilers@arm.com>
Change-Id: I4722bdde52c740bc9bdce969128074a34a3ee75e
diff --git a/src/profiling/ActivateTimelineReportingCommandHandler.cpp b/src/profiling/ActivateTimelineReportingCommandHandler.cpp
index 6d5f32f..77df76f2fe 100644
--- a/src/profiling/ActivateTimelineReportingCommandHandler.cpp
+++ b/src/profiling/ActivateTimelineReportingCommandHandler.cpp
@@ -7,7 +7,7 @@
 #include "TimelineUtilityMethods.hpp"
 
 #include <armnn/Exceptions.hpp>
-#include <boost/format.hpp>
+#include <fmt/format.h>
 
 namespace armnn
 {
@@ -30,9 +30,9 @@
         case ProfilingState::Uninitialised:
         case ProfilingState::NotConnected:
         case ProfilingState::WaitingForAck:
-            throw RuntimeException(boost::str(
-                boost::format("Activate Timeline Reporting Command Handler invoked while in a wrong state: %1%")
-                    % GetProfilingStateName(currentState)));
+            throw RuntimeException(fmt::format(
+                    "Activate Timeline Reporting Command Handler invoked while in a wrong state: {}",
+                    GetProfilingStateName(currentState)));
         case ProfilingState::Active:
             if ( !( packet.GetPacketFamily() == 0u && packet.GetPacketId() == 6u ))
             {
@@ -56,8 +56,8 @@
 
             break;
         default:
-            throw RuntimeException(boost::str(boost::format("Unknown profiling service state: %1%")
-                                                  % static_cast<int>(currentState)));
+            throw RuntimeException(fmt::format("Unknown profiling service state: {}",
+                                               static_cast<int>(currentState)));
     }
 }
 
diff --git a/src/profiling/ConnectionAcknowledgedCommandHandler.cpp b/src/profiling/ConnectionAcknowledgedCommandHandler.cpp
index 7fa3785..c61c091 100644
--- a/src/profiling/ConnectionAcknowledgedCommandHandler.cpp
+++ b/src/profiling/ConnectionAcknowledgedCommandHandler.cpp
@@ -8,7 +8,7 @@
 
 #include <armnn/Exceptions.hpp>
 
-#include <boost/format.hpp>
+#include <fmt/format.h>
 
 namespace armnn
 {
@@ -23,17 +23,17 @@
     {
     case ProfilingState::Uninitialised:
     case ProfilingState::NotConnected:
-        throw RuntimeException(boost::str(boost::format("Connection Acknowledged Command Handler invoked while in an "
-                                                        "wrong state: %1%")
-                                          % GetProfilingStateName(currentState)));
+        throw RuntimeException(fmt::format("Connection Acknowledged Command Handler invoked while in an "
+                                           "wrong state: {}",
+                                           GetProfilingStateName(currentState)));
     case ProfilingState::WaitingForAck:
         // Process the packet
         if (!(packet.GetPacketFamily() == 0u && packet.GetPacketId() == 1u))
         {
-            throw armnn::InvalidArgumentException(boost::str(boost::format("Expected Packet family = 0, id = 1 but "
-                                                                           "received family = %1%, id = %2%")
-                                                  % packet.GetPacketFamily()
-                                                  % packet.GetPacketId()));
+            throw armnn::InvalidArgumentException(fmt::format("Expected Packet family = 0, id = 1 but "
+                                                              "received family = {}, id = {}",
+                                                              packet.GetPacketFamily(),
+                                                              packet.GetPacketId()));
         }
 
         // Once a Connection Acknowledged packet has been received, move to the Active state immediately
@@ -67,8 +67,8 @@
     case ProfilingState::Active:
         return; // NOP
     default:
-        throw RuntimeException(boost::str(boost::format("Unknown profiling service state: %1%")
-                                          % static_cast<int>(currentState)));
+        throw RuntimeException(fmt::format("Unknown profiling service state: {}",
+                                           static_cast<int>(currentState)));
     }
 }
 
diff --git a/src/profiling/CounterDirectory.cpp b/src/profiling/CounterDirectory.cpp
index e6356b8..9ef379a 100644
--- a/src/profiling/CounterDirectory.cpp
+++ b/src/profiling/CounterDirectory.cpp
@@ -12,7 +12,7 @@
 
 #include <common/include/SwTrace.hpp>
 
-#include <boost/format.hpp>
+#include <fmt/format.h>
 
 namespace armnn
 {
@@ -32,9 +32,8 @@
     // Check that the given category is not already registered
     if (IsCategoryRegistered(categoryName))
     {
-        throw InvalidArgumentException(
-                    boost::str(boost::format("Trying to register a category already registered (\"%1%\")")
-                               % categoryName));
+        throw InvalidArgumentException(fmt::format("Trying to register a category already registered (\"{}\")",
+                                       categoryName));
     }
 
     // Create the category
@@ -65,9 +64,8 @@
     // Check that a device with the given name is not already registered
     if (IsDeviceRegistered(deviceName))
     {
-        throw InvalidArgumentException(
-                    boost::str(boost::format("Trying to register a device already registered (\"%1%\")")
-                               % deviceName));
+        throw InvalidArgumentException(fmt::format("Trying to register a device already registered (\"{}\")",
+                                       deviceName));
     }
 
     // Check that a category with the given (optional) parent category name is already registered
@@ -78,10 +76,10 @@
         if (parentCategoryNameValue.empty())
         {
             throw InvalidArgumentException(
-                        boost::str(boost::format("Trying to connect a device (name: \"%1%\") to an invalid "
-                                                 "parent category (name: \"%2%\")")
-                                   % deviceName
-                                   % parentCategoryNameValue));
+                        fmt::format("Trying to connect a device (name: \"{}\") to an invalid "
+                                    "parent category (name: \"{}\")",
+                                    deviceName,
+                                    parentCategoryNameValue));
         }
 
         // Check that the given parent category is already registered
@@ -89,10 +87,10 @@
         if (categoryIt == m_Categories.end())
         {
             throw InvalidArgumentException(
-                        boost::str(boost::format("Trying to connect a device (name: \"%1%\") to a parent category that "
-                                                 "is not registered (name: \"%2%\")")
-                                   % deviceName
-                                   % parentCategoryNameValue));
+                        fmt::format("Trying to connect a device (name: \"{}\") to a parent category that "
+                                    "is not registered (name: \"{}\")",
+                                    deviceName,
+                                    parentCategoryNameValue));
         }
     }
 
@@ -128,8 +126,8 @@
     if (IsCounterSetRegistered(counterSetName))
     {
         throw InvalidArgumentException(
-                    boost::str(boost::format("Trying to register a counter set already registered (\"%1%\")")
-                               % counterSetName));
+                    fmt::format("Trying to register a counter set already registered (\"{}\")",
+                                counterSetName));
     }
 
     // Peek the next UID, do not get an actual valid UID just now as we don't want to waste a good UID in case
@@ -144,10 +142,10 @@
         if (parentCategoryNameValue.empty())
         {
             throw InvalidArgumentException(
-                        boost::str(boost::format("Trying to connect a counter set (UID: %1%) to an invalid "
-                                                 "parent category (name: \"%2%\")")
-                                   % counterSetUidPeek
-                                   % parentCategoryNameValue));
+                        fmt::format("Trying to connect a counter set (UID: {}) to an invalid "
+                                    "parent category (name: \"{}\")",
+                                    counterSetUidPeek,
+                                    parentCategoryNameValue));
         }
 
         // Check that the given parent category is already registered
@@ -155,10 +153,10 @@
         if (it == m_Categories.end())
         {
             throw InvalidArgumentException(
-                        boost::str(boost::format("Trying to connect a counter set (UID: %1%) to a parent category "
-                                                 "that is not registered (name: \"%2%\")")
-                                   % counterSetUidPeek
-                                   % parentCategoryNameValue));
+                        fmt::format("Trying to connect a counter set (UID: {}) to a parent category "
+                                    "that is not registered (name: \"{}\")",
+                                    counterSetUidPeek,
+                                    parentCategoryNameValue));
         }
     }
 
@@ -246,9 +244,8 @@
     if (categoryIt == m_Categories.end())
     {
         throw InvalidArgumentException(
-                    boost::str(boost::format("Trying to connect a counter to a category "
-                                             "that is not registered (name: \"%1%\")")
-                               % parentCategoryName));
+                    fmt::format("Trying to connect a counter to a category that is not registered (name: \"{}\")",
+                                parentCategoryName));
     }
 
     // Get the parent category
@@ -265,10 +262,10 @@
         if (parentCategoryCounter->m_Name == name)
         {
             throw InvalidArgumentException(
-                        boost::str(boost::format("Trying to register a counter to category \"%1%\" with a name that "
-                                                 "is already used within that category (name: \"%2%\")")
-                                   % parentCategoryName
-                                   % name));
+                        fmt::format("Trying to register a counter to category \"{}\" with a name that "
+                                    "is already used within that category (name: \"{}\")",
+                                    parentCategoryName,
+                                    name));
         }
     }
 
@@ -280,9 +277,9 @@
         if (!IsCounterSetRegistered(counterSetUidValue))
         {
             throw InvalidArgumentException(
-                        boost::str(boost::format("Trying to connect a counter to a counter set that is "
-                                                 "not registered (counter set UID: %1%)")
-                                   % counterSetUidValue));
+                        fmt::format("Trying to connect a counter to a counter set that is "
+                                    "not registered (counter set UID: {})",
+                                    counterSetUidValue));
         }
     }
 
@@ -531,9 +528,8 @@
         if (deviceIt == m_Devices.end())
         {
             throw InvalidArgumentException(
-                        boost::str(boost::format("Trying to connect a counter to a device that is "
-                                                 "not registered (device UID %1%)")
-                                   % deviceUid));
+                        fmt::format("Trying to connect a counter to a device that is not registered (device UID {})",
+                                    deviceUid));
         }
 
         // Get the associated device
diff --git a/src/profiling/DeactivateTimelineReportingCommandHandler.cpp b/src/profiling/DeactivateTimelineReportingCommandHandler.cpp
index bdee83b..37d46c0 100644
--- a/src/profiling/DeactivateTimelineReportingCommandHandler.cpp
+++ b/src/profiling/DeactivateTimelineReportingCommandHandler.cpp
@@ -6,7 +6,7 @@
 #include "DeactivateTimelineReportingCommandHandler.hpp"
 
 #include <armnn/Exceptions.hpp>
-#include <boost/format.hpp>
+#include <fmt/format.h>
 
 
 namespace armnn
@@ -24,9 +24,9 @@
         case ProfilingState::Uninitialised:
         case ProfilingState::NotConnected:
         case ProfilingState::WaitingForAck:
-            throw RuntimeException(boost::str(
-                boost::format("Deactivate Timeline Reporting Command Handler invoked while in a wrong state: %1%")
-                    % GetProfilingStateName(currentState)));
+            throw RuntimeException(fmt::format(
+                    "Deactivate Timeline Reporting Command Handler invoked while in a wrong state: {}",
+                    GetProfilingStateName(currentState)));
         case ProfilingState::Active:
             if (!(packet.GetPacketFamily() == 0u && packet.GetPacketId() == 7u))
             {
@@ -42,8 +42,8 @@
 
             break;
         default:
-            throw RuntimeException(boost::str(boost::format("Unknown profiling service state: %1%")
-                                                  % static_cast<int>(currentState)));
+            throw RuntimeException(fmt::format("Unknown profiling service state: {}",
+                                   static_cast<int>(currentState)));
     }
 }
 
diff --git a/src/profiling/PerJobCounterSelectionCommandHandler.cpp b/src/profiling/PerJobCounterSelectionCommandHandler.cpp
index fea8ee3..9e2f062 100644
--- a/src/profiling/PerJobCounterSelectionCommandHandler.cpp
+++ b/src/profiling/PerJobCounterSelectionCommandHandler.cpp
@@ -6,7 +6,7 @@
 #include "PerJobCounterSelectionCommandHandler.hpp"
 #include <armnn/Exceptions.hpp>
 
-#include <boost/format.hpp>
+#include <fmt/format.h>
 
 namespace armnn
 {
@@ -22,25 +22,25 @@
     case ProfilingState::Uninitialised:
     case ProfilingState::NotConnected:
     case ProfilingState::WaitingForAck:
-        throw armnn::RuntimeException(boost::str(boost::format(
-            "Per-Job Counter Selection Command Handler invoked while in an incorrect state: %1%")
-            % GetProfilingStateName(currentState)));
+        throw armnn::RuntimeException(fmt::format(
+            "Per-Job Counter Selection Command Handler invoked while in an incorrect state: {}",
+            GetProfilingStateName(currentState)));
     case ProfilingState::Active:
         // Process the packet
         if (!(packet.GetPacketFamily() == 0u && packet.GetPacketId() == 5u))
         {
-            throw armnn::InvalidArgumentException(boost::str(boost::format("Expected Packet family = 0, id = 5 but "
-                                                                           "received family = %1%, id = %2%")
-                                                  % packet.GetPacketFamily()
-                                                  % packet.GetPacketId()));
+            throw armnn::InvalidArgumentException(fmt::format("Expected Packet family = 0, id = 5 but "
+                                                              "received family = {}, id = {}",
+                                                              packet.GetPacketFamily(),
+                                                              packet.GetPacketId()));
         }
 
         // Silently drop the packet
 
         break;
     default:
-        throw armnn::RuntimeException(boost::str(boost::format("Unknown profiling service state: %1%")
-                                                 % static_cast<int>(currentState)));
+        throw armnn::RuntimeException(fmt::format("Unknown profiling service state: {}",
+                                                  static_cast<int>(currentState)));
     }
 }
 
diff --git a/src/profiling/PeriodicCounterSelectionCommandHandler.cpp b/src/profiling/PeriodicCounterSelectionCommandHandler.cpp
index e622123..cb14ec0 100644
--- a/src/profiling/PeriodicCounterSelectionCommandHandler.cpp
+++ b/src/profiling/PeriodicCounterSelectionCommandHandler.cpp
@@ -9,7 +9,7 @@
 #include <armnn/Types.hpp>
 #include <armnn/utility/NumericCast.hpp>
 
-#include <boost/format.hpp>
+#include <fmt/format.h>
 
 #include <vector>
 
@@ -65,18 +65,18 @@
     case ProfilingState::Uninitialised:
     case ProfilingState::NotConnected:
     case ProfilingState::WaitingForAck:
-        throw RuntimeException(boost::str(boost::format("Periodic Counter Selection Command Handler invoked while in "
-                                                        "an wrong state: %1%")
-                                          % GetProfilingStateName(currentState)));
+        throw RuntimeException(fmt::format("Periodic Counter Selection Command Handler invoked while in "
+                                           "an wrong state: {}",
+                                           GetProfilingStateName(currentState)));
     case ProfilingState::Active:
     {
         // Process the packet
         if (!(packet.GetPacketFamily() == 0u && packet.GetPacketId() == 4u))
         {
-            throw armnn::InvalidArgumentException(boost::str(boost::format("Expected Packet family = 0, id = 4 but "
-                                                                           "received family = %1%, id = %2%")
-                                                  % packet.GetPacketFamily()
-                                                  % packet.GetPacketId()));
+            throw armnn::InvalidArgumentException(fmt::format("Expected Packet family = 0, id = 4 but "
+                                                              "received family = {}, id = {}",
+                                                              packet.GetPacketFamily(),
+                                                              packet.GetPacketId()));
         }
 
         // Parse the packet to get the capture period and counter UIDs
@@ -161,8 +161,8 @@
         break;
     }
     default:
-        throw RuntimeException(boost::str(boost::format("Unknown profiling service state: %1%")
-                                          % static_cast<int>(currentState)));
+        throw RuntimeException(fmt::format("Unknown profiling service state: {}",
+                                           static_cast<int>(currentState)));
     }
 }
 
diff --git a/src/profiling/ProfilingService.cpp b/src/profiling/ProfilingService.cpp
index 3521fc0..6fe52f8 100644
--- a/src/profiling/ProfilingService.cpp
+++ b/src/profiling/ProfilingService.cpp
@@ -11,7 +11,7 @@
 
 #include <common/include/SocketConnectionException.hpp>
 
-#include <boost/format.hpp>
+#include <fmt/format.h>
 
 namespace armnn
 {
@@ -183,8 +183,8 @@
 
         break;
     default:
-        throw RuntimeException(boost::str(boost::format("Unknown profiling service state: %1")
-                                          % static_cast<int>(currentState)));
+        throw RuntimeException(fmt::format("Unknown profiling service state: {}",
+                                           static_cast<int>(currentState)));
     }
 }
 
@@ -203,8 +203,8 @@
 
         break;
     default:
-        throw RuntimeException(boost::str(boost::format("Unknown profiling service state: %1")
-                                          % static_cast<int>(currentState)));
+        throw RuntimeException(fmt::format("Unknown profiling service state: {}",
+                                           static_cast<int>(currentState)));
     }
 }
 
@@ -486,7 +486,7 @@
 {
     if (!IsCounterRegistered(counterUid))
     {
-        throw InvalidArgumentException(boost::str(boost::format("Counter UID %1% is not registered") % counterUid));
+        throw InvalidArgumentException(fmt::format("Counter UID {} is not registered", counterUid));
     }
 }
 
diff --git a/src/profiling/RequestCounterDirectoryCommandHandler.cpp b/src/profiling/RequestCounterDirectoryCommandHandler.cpp
index 8f78ae6..f86470b 100644
--- a/src/profiling/RequestCounterDirectoryCommandHandler.cpp
+++ b/src/profiling/RequestCounterDirectoryCommandHandler.cpp
@@ -5,7 +5,7 @@
 
 #include "RequestCounterDirectoryCommandHandler.hpp"
 
-#include <boost/format.hpp>
+#include <fmt/format.h>
 
 namespace armnn
 {
@@ -21,17 +21,17 @@
     case ProfilingState::Uninitialised:
     case ProfilingState::NotConnected:
     case ProfilingState::WaitingForAck:
-        throw RuntimeException(boost::str(boost::format("Request Counter Directory Comand Handler invoked while in an "
-                                                        "wrong state: %1%")
-                                          % GetProfilingStateName(currentState)));
+        throw RuntimeException(fmt::format("Request Counter Directory Comand Handler invoked while in an "
+                                           "wrong state: {}",
+                                           GetProfilingStateName(currentState)));
     case ProfilingState::Active:
         // Process the packet
         if (!(packet.GetPacketFamily() == 0u && packet.GetPacketId() == 3u))
         {
-            throw armnn::InvalidArgumentException(boost::str(boost::format("Expected Packet family = 0, id = 3 but "
-                                                                           "received family = %1%, id = %2%")
-                                                  % packet.GetPacketFamily()
-                                                  % packet.GetPacketId()));
+            throw armnn::InvalidArgumentException(fmt::format("Expected Packet family = 0, id = 3 but "
+                                                              "received family = {}, id = {}",
+                                                              packet.GetPacketFamily(),
+                                                              packet.GetPacketId()));
         }
 
         // Send all the packet required for the handshake with the external profiling service
@@ -40,8 +40,8 @@
 
         break;
     default:
-        throw RuntimeException(boost::str(boost::format("Unknown profiling service state: %1%")
-                                          % static_cast<int>(currentState)));
+        throw RuntimeException(fmt::format("Unknown profiling service state: {}",
+                                           static_cast<int>(currentState)));
     }
 }
 
diff --git a/src/profiling/SendCounterPacket.cpp b/src/profiling/SendCounterPacket.cpp
index 121ced9..b0bfeb5 100644
--- a/src/profiling/SendCounterPacket.cpp
+++ b/src/profiling/SendCounterPacket.cpp
@@ -14,7 +14,7 @@
 #include <common/include/Constants.hpp>
 #include <common/include/SwTrace.hpp>
 
-#include <boost/format.hpp>
+#include <fmt/format.h>
 
 #include <cstring>
 
@@ -90,7 +90,7 @@
     {
         CancelOperationAndThrow<BufferExhaustion>(
             writeBuffer,
-            boost::str(boost::format("No space left in buffer. Unable to reserve (%1%) bytes.") % totalSize));
+            fmt::format("No space left in buffer. Unable to reserve ({}) bytes.", totalSize));
     }
 
     try
@@ -188,8 +188,9 @@
         auto it = counters.find(counterUid);
         if (it == counters.end())
         {
-            errorMessage = boost::str(boost::format("Counter (%1%) not found in category (%2%)")
-                                      % counterUid % category->m_Name );
+            errorMessage = fmt::format("Counter ({}) not found in category ({})",
+                                       counterUid,
+                                       category->m_Name );
             return false;
         }
 
@@ -202,7 +203,7 @@
     }
     if (categoryCounters.empty())
     {
-        errorMessage = boost::str(boost::format("No valid counters found in category (%1%)")% categoryName);
+        errorMessage = fmt::format("No valid counters found in category ({})", categoryName);
         return false;
     }
 
@@ -213,8 +214,8 @@
     std::vector<uint32_t> categoryNameBuffer;
     if (!arm::pipe::StringToSwTraceString<arm::pipe::SwTraceNameCharPolicy>(categoryName, categoryNameBuffer))
     {
-        errorMessage = boost::str(boost::format("Cannot convert the name of category (%1%) to an SWTrace namestring")
-                                  % categoryName);
+        errorMessage = fmt::format("Cannot convert the name of category ({}) to an SWTrace namestring",
+                                   categoryName);
         return false;
     }
 
@@ -319,9 +320,9 @@
     std::vector<uint32_t> deviceNameBuffer;
     if (!arm::pipe::StringToSwTraceString<arm::pipe::SwTraceCharPolicy>(deviceName, deviceNameBuffer))
     {
-        errorMessage = boost::str(boost::format("Cannot convert the name of device %1% (%2%) to an SWTrace string")
-                                  % deviceUid
-                                  % deviceName);
+        errorMessage = fmt::format("Cannot convert the name of device {} ({}) to an SWTrace string",
+                                   deviceUid,
+                                   deviceName);
         return false;
     }
 
@@ -369,10 +370,9 @@
     std::vector<uint32_t> counterSetNameBuffer;
     if (!arm::pipe::StringToSwTraceString<arm::pipe::SwTraceNameCharPolicy>(counterSet->m_Name, counterSetNameBuffer))
     {
-        errorMessage = boost::str(boost::format("Cannot convert the name of counter set %1% (%2%) to "
-                                                "an SWTrace namestring")
-                                  % counterSetUid
-                                  % counterSetName);
+        errorMessage = fmt::format("Cannot convert the name of counter set {} ({}) to an SWTrace namestring",
+                                   counterSetUid,
+                                   counterSetName);
         return false;
     }
 
@@ -464,10 +464,9 @@
     std::vector<uint32_t> counterNameBuffer;
     if (!arm::pipe::StringToSwTraceString<arm::pipe::SwTraceCharPolicy>(counterName, counterNameBuffer))
     {
-        errorMessage = boost::str(boost::format("Cannot convert the name of counter %1% (name: %2%) "
-                                                "to an SWTrace string")
-                                  % counterUid
-                                  % counterName);
+        errorMessage = fmt::format("Cannot convert the name of counter {} (name: {}) to an SWTrace string",
+                                   counterUid,
+                                   counterName);
         return false;
     }
 
@@ -481,10 +480,10 @@
     std::vector<uint32_t> counterDescriptionBuffer;
     if (!arm::pipe::StringToSwTraceString<arm::pipe::SwTraceCharPolicy>(counterDescription, counterDescriptionBuffer))
     {
-        errorMessage = boost::str(boost::format("Cannot convert the description of counter %1% (description: %2%) "
-                                                "to an SWTrace string")
-                                  % counterUid
-                                  % counterName);
+        errorMessage = fmt::format("Cannot convert the description of counter {} (description: {}) "
+                                   "to an SWTrace string",
+                                   counterUid,
+                                   counterName);
         return false;
     }
 
@@ -506,10 +505,9 @@
         // Convert the counter units into a SWTrace namestring
         if (!arm::pipe::StringToSwTraceString<arm::pipe::SwTraceNameCharPolicy>(counterUnits, counterUnitsBuffer))
         {
-            errorMessage = boost::str(boost::format("Cannot convert the units of counter %1% (units: %2%) "
-                                                    "to an SWTrace string")
-                                      % counterUid
-                                      % counterName);
+            errorMessage = fmt::format("Cannot convert the units of counter {} (units: {}) to an SWTrace string",
+                                       counterUid,
+                                       counterName);
             return false;
         }
     }
@@ -811,7 +809,7 @@
     {
         CancelOperationAndThrow<BufferExhaustion>(
             writeBuffer,
-            boost::str(boost::format("No space left in buffer. Unable to reserve (%1%) bytes.") % totalSize));
+            fmt::format("No space left in buffer. Unable to reserve ({}) bytes.", totalSize));
     }
 
     // Offset for writing to the buffer
@@ -848,7 +846,7 @@
     {
         CancelOperationAndThrow<BufferExhaustion>(
             writeBuffer,
-            boost::str(boost::format("No space left in buffer. Unable to reserve (%1%) bytes.") % totalSize));
+            fmt::format("No space left in buffer. Unable to reserve ({}) bytes.", totalSize));
     }
 
     // Create header.
@@ -897,7 +895,7 @@
     {
         CancelOperationAndThrow<BufferExhaustion>(
             writeBuffer,
-            boost::str(boost::format("No space left in buffer. Unable to reserve (%1%) bytes.") % totalSize));
+            fmt::format("No space left in buffer. Unable to reserve ({}) bytes.", totalSize));
     }
 
     // Create header.
diff --git a/src/profiling/test/ProfilingGuidTest.cpp b/src/profiling/test/ProfilingGuidTest.cpp
index 392833a..f89699c 100644
--- a/src/profiling/test/ProfilingGuidTest.cpp
+++ b/src/profiling/test/ProfilingGuidTest.cpp
@@ -11,7 +11,7 @@
 #include <set>
 
 #include <boost/test/unit_test.hpp>
-#include <boost/format.hpp>
+#include <fmt/format.h>
 #include <thread>
 
 using namespace armnn::profiling;
@@ -99,7 +99,7 @@
             } 
             else
             {
-                BOOST_ERROR(boost::str(boost::format("GUID collision occurred: %1% -> %2%") % str % guid));
+                BOOST_ERROR(fmt::format("GUID collision occurred: {} -> {}", str, guid));
             }
             break;
         }