aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/BlobMemoryPool.cpp
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2018-12-14 17:11:20 +0000
committerMichele Di Giorgio <michele.digiorgio@arm.com>2018-12-14 19:45:00 +0000
commit555f1c2241d6fa8c84926a72a0c54e4158817df4 (patch)
tree0ec5da469c28559d8c5df9848cfa3ada6e0646e8 /src/runtime/BlobMemoryPool.cpp
parentb4af2c6738614850aaca3754904f0e8e3b17f0b2 (diff)
downloadComputeLibrary-555f1c2241d6fa8c84926a72a0c54e4158817df4.tar.gz
COMPMID-1710: Account alignment for blob-base allocations
Change-Id: I290d33e25a5966d25a91df39ebc01c28bfa31f78 Reviewed-on: https://review.mlplatform.org/402 Reviewed-by: Anthony Barbier <Anthony.barbier@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/runtime/BlobMemoryPool.cpp')
-rw-r--r--src/runtime/BlobMemoryPool.cpp14
1 files changed, 7 insertions, 7 deletions
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<size_t> blob_sizes)
- : _allocator(allocator), _blobs(), _blob_sizes(std::move(blob_sizes))
+BlobMemoryPool::BlobMemoryPool(IAllocator *allocator, std::vector<BlobInfo> 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<IMemoryPool> BlobMemoryPool::duplicate()
{
ARM_COMPUTE_ERROR_ON(!_allocator);
- return support::cpp14::make_unique<BlobMemoryPool>(_allocator, _blob_sizes);
+ return support::cpp14::make_unique<BlobMemoryPool>(_allocator, _blob_info);
}
-void BlobMemoryPool::allocate_blobs(const std::vector<size_t> &sizes)
+void BlobMemoryPool::allocate_blobs(const std::vector<BlobInfo> &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));
}
}