From 555f1c2241d6fa8c84926a72a0c54e4158817df4 Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Fri, 14 Dec 2018 17:11:20 +0000 Subject: COMPMID-1710: Account alignment for blob-base allocations Change-Id: I290d33e25a5966d25a91df39ebc01c28bfa31f78 Reviewed-on: https://review.mlplatform.org/402 Reviewed-by: Anthony Barbier Tested-by: Arm Jenkins --- src/runtime/BlobMemoryPool.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/runtime/BlobMemoryPool.cpp') diff --git a/src/runtime/BlobMemoryPool.cpp b/src/runtime/BlobMemoryPool.cpp index e09451cd62..812cbdd673 100644 --- a/src/runtime/BlobMemoryPool.cpp +++ b/src/runtime/BlobMemoryPool.cpp @@ -33,11 +33,11 @@ using namespace arm_compute; -BlobMemoryPool::BlobMemoryPool(IAllocator *allocator, std::vector blob_sizes) - : _allocator(allocator), _blobs(), _blob_sizes(std::move(blob_sizes)) +BlobMemoryPool::BlobMemoryPool(IAllocator *allocator, std::vector blob_info) + : _allocator(allocator), _blobs(), _blob_info(std::move(blob_info)) { ARM_COMPUTE_ERROR_ON(!allocator); - allocate_blobs(_blob_sizes); + allocate_blobs(_blob_info); } BlobMemoryPool::~BlobMemoryPool() @@ -73,16 +73,16 @@ MappingType BlobMemoryPool::mapping_type() const std::unique_ptr BlobMemoryPool::duplicate() { ARM_COMPUTE_ERROR_ON(!_allocator); - return support::cpp14::make_unique(_allocator, _blob_sizes); + return support::cpp14::make_unique(_allocator, _blob_info); } -void BlobMemoryPool::allocate_blobs(const std::vector &sizes) +void BlobMemoryPool::allocate_blobs(const std::vector &blob_info) { ARM_COMPUTE_ERROR_ON(!_allocator); - for(const auto &size : sizes) + for(const auto &bi : blob_info) { - _blobs.push_back(_allocator->make_region(size, 0)); + _blobs.push_back(_allocator->make_region(bi.size, bi.alignment)); } } -- cgit v1.2.1