ArmNN
 20.02
ExecutionFrameTest.cpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #include <boost/test/unit_test.hpp>
7 
8 #include <ExecutionFrame.hpp>
9 
10 // Test that the values set in m_NextExecutionFrame are correct.
11 // The execution order is given by the m_NextExecutionFrame in each ExecutionFrame.
12 // A
13 // |
14 // B
15 // |
16 // C
17 BOOST_AUTO_TEST_CASE(NextExecutionFrameTest)
18 {
19  armnn::ExecutionFrame executionFrameA;
20  armnn::ExecutionFrame executionFrameB;
21  armnn::ExecutionFrame executionFrameC;
22 
23  executionFrameA.SetNextExecutionFrame(&executionFrameB);
24  executionFrameB.SetNextExecutionFrame(&executionFrameC);
25  //not setting C to check that the default setting is nullptr.
26 
27  auto nextExecutionFrameA = executionFrameA.ExecuteWorkloads(nullptr);
28  auto nextExecutionFrameB = executionFrameB.ExecuteWorkloads(&executionFrameA);
29  auto nextExecutionFrameC = executionFrameC.ExecuteWorkloads(&executionFrameB);
30 
31  BOOST_CHECK_EQUAL(nextExecutionFrameA, &executionFrameB);
32  BOOST_CHECK_EQUAL(nextExecutionFrameB, &executionFrameC);
33 
34  BOOST_CHECK(!nextExecutionFrameC);
35 
36  BOOST_CHECK_NE(nextExecutionFrameA, &executionFrameC);
37 }
38 
BOOST_CHECK(profilingService.GetCurrentState()==ProfilingState::WaitingForAck)
IExecutionFrame * ExecuteWorkloads(IExecutionFrame *previousFrame) override
BOOST_AUTO_TEST_CASE(NextExecutionFrameTest)
void SetNextExecutionFrame(IExecutionFrame *nextExecutionFrame)