From 4de9f67c91b9224f447bd4a50b67129064b8c824 Mon Sep 17 00:00:00 2001 From: Teresa Charlin Date: Wed, 10 Apr 2019 13:59:49 +0100 Subject: IVGCVSW-2918 Implement ExecutionFrame. *Add interface IExecutionFrame. *Add basic implementation ExecutionFrame. *Add Unit Test Change-Id: I960ac84a05c0c9b03735ec5e9c63f6f8f95b57b5 Signed-off-by: Kevin May Signed-off-by: Teresa Charlin Signed-off-by: Aron Virginas-Tar --- src/armnn/test/ExecutionFrameTest.cpp | 38 +++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/armnn/test/ExecutionFrameTest.cpp (limited to 'src/armnn/test/ExecutionFrameTest.cpp') diff --git a/src/armnn/test/ExecutionFrameTest.cpp b/src/armnn/test/ExecutionFrameTest.cpp new file mode 100644 index 0000000000..c3480217a8 --- /dev/null +++ b/src/armnn/test/ExecutionFrameTest.cpp @@ -0,0 +1,38 @@ +// +// Copyright © 2017 Arm Ltd. All rights reserved. +// SPDX-License-Identifier: MIT +// + +#include + +#include + +// Test that the values set in m_NextExecutionFrame are correct. +// The execution order is given by the m_NextExecutionFrame in each ExecutionFrame. +// A +// | +// B +// | +// C +BOOST_AUTO_TEST_CASE(NextExecutionFrameTest) +{ + armnn::ExecutionFrame executionFrameA; + armnn::ExecutionFrame executionFrameB; + armnn::ExecutionFrame executionFrameC; + + executionFrameA.SetNextExecutionFrame(&executionFrameB); + executionFrameB.SetNextExecutionFrame(&executionFrameC); + //not setting C to check that the default setting is nullptr. + + auto nextExecutionFrameA = executionFrameA.ExecuteWorkloads(nullptr); + auto nextExecutionFrameB = executionFrameB.ExecuteWorkloads(&executionFrameA); + auto nextExecutionFrameC = executionFrameC.ExecuteWorkloads(&executionFrameB); + + BOOST_CHECK_EQUAL(nextExecutionFrameA, &executionFrameB); + BOOST_CHECK_EQUAL(nextExecutionFrameB, &executionFrameC); + + BOOST_CHECK(!nextExecutionFrameC); + + BOOST_CHECK_NE(nextExecutionFrameA, &executionFrameC); +} + -- cgit v1.2.1