blob: c7bc5da85160b8a00ac340a82890047318921273 (
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
|
//
// Copyright © 2020 Arm Ltd and Contributors. All rights reserved.
// SPDX-License-Identifier: MIT
//
#pragma once
#include <armnn/Types.hpp>
namespace armnn
{
namespace experimental
{
struct WorkingMemDescriptor;
} // end experimental namespace
using namespace armnn::experimental;
/// Workload interface to enqueue a layer computation.
class IWorkload {
public:
virtual ~IWorkload() {}
// Note: do not call for async networks via ExecuteAsync or otherwise,
// as async networks memory is allocated outside the workload.
virtual void PostAllocationConfigure() = 0;
virtual void Execute() const = 0;
virtual void ExecuteAsync(WorkingMemDescriptor& desc) = 0;
virtual arm::pipe::ProfilingGuid GetGuid() const = 0;
// SupportsTensorHandleReplacement signals that a given workload is capable of
// replacing any of its I/O tensors via ReplaceInput/OutputTensorHandle
virtual bool SupportsTensorHandleReplacement() const = 0;
// Replace input tensor handle with the given TensorHandle
virtual void ReplaceInputTensorHandle(ITensorHandle* /*input*/, unsigned int /*slot*/) = 0;
// Replace output tensor handle with the given TensorHandle
virtual void ReplaceOutputTensorHandle(ITensorHandle* /*output*/, unsigned int /*slot*/) = 0;
virtual void RegisterDebugCallback(const DebugCallbackFunction& /*func*/) {}
};
} //namespace armnn
|