From fd627ffaec8fd8801d980b4c91ee7c0607ab6aaf Mon Sep 17 00:00:00 2001 From: Jan Eilers Date: Thu, 25 Feb 2021 17:44:00 +0000 Subject: IVGCVSW-5687 Update Doxygen Docu * Update Doxygen Documentation for 21.02 release Signed-off-by: Jan Eilers Change-Id: I9ed2f9caab038836ea99d7b378d7899fe431a4e5 --- 21.02/_sample_memory_manager_8cpp_source.xhtml | 130 +++++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 21.02/_sample_memory_manager_8cpp_source.xhtml (limited to '21.02/_sample_memory_manager_8cpp_source.xhtml') diff --git a/21.02/_sample_memory_manager_8cpp_source.xhtml b/21.02/_sample_memory_manager_8cpp_source.xhtml new file mode 100644 index 0000000000..4b2f852aae --- /dev/null +++ b/21.02/_sample_memory_manager_8cpp_source.xhtml @@ -0,0 +1,130 @@ + + + + + + + + + + + + + +ArmNN: src/dynamic/sample/SampleMemoryManager.cpp Source File + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  21.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
SampleMemoryManager.cpp
+
+
+Go to the documentation of this file.
1 //
2 // Copyright © 2020 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
7 
8 #include <algorithm>
9 
10 namespace sdb // sample dynamic backend
11 {
12 
14 {}
15 
17 {}
18 
20 {
21  if (!m_FreePools.empty())
22  {
23  Pool* res = m_FreePools.back();
24  m_FreePools.pop_back();
25  res->Reserve(numBytes);
26  return res;
27  }
28  else
29  {
30  m_Pools.push_front(Pool(numBytes));
31  return &m_Pools.front();
32  }
33 }
34 
36 {
37  m_FreePools.push_back(pool);
38 }
39 
41 {
42  return pool->GetPointer();
43 }
44 
46 {
47  for (Pool &pool: m_Pools)
48  {
49  pool.Acquire();
50  }
51 }
52 
54 {
55  for (Pool &pool: m_Pools)
56  {
57  pool.Release();
58  }
59 }
60 
61 SampleMemoryManager::Pool::Pool(unsigned int numBytes)
62  : m_Size(numBytes),
63  m_Pointer(nullptr)
64 {}
65 
67 {
68  if (m_Pointer)
69  {
70  Release();
71  }
72 }
73 
75 {
76  return m_Pointer;
77 }
78 
79 void SampleMemoryManager::Pool::Reserve(unsigned int numBytes)
80 {
81  m_Size = std::max(m_Size, numBytes);
82 }
83 
85 {
86  m_Pointer = ::operator new(size_t(m_Size));
87 }
88 
90 {
91  ::operator delete(m_Pointer);
92  m_Pointer = nullptr;
93 }
94 
95 } // namespace sdb
RefMemoryManager::Pool Pool
+ +
void Reserve(unsigned int numBytes)
+ + + + + +
Pool * Manage(unsigned int numBytes)
+ + + + + + + + +
+
+ + + + -- cgit v1.2.1