aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/ExecutionFrame.cpp
blob: 92a79908816e2ea23613fa2c129af892a799ba09 (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
39
40
41
42
43
44
45
46
47
48
49
50
//
// Copyright © 2017 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//

#include "ExecutionFrame.hpp"

using namespace std;

namespace armnn
{
ExecutionFrame::ExecutionFrame() {}

IExecutionFrame* ExecutionFrame::ExecuteWorkloads(IExecutionFrame* previousFrame)
{
    IgnoreUnused(previousFrame);
    for (auto& workload: m_WorkloadQueue)
    {
        workload->Execute();
    }
    return m_NextExecutionFrame;
}

void ExecutionFrame::PostAllocationConfigure()
{
    for (auto&& workloadPtr: m_WorkloadQueue)
    {
        workloadPtr.get()->PostAllocationConfigure();
    }
}

void ExecutionFrame::RegisterDebugCallback(const DebugCallbackFunction& func)
{
    for (auto&& workloadPtr: m_WorkloadQueue)
    {
        workloadPtr.get()->RegisterDebugCallback(func);
    }
}

void ExecutionFrame::AddWorkloadToQueue(std::unique_ptr<IWorkload> workload)
{
    m_WorkloadQueue.push_back(move(workload));
}

void ExecutionFrame::SetNextExecutionFrame(IExecutionFrame* nextExecutionFrame)
{
    m_NextExecutionFrame = nextExecutionFrame;
}

}