aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/OffsetLifetimeManager.cpp
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2018-05-03 20:47:16 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:51:50 +0000
commit3d1489de593574e65ef1e64a7ae64e4e56c2978b (patch)
treef87f3df521cb5ed8bd383dad89cbeb92c49670ac /src/runtime/OffsetLifetimeManager.cpp
parent54d6fae4dbb4f556cc5ec484c51681ad84c015a7 (diff)
downloadComputeLibrary-3d1489de593574e65ef1e64a7ae64e4e56c2978b.tar.gz
COMPMID-605: Transition buffer memory manager
Change-Id: Ide7c6124eb19f13f15f517e62d705646a0cd1ecd Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/130184 Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com> Tested-by: Jenkins <bsgcomp@arm.com> Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'src/runtime/OffsetLifetimeManager.cpp')
-rw-r--r--src/runtime/OffsetLifetimeManager.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/runtime/OffsetLifetimeManager.cpp b/src/runtime/OffsetLifetimeManager.cpp
index 4540aeab28..d0b3bde724 100644
--- a/src/runtime/OffsetLifetimeManager.cpp
+++ b/src/runtime/OffsetLifetimeManager.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 ARM Limited.
+ * Copyright (c) 2017-2018 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -58,19 +58,24 @@ void OffsetLifetimeManager::update_blobs_and_mappings()
ARM_COMPUTE_ERROR_ON(_active_group == nullptr);
// Update blob size
- size_t max_group_size = std::accumulate(std::begin(_active_elements), std::end(_active_elements), static_cast<size_t>(0), [](size_t s, const Element & e)
+ size_t max_group_size = std::accumulate(std::begin(_free_blobs), std::end(_free_blobs), static_cast<size_t>(0), [](size_t s, const Blob & b)
{
- return s + e.size;
+ return s + b.max_size;
});
_blob = std::max(_blob, max_group_size);
// Calculate group mappings
auto &group_mappings = _active_group->mappings();
size_t offset = 0;
- for(auto &e : _active_elements)
+ for(auto &free_blob : _free_blobs)
{
- group_mappings[e.handle] = offset;
- offset += e.size;
+ for(auto &bound_element_id : free_blob.bound_elements)
+ {
+ ARM_COMPUTE_ERROR_ON(_active_elements.find(bound_element_id) == std::end(_active_elements));
+ Element &bound_element = _active_elements[bound_element_id];
+ group_mappings[bound_element.handle] = offset;
+ }
+ offset += free_blob.max_size;
ARM_COMPUTE_ERROR_ON(offset > _blob);
}
}