blob: 921b7e1f40333cc6dddd581f4c548de5a13e28a9 (
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
|
//
// Copyright © 2021 Arm Ltd and Contributors. All rights reserved.
// SPDX-License-Identifier: MIT
//
#pragma once
#include <mutex>
namespace armnn
{
namespace experimental
{
struct WorkingMemDescriptor;
class IWorkingMemHandle
{
public:
virtual ~IWorkingMemHandle() {};
/// Allocate the backing memory required for execution. If this is not called, then allocation will be
/// deferred to execution time. The mutex must be locked.
virtual void Allocate() = 0;
/// Free the backing memory required for execution. The mutex must be locked.
virtual void Free() = 0;
/// IsAllocated returns true if the backing memory is currently allocated. The mutex must be locked.
virtual bool IsAllocated() = 0;
/// Get a mutex which can be used for synchronizing access to the WorkingMemHandle object.
virtual std::mutex& GetMutex() = 0;
/// Get the WorkingMemDescriptor for a Layer. The mutex must be locked.
virtual WorkingMemDescriptor& GetWorkingMemDescriptor(LayerGuid id) = 0;
/// Get the WorkingMemDescriptor at an index. The WorkingMemDescriptors are stored in the same order as
/// the Workloads in a topologically sorted graph. The mutex must be locked.
virtual WorkingMemDescriptor& GetWorkingMemDescriptorAt(unsigned int id) = 0;
};
} // end experimental namespace
} // end armnn namespace
|