Narumol Prangnawarat | 867eba5 | 2020-02-03 12:29:56 +0000 | [diff] [blame] | 1 | // |
Mike Kelly | 386ff1a | 2021-03-29 15:04:50 +0100 | [diff] [blame] | 2 | // Copyright © 2020 Arm Ltd and Contributors. All rights reserved. |
Narumol Prangnawarat | 867eba5 | 2020-02-03 12:29:56 +0000 | [diff] [blame] | 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | #pragma once |
| 6 | |
| 7 | #include <armnn/Types.hpp> |
| 8 | |
| 9 | namespace armnn |
| 10 | { |
| 11 | |
Mike Kelly | 386ff1a | 2021-03-29 15:04:50 +0100 | [diff] [blame] | 12 | namespace experimental |
| 13 | { |
| 14 | |
| 15 | struct WorkingMemDescriptor; |
| 16 | |
| 17 | } // end experimental namespace |
| 18 | |
| 19 | using namespace armnn::experimental; |
| 20 | |
Narumol Prangnawarat | 867eba5 | 2020-02-03 12:29:56 +0000 | [diff] [blame] | 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 | |
Mike Kelly | 386ff1a | 2021-03-29 15:04:50 +0100 | [diff] [blame] | 30 | virtual void ExecuteAsync(WorkingMemDescriptor& desc) = 0; |
| 31 | |
Cathal Corbett | 5aa9fd7 | 2022-02-25 15:33:28 +0000 | [diff] [blame^] | 32 | virtual arm::pipe::ProfilingGuid GetGuid() const = 0; |
Narumol Prangnawarat | 867eba5 | 2020-02-03 12:29:56 +0000 | [diff] [blame] | 33 | |
Finn Williams | 73c547d | 2022-02-15 20:47:34 +0000 | [diff] [blame] | 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 | |
Teresa Charlin | 788e2a6 | 2022-01-17 21:19:52 +0000 | [diff] [blame] | 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 | |
Mike Kelly | 386ff1a | 2021-03-29 15:04:50 +0100 | [diff] [blame] | 44 | virtual void RegisterDebugCallback(const DebugCallbackFunction& /*func*/) {} |
Narumol Prangnawarat | 867eba5 | 2020-02-03 12:29:56 +0000 | [diff] [blame] | 45 | }; |
| 46 | |
| 47 | } //namespace armnn |