21.02
|
Basic implementation of a CL memory LUT allocator. More...
#include <CLLutAllocator.h>
Public Member Functions | |
CLLutAllocator () | |
Default constructor. More... | |
~CLLutAllocator ()=default | |
Default destructor. More... | |
CLLutAllocator (const CLLutAllocator &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
const CLLutAllocator & | operator= (const CLLutAllocator &)=delete |
Prevent instances of this class from being copy assigned (As this class contains pointers) More... | |
uint8_t * | data () |
Interface to be implemented by the child class to return the pointer to the mapped data. More... | |
const cl::Buffer & | cl_data () const |
Interface to be implemented by the child class to return the pointer to the CL data. More... | |
uint8_t * | map (cl::CommandQueue &q, bool blocking) |
Enqueue a map operation of the allocated buffer on the given queue. More... | |
void | unmap (cl::CommandQueue &q, uint8_t *mapping) |
Enqueue an unmap operation of the allocated buffer on the given queue. More... | |
Public Member Functions inherited from ILutAllocator | |
ILutAllocator () | |
Default constructor. More... | |
virtual | ~ILutAllocator ()=default |
Default virtual destructor. More... | |
ILutAllocator (ILutAllocator &&)=default | |
Allow instances of this class to be move constructed. More... | |
ILutAllocator & | operator= (ILutAllocator &&)=default |
Allow instances of this class to be moved. More... | |
void | init (size_t num_elements, DataType data_type) |
Allocate an LUT of the requested number of elements and data_type. More... | |
size_t | num_elements () const |
Returns the total number of elements in the LUT. More... | |
DataType | type () const |
Returns the type of the LUT. More... | |
size_t | size () const |
Returns the total size in bytes of the LUT. More... | |
Basic implementation of a CL memory LUT allocator.
Definition at line 36 of file CLLutAllocator.h.
CLLutAllocator | ( | ) |
Default constructor.
Definition at line 31 of file CLLutAllocator.cpp.
|
default |
Default destructor.
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
const cl::Buffer & cl_data | ( | ) | const |
Interface to be implemented by the child class to return the pointer to the CL data.
Definition at line 41 of file CLLutAllocator.cpp.
Referenced by CLLut::cl_buffer().
uint8_t * data | ( | ) |
Interface to be implemented by the child class to return the pointer to the mapped data.
Definition at line 36 of file CLLutAllocator.cpp.
uint8_t * map | ( | cl::CommandQueue & | q, |
bool | blocking | ||
) |
Enqueue a map operation of the allocated buffer on the given queue.
[in,out] | q | The CL command queue to use for the mapping operation. |
[in] | blocking | If true, then the mapping will be ready to use by the time this method returns, else it is the caller's responsibility to flush the queue and wait for the mapping operation to have completed before using the returned mapping pointer. |
Definition at line 46 of file CLLutAllocator.cpp.
References ARM_COMPUTE_ERROR_ON, and ILutAllocator::size().
Referenced by CLLut::clear(), CLLut::unmap(), and CLLutAllocator::unmap().
|
delete |
Prevent instances of this class from being copy assigned (As this class contains pointers)
void unmap | ( | cl::CommandQueue & | q, |
uint8_t * | mapping | ||
) |
Enqueue an unmap operation of the allocated buffer on the given queue.
[in,out] | q | The CL command queue to use for the mapping operation. |
[in] | mapping | The cpu mapping to unmap. |
Definition at line 52 of file CLLutAllocator.cpp.
References ARM_COMPUTE_ERROR_ON, CLScheduler::get(), CLLutAllocator::map(), CLScheduler::queue(), ILutAllocator::size(), and CLLutAllocator::unmap().
Referenced by CLLut::clear(), CLLut::unmap(), and CLLutAllocator::unmap().