22.08
EthosnRefMemoryManager.hpp
Go to the documentation of this file.
1
//
2
// Copyright © 2017 Arm Ltd. All rights reserved.
3
// SPDX-License-Identifier: MIT
4
//
5
#pragma once
6
7
#include <
armnn/backends/IMemoryManager.hpp
>
8
9
#include <forward_list>
10
#include <vector>
11
12
namespace
armnn
13
{
14
15
// An implementation of IMemoryManager to be used with EthosnRefTensorHandle
16
class
EthosnRefMemoryManager
:
public
IMemoryManager
17
{
18
public
:
19
EthosnRefMemoryManager
();
20
virtual
~EthosnRefMemoryManager
();
21
22
class
Pool
;
23
24
Pool
*
Manage
(
unsigned
int
numBytes);
25
26
void
Allocate
(
Pool
*pool);
27
28
void
*
GetPointer
(
Pool
*pool);
29
30
void
Acquire
()
override
;
31
void
Release
()
override
;
32
33
class
Pool
34
{
35
public
:
36
Pool
(
unsigned
int
numBytes);
37
~Pool
();
38
39
void
Acquire
();
40
void
Release
();
41
42
void
*
GetPointer
();
43
44
void
Reserve
(
unsigned
int
numBytes);
45
46
private
:
47
unsigned
int
m_Size;
48
void
* m_Pointer;
49
};
50
51
private
:
52
EthosnRefMemoryManager
(
const
EthosnRefMemoryManager
&) =
delete
;
// Noncopyable
53
EthosnRefMemoryManager
& operator=(
const
EthosnRefMemoryManager
&) =
delete
;
// Noncopyable
54
55
std::forward_list<Pool> m_Pools;
56
std::vector<Pool*> m_FreePools;
57
};
58
59
}
armnn::EthosnRefMemoryManager
Definition:
EthosnRefMemoryManager.hpp:16
armnn::EthosnRefMemoryManager::Pool::Pool
Pool(unsigned int numBytes)
Definition:
EthosnRefMemoryManager.cpp:63
armnn::EthosnRefMemoryManager::Allocate
void Allocate(Pool *pool)
Definition:
EthosnRefMemoryManager.cpp:36
armnn::EthosnRefMemoryManager::Pool::~Pool
~Pool()
Definition:
EthosnRefMemoryManager.cpp:68
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition:
01_00_quick_start.dox:6
armnn::EthosnRefMemoryManager::Manage
Pool * Manage(unsigned int numBytes)
Definition:
EthosnRefMemoryManager.cpp:20
armnn::EthosnRefMemoryManager::~EthosnRefMemoryManager
virtual ~EthosnRefMemoryManager()
Definition:
EthosnRefMemoryManager.cpp:17
armnn::EthosnRefMemoryManager::Acquire
void Acquire() override
Definition:
EthosnRefMemoryManager.cpp:47
armnn::EthosnRefMemoryManager::Release
void Release() override
Definition:
EthosnRefMemoryManager.cpp:55
armnn::IMemoryManager
Definition:
IMemoryManager.hpp:12
armnn::EthosnRefMemoryManager::Pool::Release
void Release()
Definition:
EthosnRefMemoryManager.cpp:94
armnn::EthosnRefMemoryManager::Pool::GetPointer
void * GetPointer()
Definition:
EthosnRefMemoryManager.cpp:76
armnn::EthosnRefMemoryManager::GetPointer
void * GetPointer(Pool *pool)
Definition:
EthosnRefMemoryManager.cpp:42
armnn::EthosnRefMemoryManager::EthosnRefMemoryManager
EthosnRefMemoryManager()
Definition:
EthosnRefMemoryManager.cpp:14
IMemoryManager.hpp
armnn::EthosnRefMemoryManager::Pool::Reserve
void Reserve(unsigned int numBytes)
Definition:
EthosnRefMemoryManager.cpp:82
armnn::EthosnRefMemoryManager::Pool::Acquire
void Acquire()
Definition:
EthosnRefMemoryManager.cpp:88
armnn::EthosnRefMemoryManager::Pool
Definition:
EthosnRefMemoryManager.hpp:33
src
backends
ethosnref
EthosnRefMemoryManager.hpp
Generated on Fri Aug 19 2022 14:38:30 for ArmNN by
1.8.13