35 : _owner(owner), _associated_memory_group(nullptr), _memory(), _mapping(nullptr)
46 if(_associated_memory_group ==
nullptr)
67 ARM_COMPUTE_ERROR_ON(_associated_memory_group !=
nullptr && _associated_memory_group != associated_memory_group);
70 _associated_memory_group = associated_memory_group;
73 uint8_t *GCTensorAllocator::lock()
78 void GCTensorAllocator::unlock()
93 _mapping =
reinterpret_cast<uint8_t *
>(_memory.
gc_region()->
map(blocking));
const GLuint & gc_ssbo_name() const
Returns the underlying CL buffer.
uint8_t * map(bool blocking)
Enqueue a map operation of the allocated buffer on the given queue.
void free() override
Free allocated GLES memory.
void set_associated_memory_group(IMemoryGroup *associated_memory_group)
Associates the tensor with a memory group.
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
void unmap()
Enqueue an unmap operation of the allocated buffer on the given queue.
IMemoryRegion * region() final
Region accessor.
Copyright (c) 2017-2021 Arm Limited.
virtual void unmap()=0
Enqueue an unmap operation of the allocated buffer on the given queue.
void allocate() override
Allocate size specified by TensorInfo of GLES memory.
virtual void finalize_memory(IMemoryManageable *obj, IMemory &obj_memory, size_t size, size_t alignment)=0
Finalizes memory for a given object.
uint8_t * data()
Interface to be implemented by the child class to return the pointer to the mapped data...
GLuint get_gl_ssbo_name() const
Get the OpenGL ES buffer object name.
size_t alignment() const
Return underlying's tensor buffer alignment.
ITensorInfo & set_is_resizable(bool is_resizable) override
Set the flag whether the tensor size can be changed.
IGCMemoryRegion * gc_region()
GLES Region accessor.
TensorInfo & info()
Return a reference to the tensor's metadata.
Interface of an object than can be memory managed.
GCTensorAllocator(IMemoryManageable *owner=nullptr)
Default constructor.
Interface to enqueue GLES kernels and get/set the GLES CommandQueue.
void set_region(IMemoryRegion *region) final
Sets a memory region.
virtual void * map(bool blocking)=0
Enqueue a map operation of the allocated buffer on the given queue.
void set_owned_region(std::unique_ptr< IMemoryRegion > region) final
Sets a memory region.