• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
8 #include <armnn/backends/Workload.hpp>
9 
10 namespace armnn
11 {
12 
13 using WorkloadQueue = std::vector< std::unique_ptr<IWorkload> >;
14 
15 /// ExecutionFrame interface to enqueue a workload computation.
16 class IExecutionFrame
17 {
18 
19 public:
~IExecutionFrame()20     virtual ~IExecutionFrame() {}
21 
22     virtual IExecutionFrame* ExecuteWorkloads(IExecutionFrame* previousFrame) = 0;
PostAllocationConfigure()23     virtual void PostAllocationConfigure() {};
RegisterDebugCallback(const DebugCallbackFunction &)24     virtual void RegisterDebugCallback(const DebugCallbackFunction&) {};
25 };
26 
27 class ExecutionFrame: public IExecutionFrame
28 {
29 public:
30     ExecutionFrame();
31 
32     IExecutionFrame* ExecuteWorkloads(IExecutionFrame* previousFrame) override ;
33     void PostAllocationConfigure() override;
34     void RegisterDebugCallback(const DebugCallbackFunction& func) override ;
35     void AddWorkloadToQueue(std::unique_ptr<IWorkload> workload);
36     void SetNextExecutionFrame(IExecutionFrame* nextExecutionFrame);
37 private:
38     WorkloadQueue m_WorkloadQueue;
39     IExecutionFrame* m_NextExecutionFrame = nullptr;
40 };
41 
42 }
43