32 : _buffer(), _mapping(nullptr)
49 return static_cast<uint8_t *
>(q.enqueueMapBuffer(_buffer, blocking ? CL_TRUE : CL_FALSE, CL_MAP_READ | CL_MAP_WRITE, 0,
size()));
55 q.enqueueUnmapMemObject(_buffer, mapping);
58 void CLLutAllocator::allocate()
60 _buffer = cl::Buffer(
CLScheduler::get().context(), CL_MEM_ALLOC_HOST_PTR | CL_MEM_READ_WRITE,
size());
63 uint8_t *CLLutAllocator::lock()
67 _mapping =
map(q,
true);
71 void CLLutAllocator::unlock()
static CLScheduler & get()
Access the scheduler singleton.
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
const cl::Buffer & cl_data() const
Interface to be implemented by the child class to return the pointer to the CL data.
Copyright (c) 2017-2021 Arm Limited.
Interface to enqueue OpenCL kernels and get/set the OpenCL CommandQueue and ICLTuner.
CLLutAllocator()
Default constructor.
cl::CommandQueue & queue()
Accessor for the associated CL command queue.
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.
size_t size() const
Returns the total size in bytes of the LUT.
void unmap(cl::CommandQueue &q, uint8_t *mapping)
Enqueue an unmap operation of the allocated buffer on the given queue.