aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/memory/OffsetLifetimeManager.cpp
diff options
context:
space:
mode:
authorAron Virginas-Tar <Aron.Virginas-Tar@arm.com>2018-10-12 15:18:03 +0100
committerMatthew Bentham <matthew.bentham@arm.com>2018-10-22 16:57:53 +0100
commitf9aeef0e036df176699aa96d30d2ca8d7546534e (patch)
tree09ad918f7d2cffbca2c013c688332fa687b8d8ca /src/armnn/memory/OffsetLifetimeManager.cpp
parent3b278e9261bd0de67c82f7d6c36731f118124f52 (diff)
downloadarmnn-f9aeef0e036df176699aa96d30d2ca8d7546534e.tar.gz
IVGCVSW-2006: Move ACL memory manager source code under aclCommon
Change-Id: Ie1c74a18de5c3dd1cd5285c222bd6327489c1508
Diffstat (limited to 'src/armnn/memory/OffsetLifetimeManager.cpp')
-rw-r--r--src/armnn/memory/OffsetLifetimeManager.cpp62
1 files changed, 0 insertions, 62 deletions
diff --git a/src/armnn/memory/OffsetLifetimeManager.cpp b/src/armnn/memory/OffsetLifetimeManager.cpp
deleted file mode 100644
index 6d479721d9..0000000000
--- a/src/armnn/memory/OffsetLifetimeManager.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// Copyright © 2017 Arm Ltd. All rights reserved.
-// SPDX-License-Identifier: MIT
-//
-#include "OffsetLifetimeManager.hpp"
-#include "OffsetMemoryPool.hpp"
-
-#include "arm_compute/runtime/IMemoryGroup.h"
-
-#include <numeric>
-
-#include "boost/assert.hpp"
-
-namespace armnn
-{
-
-OffsetLifetimeManager::OffsetLifetimeManager()
- : m_BlobSize(0)
-{
-}
-
-std::unique_ptr<arm_compute::IMemoryPool> OffsetLifetimeManager::create_pool(arm_compute::IAllocator* allocator)
-{
- BOOST_ASSERT(allocator);
- return std::make_unique<OffsetMemoryPool>(allocator, m_BlobSize);
-}
-
-arm_compute::MappingType OffsetLifetimeManager::mapping_type() const
-{
- return arm_compute::MappingType::OFFSETS;
-}
-
-void OffsetLifetimeManager::update_blobs_and_mappings()
-{
- BOOST_ASSERT(are_all_finalized());
- BOOST_ASSERT(_active_group);
-
- // Update blob size
- size_t maxGroupSize = std::accumulate(std::begin(_free_blobs), std::end(_free_blobs),
- static_cast<size_t>(0), [](size_t s, const Blob& b)
- {
- return s + b.max_size;
- });
- m_BlobSize = std::max(m_BlobSize, maxGroupSize);
-
- // Calculate group mappings
- auto& groupMappings = _active_group->mappings();
- size_t offset = 0;
- for(auto& freeBlob : _free_blobs)
- {
- for(auto& boundElementId : freeBlob.bound_elements)
- {
- BOOST_ASSERT(_active_elements.find(boundElementId) != std::end(_active_elements));
- Element& boundElement = _active_elements[boundElementId];
- groupMappings[boundElement.handle] = offset;
- }
- offset += freeBlob.max_size;
- BOOST_ASSERT(offset <= m_BlobSize);
- }
-}
-
-} // namespace armnn \ No newline at end of file