aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/BlobLifetimeManager.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/BlobLifetimeManager.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/BlobLifetimeManager.cpp')
-rw-r--r--src/runtime/BlobLifetimeManager.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/runtime/BlobLifetimeManager.cpp b/src/runtime/BlobLifetimeManager.cpp
index 2a4ab6ec0d..9fef943fb5 100644
--- a/src/runtime/BlobLifetimeManager.cpp
+++ b/src/runtime/BlobLifetimeManager.cpp
@@ -62,19 +62,21 @@ void BlobLifetimeManager::update_blobs_and_mappings()
{
return ba.max_size > bb.max_size;
});
- std::vector<size_t> group_sizes;
+
+ // Create group sizes vector
+ std::vector<BlobInfo> group_sizes;
std::transform(std::begin(_free_blobs), std::end(_free_blobs), std::back_inserter(group_sizes), [](const Blob & b)
{
- return b.max_size;
+ return BlobInfo(b.max_size, b.max_alignment);
});
// Update blob sizes
size_t max_size = std::max(_blobs.size(), group_sizes.size());
- _blobs.resize(max_size, 0);
- group_sizes.resize(max_size, 0);
- std::transform(std::begin(_blobs), std::end(_blobs), std::begin(group_sizes), std::begin(_blobs), [](size_t lhs, size_t rhs)
+ _blobs.resize(max_size);
+ group_sizes.resize(max_size);
+ std::transform(std::begin(_blobs), std::end(_blobs), std::begin(group_sizes), std::begin(_blobs), [](BlobInfo lhs, BlobInfo rhs)
{
- return std::max(lhs, rhs);
+ return BlobInfo(std::max(lhs.size, rhs.size), std::max(lhs.alignment, rhs.alignment));
});
// Calculate group mappings