diff options
Diffstat (limited to 'src/armnn/backends/AclBaseMemoryManager.cpp')
-rw-r--r-- | src/armnn/backends/AclBaseMemoryManager.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/armnn/backends/AclBaseMemoryManager.cpp b/src/armnn/backends/AclBaseMemoryManager.cpp new file mode 100644 index 0000000000..fc796995c7 --- /dev/null +++ b/src/armnn/backends/AclBaseMemoryManager.cpp @@ -0,0 +1,32 @@ +// +// Copyright © 2017 Arm Ltd. All rights reserved. +// See LICENSE file in the project root for full license information. +// +#include "AclBaseMemoryManager.hpp" + +namespace armnn +{ + +#if ARMCOMPUTENEON_ENABLED || ARMCOMPUTECL_ENABLED +AclBaseMemoryManager::AclBaseMemoryManager(std::unique_ptr<arm_compute::IAllocator> alloc) +{ + // (re)create the memory manager components + m_Allocator = std::move(alloc); + m_IntraLayerLifetimeMgr = std::make_shared<arm_compute::BlobLifetimeManager>(); + m_IntraLayerPoolMgr = std::make_shared<arm_compute::PoolManager>(); + m_IntraLayerMemoryMgr = std::make_shared<arm_compute::MemoryManagerOnDemand>(m_IntraLayerLifetimeMgr, + m_IntraLayerPoolMgr); +} + +void AclBaseMemoryManager::Finalize() +{ + // Set allocator that the memory manager will use + m_IntraLayerMemoryMgr->set_allocator(m_Allocator.get()); + // Number of pools that the manager will create. This specifies how many layers you want to run in parallel + m_IntraLayerMemoryMgr->set_num_pools(1); + // Finalize the memory manager. (Validity checks, memory allocations, etc) + m_IntraLayerMemoryMgr->finalize(); +} +#endif + +} |