aboutsummaryrefslogtreecommitdiff
path: root/src/backends/neon/NeonTimer.cpp
diff options
context:
space:
mode:
authorMatthew Bentham <matthew.bentham@arm.com>2022-02-11 08:29:42 +0000
committerColm Donelan <colm.donelan@arm.com>2022-02-15 21:22:03 +0000
commit1855c6b2d21c04d054f6ebd1160c70c669e92a07 (patch)
treed8976d2fa554b2b68838ccda9e3efcce6f6740c6 /src/backends/neon/NeonTimer.cpp
parenteef6b76fedad6ba812c4eae74266c2828f9e8de4 (diff)
downloadarmnn-1855c6b2d21c04d054f6ebd1160c70c669e92a07.tar.gz
Fix unit test where NeonMemoryManager was used instead of RefMemoryManager
Although the Neon and Ref backends can use each other's TensorHandles, their TensorHandleFactories can't use each other's MemoryManagers. Incorrectly passing the NeonMemoryManager to the RefTensorHandleFactory in unit test utility code resulted in an incorrect static_pointer_cast and a warning from the Undefined Behaviour Sanitizer. This change fixes the test code, and replaces use of static_pointer_cast with armnn::PolymorphicPointerDowncast which will check that the cast is legal in debug builds. Also, remove MockWorkloadFactoryHelper.hpp as it is unused. Signed-off-by: Matthew Bentham <matthew.bentham@arm.com> Change-Id: I2b425e86fccacd7cc5ff186521fc6e53e7e50c77
Diffstat (limited to 'src/backends/neon/NeonTimer.cpp')
-rw-r--r--src/backends/neon/NeonTimer.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backends/neon/NeonTimer.cpp b/src/backends/neon/NeonTimer.cpp
index 5cce0511ab..a7d3032b13 100644
--- a/src/backends/neon/NeonTimer.cpp
+++ b/src/backends/neon/NeonTimer.cpp
@@ -7,6 +7,7 @@
#include "NeonInterceptorScheduler.hpp"
#include <armnn/utility/Assert.hpp>
+#include <armnn/utility/PolymorphicDowncast.hpp>
#include <memory>
@@ -29,7 +30,7 @@ void NeonTimer::Start()
{
// Keep the real schedule and add NeonInterceptorScheduler as an interceptor
m_RealScheduler = &arm_compute::Scheduler::get();
- arm_compute::Scheduler::set(std::static_pointer_cast<arm_compute::IScheduler>(g_Interceptor));
+ arm_compute::Scheduler::set(armnn::PolymorphicPointerDowncast<arm_compute::IScheduler>(g_Interceptor));
}
}