diff options
author | Jim Flynn <jim.flynn@arm.com> | 2022-03-10 22:57:47 +0000 |
---|---|---|
committer | Jim Flynn <jim.flynn@arm.com> | 2022-03-12 12:43:35 +0000 |
commit | 6730fe9cbc195f054d697b25daba8516d70658e0 (patch) | |
tree | 712edb5d7dfbb1b1b2d91b70d4009c56164ef069 /src/profiling/test | |
parent | 9265a88c0064dbcf5ad4694bbdcce1b335a394e6 (diff) | |
download | armnn-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/test')
-rw-r--r-- | src/profiling/test/ProfilingMocks.hpp | 24 | ||||
-rw-r--r-- | src/profiling/test/ProfilingTestUtils.cpp | 14 | ||||
-rw-r--r-- | src/profiling/test/SendCounterPacketTests.cpp | 25 | ||||
-rw-r--r-- | src/profiling/test/SendCounterPacketTests.hpp | 1 |
4 files changed, 31 insertions, 33 deletions
diff --git a/src/profiling/test/ProfilingMocks.hpp b/src/profiling/test/ProfilingMocks.hpp index 962912e995..4af2b6064e 100644 --- a/src/profiling/test/ProfilingMocks.hpp +++ b/src/profiling/test/ProfilingMocks.hpp @@ -15,8 +15,8 @@ #include <armnn/Optional.hpp> #include <armnn/Conversion.hpp> -#include <armnn/utility/Assert.hpp> +#include <common/include/Assert.hpp> #include <common/include/IgnoreUnused.hpp> #include <common/include/NumericCast.hpp> #include <common/include/ProfilingException.hpp> @@ -452,11 +452,11 @@ public: { // 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)); @@ -472,11 +472,11 @@ public: // 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))); @@ -493,11 +493,11 @@ public: // 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))); @@ -531,7 +531,7 @@ public: // 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 @@ -549,18 +549,18 @@ public: 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) { // Connect the counter to the parent category Category* parentCategory = const_cast<Category*>(GetCategory(parentCategoryName)); - ARMNN_ASSERT(parentCategory); + ARM_PIPE_ASSERT(parentCategory); parentCategory->m_Counters.push_back(counterUid); // Register the counter @@ -587,7 +587,7 @@ public: { auto it = std::find_if(m_Categories.begin(), m_Categories.end(), [&name](const CategoryPtr& category) { - ARMNN_ASSERT(category); + ARM_PIPE_ASSERT(category); return category->m_Name == name; }); diff --git a/src/profiling/test/ProfilingTestUtils.cpp b/src/profiling/test/ProfilingTestUtils.cpp index ca322868fc..a6ec66da2f 100644 --- a/src/profiling/test/ProfilingTestUtils.cpp +++ b/src/profiling/test/ProfilingTestUtils.cpp @@ -10,12 +10,12 @@ #include <armnn/Descriptors.hpp> #include <armnn/profiling/ArmNNProfiling.hpp> -#include <armnn/utility/Assert.hpp> #include <Processes.hpp> #include <ProfilingService.hpp> #include <armnnUtils/Threads.hpp> +#include <common/include/Assert.hpp> #include <common/include/LabelsAndEventClasses.hpp> #include <common/include/NumericCast.hpp> @@ -78,7 +78,7 @@ void VerifyTimelineHeaderBinary(const unsigned char* readableData, unsigned int& offset, uint32_t packetDataLength) { - ARMNN_ASSERT(readableData); + ARM_PIPE_ASSERT(readableData); // Utils unsigned int uint32_t_size = sizeof(uint32_t); @@ -107,7 +107,7 @@ ProfilingGuid VerifyTimelineLabelBinaryPacketData(Optional<ProfilingGuid> guid, const unsigned char* readableData, unsigned int& offset) { - ARMNN_ASSERT(readableData); + ARM_PIPE_ASSERT(readableData); // Utils unsigned int uint32_t_size = sizeof(uint32_t); @@ -153,7 +153,7 @@ void VerifyTimelineEventClassBinaryPacketData(ProfilingGuid guid, const unsigned char* readableData, unsigned int& offset) { - ARMNN_ASSERT(readableData); + ARM_PIPE_ASSERT(readableData); // Utils unsigned int uint32_t_size = sizeof(uint32_t); @@ -184,7 +184,7 @@ void VerifyTimelineRelationshipBinaryPacketData(ProfilingRelationshipType relati const unsigned char* readableData, unsigned int& offset) { - ARMNN_ASSERT(readableData); + ARM_PIPE_ASSERT(readableData); uint32_t relationshipTypeUint = 0; switch (relationshipType) @@ -274,7 +274,7 @@ ProfilingGuid VerifyTimelineEntityBinaryPacketData(Optional<ProfilingGuid> guid, const unsigned char* readableData, unsigned int& offset) { - ARMNN_ASSERT(readableData); + ARM_PIPE_ASSERT(readableData); // Utils unsigned int uint32_t_size = sizeof(uint32_t); @@ -310,7 +310,7 @@ ProfilingGuid VerifyTimelineEventBinaryPacket(Optional<uint64_t> timestamp, const unsigned char* readableData, unsigned int& offset) { - ARMNN_ASSERT(readableData); + ARM_PIPE_ASSERT(readableData); // Utils unsigned int uint32_t_size = sizeof(uint32_t); diff --git a/src/profiling/test/SendCounterPacketTests.cpp b/src/profiling/test/SendCounterPacketTests.cpp index 17931cc79b..e94687119d 100644 --- a/src/profiling/test/SendCounterPacketTests.cpp +++ b/src/profiling/test/SendCounterPacketTests.cpp @@ -9,7 +9,6 @@ #include <BufferManager.hpp> #include <CounterDirectory.hpp> -#include <common/include/EncodeVersion.hpp> #include <ProfilingUtils.hpp> #include <SendCounterPacket.hpp> #include <Processes.hpp> @@ -17,12 +16,12 @@ #include <armnn/Conversion.hpp> #include <armnn/Utils.hpp> +#include <common/include/Assert.hpp> #include <common/include/Constants.hpp> +#include <common/include/EncodeVersion.hpp> #include <common/include/NumericCast.hpp> #include <common/include/ProfilingException.hpp> -#include <armnn/utility/Assert.hpp> - #include <doctest/doctest.h> #include <chrono> @@ -565,7 +564,7 @@ TEST_CASE("CreateEventRecordTest") counterUnits, deviceUid, counterSetUid); - ARMNN_ASSERT(counter); + ARM_PIPE_ASSERT(counter); // Create an event record SendCounterPacket::EventRecord eventRecord; @@ -691,7 +690,7 @@ TEST_CASE("CreateEventRecordNoUnitsTest") "", deviceUid, counterSetUid); - ARMNN_ASSERT(counter); + ARM_PIPE_ASSERT(counter); // Create an event record SendCounterPacket::EventRecord eventRecord; @@ -798,7 +797,7 @@ TEST_CASE("CreateInvalidEventRecordTest1") counterUnits, deviceUid, counterSetUid); - ARMNN_ASSERT(counter); + ARM_PIPE_ASSERT(counter); // Create an event record SendCounterPacket::EventRecord eventRecord; @@ -837,7 +836,7 @@ TEST_CASE("CreateInvalidEventRecordTest2") counterUnits, deviceUid, counterSetUid); - ARMNN_ASSERT(counter); + ARM_PIPE_ASSERT(counter); // Create an event record SendCounterPacket::EventRecord eventRecord; @@ -876,7 +875,7 @@ TEST_CASE("CreateInvalidEventRecordTest3") counterUnits, deviceUid, counterSetUid); - ARMNN_ASSERT(counter); + ARM_PIPE_ASSERT(counter); // Create an event record SendCounterPacket::EventRecord eventRecord; @@ -896,7 +895,7 @@ TEST_CASE("CreateCategoryRecordTest") // Create a category for testing const std::string categoryName = "some_category"; const CategoryPtr category = std::make_unique<Category>(categoryName); - ARMNN_ASSERT(category); + ARM_PIPE_ASSERT(category); category->m_Counters = { 11u, 23u, 5670u }; // Create a collection of counters @@ -940,10 +939,10 @@ TEST_CASE("CreateCategoryRecordTest") Counter* counter1 = counters.find(11)->second.get(); Counter* counter2 = counters.find(23)->second.get(); Counter* counter3 = counters.find(5670)->second.get(); - ARMNN_ASSERT(counter1); - ARMNN_ASSERT(counter2); - ARMNN_ASSERT(counter3); - uint16_t categoryEventCount = arm::pipe::numeric_cast<uint16_t>(counters.size()); + ARM_PIPE_ASSERT(counter1); + ARM_PIPE_ASSERT(counter2); + ARM_PIPE_ASSERT(counter3); + uint16_t categoryEventCount = armnn::numeric_cast<uint16_t>(counters.size()); // Create a category record SendCounterPacket::CategoryRecord categoryRecord; diff --git a/src/profiling/test/SendCounterPacketTests.hpp b/src/profiling/test/SendCounterPacketTests.hpp index 2584a65fdd..de731c8d7b 100644 --- a/src/profiling/test/SendCounterPacketTests.hpp +++ b/src/profiling/test/SendCounterPacketTests.hpp @@ -12,7 +12,6 @@ #include <armnn/Optional.hpp> #include <armnn/Conversion.hpp> -#include <armnn/utility/Assert.hpp> #include <common/include/IgnoreUnused.hpp> #include <common/include/NumericCast.hpp> |