diff options
Diffstat (limited to 'src/runtime/OffsetLifetimeManager.cpp')
-rw-r--r-- | src/runtime/OffsetLifetimeManager.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/runtime/OffsetLifetimeManager.cpp b/src/runtime/OffsetLifetimeManager.cpp index 3133202bf3..d746f618b5 100644 --- a/src/runtime/OffsetLifetimeManager.cpp +++ b/src/runtime/OffsetLifetimeManager.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 ARM Limited. + * Copyright (c) 2017-2020 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -27,7 +27,6 @@ #include "arm_compute/runtime/IAllocator.h" #include "arm_compute/runtime/IMemoryGroup.h" #include "arm_compute/runtime/OffsetMemoryPool.h" -#include "support/MemorySupport.h" #include <algorithm> #include <cmath> @@ -44,8 +43,7 @@ size_t align_offset(size_t offset, size_t alignment) return (remainder != 0U) ? offset + (alignment - remainder) : offset; } } // namespace -OffsetLifetimeManager::OffsetLifetimeManager() - : _blob(0) +OffsetLifetimeManager::OffsetLifetimeManager() : _blob(0) { } @@ -57,7 +55,7 @@ const OffsetLifetimeManager::info_type &OffsetLifetimeManager::info() const std::unique_ptr<IMemoryPool> OffsetLifetimeManager::create_pool(IAllocator *allocator) { ARM_COMPUTE_ERROR_ON(allocator == nullptr); - return support::cpp14::make_unique<OffsetMemoryPool>(allocator, _blob); + return std::make_unique<OffsetMemoryPool>(allocator, _blob); } MappingType OffsetLifetimeManager::mapping_type() const @@ -72,21 +70,22 @@ void OffsetLifetimeManager::update_blobs_and_mappings() // Update blob size size_t max_aggregated_size = 0; - std::for_each(std::begin(_free_blobs), std::end(_free_blobs), [&](const Blob & b) - { - max_aggregated_size += b.max_size; - _blob.alignment = std::max(_blob.alignment, b.max_alignment); - }); + std::for_each(std::begin(_free_blobs), std::end(_free_blobs), + [&](const Blob &b) + { + max_aggregated_size += b.max_size; + _blob.alignment = std::max(_blob.alignment, b.max_alignment); + }); max_aggregated_size += _free_blobs.size() * _blob.alignment; _blob.owners = std::max(_blob.owners, _free_blobs.size()); _blob.size = std::max(_blob.size, max_aggregated_size); // Calculate group mappings - auto &group_mappings = _active_group->mappings(); + auto &group_mappings = _active_group->mappings(); size_t offset = 0; - for(auto &free_blob : _free_blobs) + for (auto &free_blob : _free_blobs) { - for(auto &bound_element_id : free_blob.bound_elements) + 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]; |