24 #ifndef ARM_COMPUTE_CLTENSORALLOCATOR_H 25 #define ARM_COMPUTE_CLTENSORALLOCATOR_H 40 class CLRuntimeContext;
69 const cl::Buffer &
cl_data()
const;
85 uint8_t *
map(cl::CommandQueue &q,
bool blocking);
94 void unmap(cl::CommandQueue &q, uint8_t *mapping);
108 void free()
override;
135 uint8_t *lock()
override;
137 void unlock()
override;
140 static const cl::Buffer _empty_buffer;
CLQuantization quantization() const
Wrapped quantization info data accessor.
OpenCL quantization data.
Copyright (c) 2017-2021 Arm Limited.
Status import_memory(cl::Buffer buffer)
Import an existing memory as a tensor's backing memory.
Basic implementation of a CL memory tensor allocator.
void set_associated_memory_group(IMemoryGroup *associated_memory_group)
Associates the tensor with a memory group.
uint8_t * data()
Interface to be implemented by the child class to return the pointer to the mapped data...
uint8_t * map(cl::CommandQueue &q, bool blocking)
Enqueue a map operation of the allocated buffer on the given queue.
CLTensorAllocator(IMemoryManageable *owner=nullptr, CLRuntimeContext *ctx=nullptr)
Default constructor.
void unmap(cl::CommandQueue &q, uint8_t *mapping)
Enqueue an unmap operation of the allocated buffer on the given queue.
void allocate() override
Allocate size specified by TensorInfo of OpenCL memory.
Interface of an object than can be memory managed.
OpenCL implementation of memory object.
const cl::Buffer & cl_data() const
Interface to be implemented by the child class to return the pointer to the CL data.
void free() override
Free allocated OpenCL memory.
Wrapper to configure the Khronos OpenCL C++ header.
CLTensorAllocator & operator=(const CLTensorAllocator &)=delete
Prevent instances of this class from being copy assigned (As this class contains pointers) ...
Interface to allocate tensors.