aboutsummaryrefslogtreecommitdiff
path: root/src/profiling/CounterDirectory.cpp
diff options
context:
space:
mode:
authorJim Flynn <jim.flynn@arm.com>2022-03-10 22:57:47 +0000
committerJim Flynn <jim.flynn@arm.com>2022-03-12 12:43:35 +0000
commit6730fe9cbc195f054d697b25daba8516d70658e0 (patch)
tree712edb5d7dfbb1b1b2d91b70d4009c56164ef069 /src/profiling/CounterDirectory.cpp
parent9265a88c0064dbcf5ad4694bbdcce1b335a394e6 (diff)
downloadarmnn-6730fe9cbc195f054d697b25daba8516d70658e0.tar.gz
IVGCVSW-6842 Replace ARMNN_ASSERT with ARM_PIPE_ASSERT in profiling code
Change-Id: Ie982ae603b7fb2793baf921232d32ce43f46d444 Signed-off-by: Jim Flynn <jim.flynn@arm.com>
Diffstat (limited to 'src/profiling/CounterDirectory.cpp')
-rw-r--r--src/profiling/CounterDirectory.cpp59
1 files changed, 30 insertions, 29 deletions
diff --git a/src/profiling/CounterDirectory.cpp b/src/profiling/CounterDirectory.cpp
index 11dc3803dd..87706996ad 100644
--- a/src/profiling/CounterDirectory.cpp
+++ b/src/profiling/CounterDirectory.cpp
@@ -7,8 +7,8 @@
#include "ProfilingUtils.hpp"
#include <armnn/BackendId.hpp>
-#include <armnn/utility/Assert.hpp>
+#include <common/include/Assert.hpp>
#include <common/include/SwTrace.hpp>
#include <fmt/format.h>
@@ -38,11 +38,11 @@ const Category* CounterDirectory::RegisterCategory(const std::string& categoryNa
// Create the category
CategoryPtr category = std::make_unique<Category>(categoryName);
- ARMNN_ASSERT(category);
+ ARM_PIPE_ASSERT(category);
// Get the raw category pointer
const Category* categoryPtr = category.get();
- ARMNN_ASSERT(categoryPtr);
+ ARM_PIPE_ASSERT(categoryPtr);
// Register the category
m_Categories.insert(std::move(category));
@@ -100,11 +100,11 @@ const Device* CounterDirectory::RegisterDevice(const std::string& deviceName,
// Create the device
DevicePtr device = std::make_unique<Device>(deviceUid, deviceName, cores);
- ARMNN_ASSERT(device);
+ ARM_PIPE_ASSERT(device);
// Get the raw device pointer
const Device* devicePtr = device.get();
- ARMNN_ASSERT(devicePtr);
+ ARM_PIPE_ASSERT(devicePtr);
// Register the device
m_Devices.insert(std::make_pair(deviceUid, std::move(device)));
@@ -162,15 +162,15 @@ const CounterSet* CounterDirectory::RegisterCounterSet(const std::string& counte
// Get the counter set UID
uint16_t counterSetUid = GetNextUid();
- ARMNN_ASSERT(counterSetUid == counterSetUidPeek);
+ ARM_PIPE_ASSERT(counterSetUid == counterSetUidPeek);
// Create the counter set
CounterSetPtr counterSet = std::make_unique<CounterSet>(counterSetUid, counterSetName, count);
- ARMNN_ASSERT(counterSet);
+ ARM_PIPE_ASSERT(counterSet);
// Get the raw counter set pointer
const CounterSet* counterSetPtr = counterSet.get();
- ARMNN_ASSERT(counterSetPtr);
+ ARM_PIPE_ASSERT(counterSetPtr);
// Register the counter set
m_CounterSets.insert(std::make_pair(counterSetUid, std::move(counterSet)));
@@ -248,14 +248,14 @@ const Counter* CounterDirectory::RegisterCounter(const std::string& /*backendId*
// Get the parent category
const CategoryPtr& parentCategory = *categoryIt;
- ARMNN_ASSERT(parentCategory);
+ ARM_PIPE_ASSERT(parentCategory);
// Check that a counter with the given name is not already registered within the parent category
const std::vector<uint16_t>& parentCategoryCounters = parentCategory->m_Counters;
for (uint16_t parentCategoryCounterUid : parentCategoryCounters)
{
const Counter* parentCategoryCounter = GetCounter(parentCategoryCounterUid);
- ARMNN_ASSERT(parentCategoryCounter);
+ ARM_PIPE_ASSERT(parentCategoryCounter);
if (parentCategoryCounter->m_Name == name)
{
@@ -287,7 +287,7 @@ const Counter* CounterDirectory::RegisterCounter(const std::string& /*backendId*
// Get the counter UIDs and calculate the max counter UID
std::vector<uint16_t> counterUids = GetNextCounterUids(uid, deviceCores);
- ARMNN_ASSERT(!counterUids.empty());
+ ARM_PIPE_ASSERT(!counterUids.empty());
uint16_t maxCounterUid = deviceCores <= 1 ? counterUids.front() : counterUids.back();
// Get the counter units
@@ -305,11 +305,11 @@ const Counter* CounterDirectory::RegisterCounter(const std::string& /*backendId*
unitsValue,
deviceUidValue,
counterSetUidValue);
- ARMNN_ASSERT(counter);
+ ARM_PIPE_ASSERT(counter);
// Get the raw counter pointer
const Counter* counterPtr = counter.get();
- ARMNN_ASSERT(counterPtr);
+ ARM_PIPE_ASSERT(counterPtr);
// Process multiple counters if necessary
for (uint16_t counterUid : counterUids)
@@ -333,7 +333,7 @@ const Category* CounterDirectory::GetCategory(const std::string& categoryName) c
}
const Category* category = it->get();
- ARMNN_ASSERT(category);
+ ARM_PIPE_ASSERT(category);
return category;
}
@@ -347,8 +347,8 @@ const Device* CounterDirectory::GetDevice(uint16_t deviceUid) const
}
const Device* device = it->second.get();
- ARMNN_ASSERT(device);
- ARMNN_ASSERT(device->m_Uid == deviceUid);
+ ARM_PIPE_ASSERT(device);
+ ARM_PIPE_ASSERT(device->m_Uid == deviceUid);
return device;
}
@@ -362,8 +362,8 @@ const CounterSet* CounterDirectory::GetCounterSet(uint16_t counterSetUid) const
}
const CounterSet* counterSet = it->second.get();
- ARMNN_ASSERT(counterSet);
- ARMNN_ASSERT(counterSet->m_Uid == counterSetUid);
+ ARM_PIPE_ASSERT(counterSet);
+ ARM_PIPE_ASSERT(counterSet->m_Uid == counterSetUid);
return counterSet;
}
@@ -377,9 +377,9 @@ const Counter* CounterDirectory::GetCounter(uint16_t counterUid) const
}
const Counter* counter = it->second.get();
- ARMNN_ASSERT(counter);
- ARMNN_ASSERT(counter->m_Uid <= counterUid);
- ARMNN_ASSERT(counter->m_Uid <= counter->m_MaxCounterUid);
+ ARM_PIPE_ASSERT(counter);
+ ARM_PIPE_ASSERT(counter->m_Uid <= counterUid);
+ ARM_PIPE_ASSERT(counter->m_Uid <= counter->m_MaxCounterUid);
return counter;
}
@@ -446,7 +446,7 @@ CategoriesIt CounterDirectory::FindCategory(const std::string& categoryName) con
{
return std::find_if(m_Categories.begin(), m_Categories.end(), [&categoryName](const CategoryPtr& category)
{
- ARMNN_ASSERT(category);
+ ARM_PIPE_ASSERT(category);
return category->m_Name == categoryName;
});
@@ -461,8 +461,8 @@ DevicesIt CounterDirectory::FindDevice(const std::string& deviceName) const
{
return std::find_if(m_Devices.begin(), m_Devices.end(), [&deviceName](const auto& pair)
{
- ARMNN_ASSERT(pair.second);
- ARMNN_ASSERT(pair.second->m_Uid == pair.first);
+ ARM_PIPE_ASSERT(pair.second);
+ ARM_PIPE_ASSERT(pair.second->m_Uid == pair.first);
return pair.second->m_Name == deviceName;
});
@@ -477,8 +477,8 @@ CounterSetsIt CounterDirectory::FindCounterSet(const std::string& counterSetName
{
return std::find_if(m_CounterSets.begin(), m_CounterSets.end(), [&counterSetName](const auto& pair)
{
- ARMNN_ASSERT(pair.second);
- ARMNN_ASSERT(pair.second->m_Uid == pair.first);
+ ARM_PIPE_ASSERT(pair.second);
+ ARM_PIPE_ASSERT(pair.second->m_Uid == pair.first);
return pair.second->m_Name == counterSetName;
});
@@ -493,8 +493,8 @@ CountersIt CounterDirectory::FindCounter(const std::string& counterName) const
{
return std::find_if(m_Counters.begin(), m_Counters.end(), [&counterName](const auto& pair)
{
- ARMNN_ASSERT(pair.second);
- ARMNN_ASSERT(pair.first >= pair.second->m_Uid && pair.first <= pair.second->m_MaxCounterUid);
+ ARM_PIPE_ASSERT(pair.second);
+ ARM_PIPE_ASSERT(pair.first >= pair.second->m_Uid && pair.first <= pair.second->m_MaxCounterUid);
return pair.second->m_Name == counterName;
});
@@ -532,7 +532,8 @@ uint16_t CounterDirectory::GetNumberOfCores(const armnn::Optional<uint16_t>& num
// Get the associated device
const DevicePtr& device = deviceIt->second;
- ARMNN_ASSERT(device);
+ ARM_PIPE_ASSERT(device);
+
// Get the number of cores of the associated device
return device->m_Cores;