24.02.1
|
Go to the documentation of this file.
24 #ifndef ARM_COMPUTE_RUNTIME_MEMORY_REGION_H
25 #define ARM_COMPUTE_RUNTIME_MEMORY_REGION_H
48 size_t space =
size + alignment;
49 _mem = std::shared_ptr<uint8_t>(
new uint8_t[space](), [](uint8_t *ptr) {
delete[] ptr; });
55 void *aligned_ptr = _mem.get();
56 std::align(alignment,
size, aligned_ptr, space);
90 return std::make_unique<MemoryRegion>(
static_cast<uint8_t *
>(_ptr) +
offset,
size);
99 std::shared_ptr<uint8_t> _mem;
size_t size() const
Memory region size accessor.
std::unique_ptr< IMemoryRegion > extract_subregion(size_t offset, size_t size) final
Extract a sub-region from the memory.
MemoryRegion & operator=(const MemoryRegion &)=delete
Prevent instances of this class from being copied (As this class contains pointers)
Memory region CPU implementation.
void * buffer() final
Returns the pointer to the allocated data.
__global uchar * offset(const Image *img, int x, int y)
Get the pointer position of a Image.
MemoryRegion(void *ptr, size_t size)
MemoryRegion(size_t size, size_t alignment=0)
Constructor.
const void * buffer() const final
Returns the pointer to the allocated data.
Copyright (c) 2017-2024 Arm Limited.