24.02.1
|
Go to the documentation of this file.
40 size_t align_offset(
size_t offset,
size_t alignment)
42 const size_t remainder = (alignment != 0
U) ?
offset % alignment : 0U;
43 return (remainder != 0U) ?
offset + (alignment - remainder) :
offset;
58 return std::make_unique<OffsetMemoryPool>(
allocator, _blob);
66 void OffsetLifetimeManager::update_blobs_and_mappings()
72 size_t max_aggregated_size = 0;
76 max_aggregated_size +=
b.max_size;
79 max_aggregated_size += _free_blobs.size() * _blob.
alignment;
80 _blob.
owners = std::max(_blob.
owners, _free_blobs.size());
81 _blob.
size = std::max(_blob.
size, max_aggregated_size);
84 auto &group_mappings = _active_group->mappings();
86 for (
auto &free_blob : _free_blobs)
88 for (
auto &bound_element_id : free_blob.bound_elements)
91 Element &bound_element = _active_elements[bound_element_id];
92 group_mappings[bound_element.handle] =
offset;
94 offset += free_blob.max_size;
size_t owners
Number of owners in parallel of the blob.
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
MappingType mapping_type() const override
Returns the type of mappings that the lifetime manager returns.
@ OFFSETS
Mappings are in offset granularity in the same blob.
__global uchar * offset(const Image *img, int x, int y)
Get the pointer position of a Image.
const info_type & info() const
Accessor to the pool internal configuration meta-data.
std::unique_ptr< IMemoryPool > create_pool(IAllocator *allocator) override
Creates a memory pool depending on the memory requirements.
OffsetLifetimeManager()
Constructor.
Copyright (c) 2017-2024 Arm Limited.
void end(TokenStream &in, bool &valid)
bool are_all_finalized() const override
Checks if the lifetime of the registered object is complete.
size_t alignment
Blob alignment.
void for_each(F &&)
Base case of for_each.
Meta-data information for each blob.
input allocator() -> allocate()