ArmNN
 22.05.01
IWorkingMemHandle.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2021 Arm Ltd and Contributors. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
8 namespace armnn
9 {
10 
11 using NetworkId = int;
12 
13 namespace experimental
14 {
15 
16 struct WorkingMemDescriptor;
17 
19 {
20 public:
21  virtual ~IWorkingMemHandle() {};
22 
23  /// Returns the NetworkId of the Network that this IWorkingMemHandle works with.
24  virtual NetworkId GetNetworkId() = 0;
25 
26  /// Allocate the backing memory required for execution. If this is not called, then allocation will be
27  /// deferred to execution time.
28  virtual void Allocate() = 0;
29 
30  /// Free the backing memory required for execution.
31  virtual void Free() = 0;
32 
33  /// IsAllocated returns true if the backing memory is currently allocated.
34  virtual bool IsAllocated() = 0;
35 
36  /// Get the WorkingMemDescriptor for a Layer.
38 
39  /// Get the WorkingMemDescriptor at an index. The WorkingMemDescriptors are stored in the same order as
40  /// the Workloads in a topologically sorted graph.
41  virtual WorkingMemDescriptor& GetWorkingMemDescriptorAt(unsigned int id) = 0;
42 };
43 
44 } // end experimental namespace
45 
46 } // end armnn namespace
virtual NetworkId GetNetworkId()=0
Returns the NetworkId of the Network that this IWorkingMemHandle works with.
Copyright (c) 2021 ARM Limited and Contributors.
virtual bool IsAllocated()=0
IsAllocated returns true if the backing memory is currently allocated.
virtual void Allocate()=0
Allocate the backing memory required for execution.
int NetworkId
Definition: IRuntime.hpp:27
virtual void Free()=0
Free the backing memory required for execution.
arm::pipe::ProfilingGuid LayerGuid
Define LayerGuid type.
Definition: Types.hpp:26
virtual WorkingMemDescriptor & GetWorkingMemDescriptorAt(unsigned int id)=0
Get the WorkingMemDescriptor at an index.
virtual WorkingMemDescriptor & GetWorkingMemDescriptor(LayerGuid id)=0
Get the WorkingMemDescriptor for a Layer.