aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/test/ExecutionFrameTest.cpp
blob: c3480217a889cd5a1dd5c6d416aab3854651230c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//
// Copyright © 2017 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//

#include <boost/test/unit_test.hpp>

#include <ExecutionFrame.hpp>

// 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);
}