From 6940dd720ebb6b3d1df8ca203ab696daefe58189 Mon Sep 17 00:00:00 2001 From: Jim Flynn Date: Fri, 20 Mar 2020 12:25:56 +0000 Subject: renamed Documentation folder 20.02 and added .nojekyll file Signed-off-by: Jim Flynn --- 20.02/_base_memory_manager_8cpp_source.xhtml | 127 +++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 20.02/_base_memory_manager_8cpp_source.xhtml (limited to '20.02/_base_memory_manager_8cpp_source.xhtml') diff --git a/20.02/_base_memory_manager_8cpp_source.xhtml b/20.02/_base_memory_manager_8cpp_source.xhtml new file mode 100644 index 0000000000..e4631a869f --- /dev/null +++ b/20.02/_base_memory_manager_8cpp_source.xhtml @@ -0,0 +1,127 @@ + + + + + + + + + + + + + +ArmNN: src/backends/aclCommon/BaseMemoryManager.cpp Source File + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  20.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
BaseMemoryManager.cpp
+
+
+Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 #include "BaseMemoryManager.hpp"
6 
7 #if defined(ARMCOMPUTENEON_ENABLED) || defined(ARMCOMPUTECL_ENABLED)
8 #include "arm_compute/runtime/BlobLifetimeManager.h"
9 #include "arm_compute/runtime/PoolManager.h"
10 #include "arm_compute/runtime/OffsetLifetimeManager.h"
11 #endif
12 
13 #include <boost/polymorphic_cast.hpp>
14 
15 namespace armnn
16 {
17 
18 #if defined(ARMCOMPUTENEON_ENABLED) || defined(ARMCOMPUTECL_ENABLED)
19 BaseMemoryManager::BaseMemoryManager(std::unique_ptr<arm_compute::IAllocator> alloc,
20  MemoryAffinity memoryAffinity)
21 {
22  BOOST_ASSERT(alloc);
23  m_Allocator = std::move(alloc);
24 
27 }
28 
29 std::shared_ptr<arm_compute::MemoryManagerOnDemand>
31 {
32  std::shared_ptr<arm_compute::ILifetimeManager> lifetimeManager = nullptr;
33 
34  if (memoryAffinity == MemoryAffinity::Buffer)
35  {
36  lifetimeManager = std::make_shared<arm_compute::BlobLifetimeManager>();
37  }
38  else
39  {
40  lifetimeManager = std::make_shared<arm_compute::OffsetLifetimeManager>();
41  }
42 
43  auto poolManager = std::make_shared<arm_compute::PoolManager>();
44  auto memoryManager = std::make_shared<arm_compute::MemoryManagerOnDemand>(lifetimeManager, poolManager);
45 
46  return memoryManager;
47 }
48 
50 {
51  static const size_t s_NumPools = 1;
52 
53  // Allocate memory pools for intra-layer memory manager
54  BOOST_ASSERT(m_IntraLayerMemoryMgr);
55  m_IntraLayerMemoryMgr->populate(*m_Allocator, s_NumPools);
56 
57  // Allocate memory pools for inter-layer memory manager
58  BOOST_ASSERT(m_InterLayerMemoryMgr);
59  m_InterLayerMemoryMgr->populate(*m_Allocator, s_NumPools);
60 
61  // Acquire inter-layer memory group. NOTE: This has to come after allocating the pools
62  BOOST_ASSERT(m_InterLayerMemoryGroup);
63  m_InterLayerMemoryGroup->acquire();
64 }
65 
67 {
68  // Release inter-layer memory group. NOTE: This has to come before releasing the pools
69  BOOST_ASSERT(m_InterLayerMemoryGroup);
70  m_InterLayerMemoryGroup->release();
71 
72  // Release memory pools managed by intra-layer memory manager
73  BOOST_ASSERT(m_IntraLayerMemoryMgr);
74  m_IntraLayerMemoryMgr->clear();
75 
76  // Release memory pools managed by inter-layer memory manager
77  BOOST_ASSERT(m_InterLayerMemoryMgr);
78  m_InterLayerMemoryMgr->clear();
79 }
80 #else
82 {
83  // No-op if neither NEON nor CL enabled
84 }
85 
87 {
88  // No-op if neither NEON nor CL enabled
89 }
90 #endif
91 
92 #if defined(ARMCOMPUTENEON_ENABLED)
93 std::shared_ptr<arm_compute::IMemoryGroup>
94 NeonMemoryManager::CreateMemoryGroup(const std::shared_ptr<arm_compute::MemoryManagerOnDemand>& memoryManager)
95 {
96  return std::make_shared<arm_compute::MemoryGroup>(memoryManager);
97 }
98 #endif
99 
100 #if defined(ARMCOMPUTECL_ENABLED)
101 std::shared_ptr<arm_compute::IMemoryGroup>
102 ClMemoryManager::CreateMemoryGroup(const std::shared_ptr<arm_compute::MemoryManagerOnDemand>& memoryManager)
103 {
104  return std::make_shared<arm_compute::MemoryGroup>(memoryManager);
105 }
106 #endif
107 
108 }
std::shared_ptr< arm_compute::MemoryManagerOnDemand > CreateArmComputeMemoryManager(MemoryAffinity memoryAffinity)
+ +
std::shared_ptr< arm_compute::IMemoryGroup > CreateMemoryGroup(const std::shared_ptr< arm_compute::MemoryManagerOnDemand > &memoryManager) override
+ + +
std::shared_ptr< arm_compute::MemoryManagerOnDemand > m_InterLayerMemoryMgr
+
std::shared_ptr< arm_compute::MemoryManagerOnDemand > m_IntraLayerMemoryMgr
+ +
Copyright (c) 2020 ARM Limited.
+ +
std::shared_ptr< arm_compute::IMemoryGroup > CreateMemoryGroup(const std::shared_ptr< arm_compute::MemoryManagerOnDemand > &memoryManager) override
+
std::shared_ptr< arm_compute::IMemoryGroup > m_InterLayerMemoryGroup
+ +
std::unique_ptr< arm_compute::IAllocator > m_Allocator
+
+
+ + + + -- cgit v1.2.1