24.02
|
Interface for OpenCL tensor. More...
#include <ICLTensor.h>
Public Member Functions | |
ICLTensor () | |
Default constructor. More... | |
ICLTensor (const ICLTensor &)=delete | |
Prevent instances of this class from being copy constructed. More... | |
ICLTensor & | operator= (const ICLTensor &)=delete |
Prevent instances of this class from being copied. More... | |
ICLTensor (ICLTensor &&)=default | |
Allow instances of this class to be move constructed. More... | |
ICLTensor & | operator= (ICLTensor &&)=default |
Allow instances of this class to be copied. More... | |
virtual | ~ICLTensor ()=default |
Default virtual destructor. More... | |
virtual CLQuantization | quantization () const =0 |
Interface to be implemented by the child class to return the wrapped quantization info data. More... | |
virtual const cl::Buffer & | cl_buffer () const =0 |
Interface to be implemented by the child class to return a reference to the OpenCL buffer containing the image's data. More... | |
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... | |
void | clear (cl::CommandQueue &q) |
Clear the contents of the tensor synchronously. More... | |
uint8_t * | buffer () const override |
Interface to be implemented by the child class to return a pointer to CPU memory. More... | |
Public Member Functions inherited from ITensor | |
virtual ITensorInfo * | info () const =0 |
Interface to be implemented by the child class to return the tensor's metadata. More... | |
virtual ITensorInfo * | info ()=0 |
Interface to be implemented by the child class to return the tensor's metadata. More... | |
virtual | ~ITensor ()=default |
Default virtual destructor. More... | |
uint8_t * | ptr_to_element (const Coordinates &id) const |
Return a pointer to the element at the passed coordinates. More... | |
void | copy_from (const ITensor &src) |
Copy the content of another tensor. More... | |
void | print (std::ostream &s, IOFormatInfo io_fmt=IOFormatInfo()) const |
Print a tensor to a given stream using user defined formatting information. More... | |
bool | is_used () const |
Flags if the tensor is used or not. More... | |
void | mark_as_unused () const |
Marks a tensor as unused. More... | |
void | mark_as_used () const |
Marks a tensor as used. More... | |
Interface for OpenCL tensor.
Definition at line 41 of file ICLTensor.h.
ICLTensor | ( | ) |
|
virtualdefault |
Default virtual destructor.
|
overridevirtual |
Interface to be implemented by the child class to return a pointer to CPU memory.
Implements ITensor.
Definition at line 52 of file ICLTensor.cpp.
Referenced by CLFFT1D::configure(), CLFFTConvolutionLayer::configure(), CLDirectDeconvolutionLayer::configure(), CLAccessor::data(), and CLQLSTMLayer::prepare().
|
pure virtual |
Interface to be implemented by the child class to return a reference to the OpenCL buffer containing the image's data.
Implemented in CLSubTensor, and CLTensor.
Referenced by CLSubTensor::cl_buffer(), CLAuxTensorHandler::CLAuxTensorHandler(), ClGemm::prepare(), CLReductionOperationKernel::run(), CLDepthwiseConvolutionLayerNativeKernel::run(), ClSoftmaxKernel::run_op(), and ClMatMulNativeKernel::run_op().
void clear | ( | cl::CommandQueue & | q | ) |
Clear the contents of the tensor synchronously.
[in,out] | q | The CL command queue to use for the clear operation. |
Definition at line 45 of file ICLTensor.cpp.
References ITensor::info(), ICLTensor::map(), and ICLTensor::unmap().
void map | ( | cl::CommandQueue & | q, |
bool | blocking = true |
||
) |
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 34 of file ICLTensor.cpp.
Referenced by ICLTensor::clear(), CLCropResize::configure(), CLSubTensor::map(), CLTensor::map(), and ClGemmLowpMatrixMultiplyCore::prepare().
Prevent instances of this class from being copied.
|
pure virtual |
Interface to be implemented by the child class to return the wrapped quantization info data.
Implemented in CLSubTensor, and CLTensor.
Referenced by CLSubTensor::quantization().
void unmap | ( | cl::CommandQueue & | q | ) |
Enqueue an unmap operation of the allocated and mapped buffer on the given queue.
[in,out] | q | The CL command queue to use for the mapping operation. |
Definition at line 39 of file ICLTensor.cpp.
Referenced by ICLTensor::clear(), CLCropResize::configure(), ClGemmLowpMatrixMultiplyCore::prepare(), CLSubTensor::unmap(), and CLTensor::unmap().