aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNarumol Prangnawarat <narumol.prangnawarat@arm.com>2020-11-20 16:17:48 +0000
committerFrancis Murtagh <francis.murtagh@arm.com>2020-11-23 14:21:32 +0000
commit199ab1a39fa45849a74853745e90fa8cd5e5ea6e (patch)
tree96ebc16c1d853ef9ef29004279b979e7cf45cfd3
parent8c2f651ad454d11dd36e212560af23dbea5b758e (diff)
downloadarmnn-199ab1a39fa45849a74853745e90fa8cd5e5ea6e.tar.gz
IVGCVSW-5569 Fix Unittest failure while building using EthosNAcc backend
* Correct the id when EthosN is enable Signed-off-by: Narumol Prangnawarat <narumol.prangnawarat@arm.com> Change-Id: I5203e615f809e56c7597ffeeec56b5ad38d4ff17
-rw-r--r--cmake/GlobalConfig.cmake4
-rw-r--r--src/backends/backendsCommon/test/BackendProfilingTests.cpp19
2 files changed, 17 insertions, 6 deletions
diff --git a/cmake/GlobalConfig.cmake b/cmake/GlobalConfig.cmake
index 843ad6b639..921fe723da 100644
--- a/cmake/GlobalConfig.cmake
+++ b/cmake/GlobalConfig.cmake
@@ -353,6 +353,10 @@ if(ARMNNREF)
add_definitions(-DARMNNREF_ENABLED)
endif()
+if(ETHOSN_SUPPORT)
+ add_definitions(-DETHOSN_SUPPORT_ENABLED)
+endif()
+
# This is the root for the dynamic backend tests to search for dynamic
# backends. By default it will be the project build directory.
add_definitions(-DDYNAMIC_BACKEND_BUILD_DIR="${PROJECT_BINARY_DIR}")
diff --git a/src/backends/backendsCommon/test/BackendProfilingTests.cpp b/src/backends/backendsCommon/test/BackendProfilingTests.cpp
index 377ca22cf5..4b0d26e0c3 100644
--- a/src/backends/backendsCommon/test/BackendProfilingTests.cpp
+++ b/src/backends/backendsCommon/test/BackendProfilingTests.cpp
@@ -123,15 +123,22 @@ BOOST_AUTO_TEST_CASE(BackendProfilingCounterRegisterMockBackendTest)
// Create a runtime
armnn::Runtime runtime(options);
+ unsigned int shiftedId = 0;
+
+#if defined(ETHOSN_SUPPORT_ENABLED)
+ // Shift the id as ETHOSN is enabled.
+ shiftedId = 4;
+#endif
+
// Check if the MockBackends 3 dummy counters {0, 1, 2-5 (four cores)} are registered
armnn::BackendId mockId = armnn::MockBackendId();
const armnn::profiling::ICounterMappings& counterMap = GetProfilingService(&runtime).GetCounterMappings();
- BOOST_CHECK(counterMap.GetGlobalId(0, mockId) == 5);
- BOOST_CHECK(counterMap.GetGlobalId(1, mockId) == 6);
- BOOST_CHECK(counterMap.GetGlobalId(2, mockId) == 7);
- BOOST_CHECK(counterMap.GetGlobalId(3, mockId) == 8);
- BOOST_CHECK(counterMap.GetGlobalId(4, mockId) == 9);
- BOOST_CHECK(counterMap.GetGlobalId(5, mockId) == 10);
+ BOOST_CHECK(counterMap.GetGlobalId(0, mockId) == 5 + shiftedId);
+ BOOST_CHECK(counterMap.GetGlobalId(1, mockId) == 6 + shiftedId);
+ BOOST_CHECK(counterMap.GetGlobalId(2, mockId) == 7 + shiftedId);
+ BOOST_CHECK(counterMap.GetGlobalId(3, mockId) == 8 + shiftedId);
+ BOOST_CHECK(counterMap.GetGlobalId(4, mockId) == 9 + shiftedId);
+ BOOST_CHECK(counterMap.GetGlobalId(5, mockId) == 10 + shiftedId);
options.m_ProfilingOptions.m_EnableProfiling = false;
GetProfilingService(&runtime).ResetExternalProfilingOptions(options.m_ProfilingOptions, true);
}