ArmNN
 22.02
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  virtual void PostAllocationConfigure() = 0;
27 
28  virtual void Execute() const = 0;
29 
30  virtual void ExecuteAsync(WorkingMemDescriptor& desc) = 0;
31 
32  virtual profiling::ProfilingGuid GetGuid() const = 0;
33 
34  // SupportsTensorHandleReplacement signals that a given workload is capable of
35  // replacing any of its I/O tensors via ReplaceInput/OutputTensorHandle
36  virtual bool SupportsTensorHandleReplacement() const = 0;
37 
38  // Replace input tensor handle with the given TensorHandle
39  virtual void ReplaceInputTensorHandle(ITensorHandle* /*input*/, unsigned int /*slot*/) = 0;
40 
41  // Replace output tensor handle with the given TensorHandle
42  virtual void ReplaceOutputTensorHandle(ITensorHandle* /*output*/, unsigned int /*slot*/) = 0;
43 
44  virtual void RegisterDebugCallback(const DebugCallbackFunction& /*func*/) {}
45 };
46 
47 } //namespace armnn
virtual void RegisterDebugCallback(const DebugCallbackFunction &)
Definition: IWorkload.hpp:44
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:371
virtual ~IWorkload()
Definition: IWorkload.hpp:24
Workload interface to enqueue a layer computation.
Definition: IWorkload.hpp:22