21.02
|
Basic implementation of the OpenCL lut interface. More...
#include <CLLut.h>
Public Member Functions | |
CLLut () | |
Constructor. More... | |
CLLut (size_t num_elements, DataType data_type) | |
Constructor: initializes a LUT which can contain num_values values of data_type type. More... | |
ILutAllocator * | allocator () |
Return a pointer to the lut's allocator. More... | |
void | map (bool blocking=true) |
Enqueue a map operation of the allocated buffer. More... | |
void | unmap () |
Enqueue an unmap operation of the allocated and mapped buffer. More... | |
size_t | num_elements () const override |
Returns the total number of elements in the LUT. More... | |
uint32_t | index_offset () const override |
Indicates the offset that needs to be applied to the raw index before performing a lookup in the LUT. More... | |
size_t | size_in_bytes () const override |
Returns the total size in bytes of the LUT. More... | |
DataType | type () const override |
Returns the type of the LUT. More... | |
const cl::Buffer & | cl_buffer () const override |
Interface to be implemented by the child class to return a reference to the OpenCL buffer containing the lut's data. More... | |
void | clear () override |
Clears the LUT by setting every element to zero. More... | |
Public Member Functions inherited from ICLLut | |
ICLLut () | |
ICLLut (const ICLLut &)=delete | |
ICLLut & | operator= (const ICLLut &)=delete |
void | map (cl::CommandQueue &q, bool blocking=true) |
Enqueue a map operation of the allocated buffer on the given queue. More... | |
void | unmap (cl::CommandQueue &q) |
Enqueue an unmap operation of the allocated and mapped buffer on the given queue. More... | |
uint8_t * | buffer () const override |
Returns a pointer to the start of the LUT. More... | |
Public Member Functions inherited from ILut | |
virtual | ~ILut ()=default |
Default virtual destructor. More... | |
Constructor: initializes a LUT which can contain num_values values of data_type type.
[in] | num_elements | Number of elements of the LUT. |
[in] | data_type | Data type of each element. |
Definition at line 37 of file CLLut.cpp.
References ILutAllocator::init().
ILutAllocator * allocator | ( | ) |
|
overridevirtual |
Interface to be implemented by the child class to return a reference to the OpenCL buffer containing the lut's data.
Implements ICLLut.
Definition at line 63 of file CLLut.cpp.
References CLLutAllocator::cl_data().
|
overridevirtual |
Clears the LUT by setting every element to zero.
Implements ILut.
Definition at line 68 of file CLLut.cpp.
References CLScheduler::get(), CLLutAllocator::map(), CLScheduler::queue(), CLLut::size_in_bytes(), and CLLutAllocator::unmap().
|
overridevirtual |
Indicates the offset that needs to be applied to the raw index before performing a lookup in the LUT.
Implements ILut.
Definition at line 48 of file CLLut.cpp.
References CLLut::num_elements(), arm_compute::S16, and ILutAllocator::type().
Referenced by CLLutAccessor< T >::operator[]().
void map | ( | bool | blocking = true | ) |
Enqueue a map operation of the allocated buffer.
[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. |
Definition at line 81 of file CLLut.cpp.
References CLScheduler::get(), and ICLLut::map().
Referenced by CLLutAccessor< T >::CLLutAccessor().
|
overridevirtual |
Returns the total number of elements in the LUT.
Implements ILut.
Definition at line 43 of file CLLut.cpp.
References ILutAllocator::num_elements().
Referenced by CLLut::index_offset(), and CLLutAccessor< T >::num_elements().
|
overridevirtual |
Returns the total size in bytes of the LUT.
Implements ILut.
Definition at line 53 of file CLLut.cpp.
References ILutAllocator::size().
Referenced by CLLut::clear().
|
overridevirtual |
Returns the type of the LUT.
Implements ILut.
Definition at line 58 of file CLLut.cpp.
References ILutAllocator::type().
void unmap | ( | ) |
Enqueue an unmap operation of the allocated and mapped buffer.
Definition at line 86 of file CLLut.cpp.
References ICLLut::buffer(), CLScheduler::get(), CLLutAllocator::map(), ICLLut::unmap(), and CLLutAllocator::unmap().
Referenced by CLLutAccessor< T >::~CLLutAccessor().