ArmNN
 22.05
IWorkload.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2020 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 #pragma once
6 
7 #include <armnn/Types.hpp>
8 
9 namespace armnn
10 {
11 
12 namespace experimental
13 {
14 
16 
17 } // end experimental namespace
18 
19 using namespace armnn::experimental;
20 
21 /// Workload interface to enqueue a layer computation.
22 class IWorkload {
23 public:
24  virtual ~IWorkload() {}
25 
26  // Note: do not call for async networks via ExecuteAsync or otherwise,
27  // as async networks memory is allocated outside the workload.
28  virtual void PostAllocationConfigure() = 0;
29 
30  virtual void Execute() const = 0;
31 
32  virtual void ExecuteAsync(WorkingMemDescriptor& desc) = 0;
33 
34  virtual arm::pipe::ProfilingGuid GetGuid() const = 0;
35 
36  // SupportsTensorHandleReplacement signals that a given workload is capable of
37  // replacing any of its I/O tensors via ReplaceInput/OutputTensorHandle
38  virtual bool SupportsTensorHandleReplacement() const = 0;
39 
40  // Replace input tensor handle with the given TensorHandle
41  virtual void ReplaceInputTensorHandle(ITensorHandle* /*input*/, unsigned int /*slot*/) = 0;
42 
43  // Replace output tensor handle with the given TensorHandle
44  virtual void ReplaceOutputTensorHandle(ITensorHandle* /*output*/, unsigned int /*slot*/) = 0;
45 
46  virtual void RegisterDebugCallback(const DebugCallbackFunction& /*func*/) {}
47 };
48 
49 } //namespace armnn
virtual void RegisterDebugCallback(const DebugCallbackFunction &)
Definition: IWorkload.hpp:46
Copyright (c) 2021 ARM Limited and Contributors.
std::function< void(LayerGuid guid, unsigned int slotIndex, ITensorHandle *tensorHandle)> DebugCallbackFunction
Define the type of callback for the Debug layer to call.
Definition: Types.hpp:379
virtual ~IWorkload()
Definition: IWorkload.hpp:24
Workload interface to enqueue a layer computation.
Definition: IWorkload.hpp:22