24.02.1
|
Go to the documentation of this file.
36 : _allocator(
allocator), _blobs(), _blob_info(std::move(blob_info))
39 allocate_blobs(_blob_info);
50 for (
auto &handle : handles)
53 handle.first->set_region(_blobs[handle.second].get());
59 for (
auto &handle : handles)
62 handle.first->set_region(
nullptr);
74 return std::make_unique<BlobMemoryPool>(_allocator, _blob_info);
77 void BlobMemoryPool::allocate_blobs(
const std::vector<BlobInfo> &blob_info)
81 for (
const auto &bi : blob_info)
83 _blobs.push_back(_allocator->
make_region(bi.size, bi.alignment));
87 void BlobMemoryPool::free_blobs()
BlobMemoryPool(IAllocator *allocator, std::vector< BlobInfo > blob_info)
Default Constructor.
void release(MemoryMappings &handles) override
Releases a memory block.
~BlobMemoryPool()
Default Destructor.
MappingType mapping_type() const override
Returns the mapping types that this pool accepts.
void acquire(MemoryMappings &handles) override
Sets occupant to the memory pool.
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
virtual std::unique_ptr< IMemoryRegion > make_region(size_t size, size_t alignment)=0
Create self-managed memory region.
Copyright (c) 2017-2024 Arm Limited.
std::map< IMemory *, size_t > MemoryMappings
A map of (handle, index/offset), where handle is the memory handle of the object to provide the memor...
@ BLOBS
Mappings are in blob granularity.
std::unique_ptr< IMemoryPool > duplicate() override
Duplicates the existing memory pool.
input allocator() -> allocate()