aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/test
diff options
context:
space:
mode:
authorMatteo Martincigh <matteo.martincigh@arm.com>2019-01-10 17:34:20 +0000
committerMatteo Martincigh <matteo.martincigh@arm.com>2019-01-11 12:20:47 +0000
commit992d6dc57d8463729910b688f0fb5825d0d3ccf2 (patch)
tree87b504d174848169550240f300f359dd57aaa1fd /src/armnn/test
parent1f0ff35236c1dd05954735f7fed9c2807770479e (diff)
downloadarmnn-992d6dc57d8463729910b688f0fb5825d0d3ccf2.tar.gz
IVGCVSW-2454 Refactor ArmNN to support pluggable backends from a separate
code base * Made the virtual functions in ILayerSupport.hpp pure * Created a LayerSupportBase class with the default implementation of the interface * Made the backend layer support classes inherit from the base class, instead of directly from the interface * Refactored the profiler and the profiling event classes to use the BackendId instead of the Compute * Implemented a proper MemCopy support method * Changed Compute to BackendId in the profiling API and objects * Removed static references to pluggable backends !android-nn-driver:492 Change-Id: Id6332b5f48c980819e0a09adc818d1effd057296
Diffstat (limited to 'src/armnn/test')
-rw-r--r--src/armnn/test/ProfilingEventTest.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/armnn/test/ProfilingEventTest.cpp b/src/armnn/test/ProfilingEventTest.cpp
index 9e31ccb323..0add8365e9 100644
--- a/src/armnn/test/ProfilingEventTest.cpp
+++ b/src/armnn/test/ProfilingEventTest.cpp
@@ -2,10 +2,12 @@
// Copyright © 2017 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//
+
#include <boost/test/unit_test.hpp>
#include "ProfilingEvent.hpp"
#include "Profiling.hpp"
+
#include <thread>
using namespace armnn;
@@ -24,7 +26,7 @@ BOOST_AUTO_TEST_CASE(ProfilingEventTest)
Event testEvent(eventName,
nullptr,
nullptr,
- armnn::Compute::Undefined,
+ BackendId(),
std::move(insts1));
BOOST_CHECK_EQUAL(testEvent.GetName(), "EventName");
@@ -41,17 +43,18 @@ BOOST_AUTO_TEST_CASE(ProfilingEventTest)
BOOST_CHECK_GE(testEvent.GetMeasurements().front().m_Value, 10.0);
// create a sub event with CpuAcc
+ BackendId cpuAccBackendId(Compute::CpuAcc);
Event::Instruments insts2;
insts2.emplace_back(std::make_unique<WallClockTimer>());
Event testEvent2(eventName,
profileManager.GetProfiler(),
&testEvent,
- Compute::CpuAcc,
+ cpuAccBackendId,
std::move(insts2));
BOOST_CHECK_EQUAL(&testEvent, testEvent2.GetParentEvent());
BOOST_CHECK_EQUAL(profileManager.GetProfiler(), testEvent2.GetProfiler());
- BOOST_CHECK_EQUAL(Compute::CpuAcc, testEvent2.GetComputeDevice());
+ BOOST_CHECK(cpuAccBackendId == testEvent2.GetBackendId());
}
BOOST_AUTO_TEST_CASE(ProfilingEventTestOnGpuAcc)
@@ -66,7 +69,7 @@ BOOST_AUTO_TEST_CASE(ProfilingEventTestOnGpuAcc)
Event testEvent(eventName,
nullptr,
nullptr,
- armnn::Compute::Undefined,
+ BackendId(),
std::move(insts1));
BOOST_CHECK_EQUAL(testEvent.GetName(), "GPUEvent");
@@ -83,13 +86,18 @@ BOOST_AUTO_TEST_CASE(ProfilingEventTestOnGpuAcc)
BOOST_CHECK_GE(testEvent.GetMeasurements().front().m_Value, 10.0);
// create a sub event
+ BackendId gpuAccBackendId(Compute::GpuAcc);
Event::Instruments insts2;
insts2.emplace_back(std::make_unique<WallClockTimer>());
- Event testEvent2(eventName, profileManager.GetProfiler(), &testEvent, Compute::GpuAcc, std::move(insts2));
+ Event testEvent2(eventName,
+ profileManager.GetProfiler(),
+ &testEvent,
+ gpuAccBackendId,
+ std::move(insts2));
BOOST_CHECK_EQUAL(&testEvent, testEvent2.GetParentEvent());
BOOST_CHECK_EQUAL(profileManager.GetProfiler(), testEvent2.GetProfiler());
- BOOST_CHECK_EQUAL(Compute::GpuAcc, testEvent2.GetComputeDevice());
+ BOOST_CHECK(gpuAccBackendId == testEvent2.GetBackendId());
}
BOOST_AUTO_TEST_SUITE_END()