Compute Library
17.10
|
Basic implementation of the OpenCL sub-tensor interface. More...
#include <CLSubTensor.h>
Public Member Functions | |
CLSubTensor (ICLTensor *parent, const TensorShape &tensor_shape, const Coordinates &coords) | |
Constructor. More... | |
~CLSubTensor ()=default | |
Destructor: free the tensor's memory. More... | |
CLSubTensor (const CLSubTensor &)=delete | |
Restrict instances of this class to be copy constructed. More... | |
CLSubTensor & | operator= (const CLSubTensor &)=delete |
Restrict instances of this class to be copied. More... | |
CLSubTensor (CLSubTensor &&)=default | |
Allow instances of this class to be move constructed. More... | |
CLSubTensor & | operator= (CLSubTensor &&)=default |
Allow instances of this class to be moved. 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... | |
ICLTensor * | parent () |
Return the parent tensor of the subtensor. More... | |
ITensorInfo * | info () const override |
Interface to be implemented by the child class to return the tensor's metadata. More... | |
ITensorInfo * | info () override |
Interface to be implemented by the child class to return the tensor's metadata. 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 image's data. More... | |
Public Member Functions inherited from ICLTensor | |
ICLTensor () | |
ICLTensor (const ICLTensor &)=delete | |
ICLTensor & | operator= (const ICLTensor &)=delete |
ICLTensor (ICLTensor &&)=default | |
ICLTensor & | operator= (ICLTensor &&)=default |
virtual | ~ICLTensor ()=default |
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 | ~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... | |
Basic implementation of the OpenCL sub-tensor interface.
Definition at line 37 of file CLSubTensor.h.
CLSubTensor | ( | ICLTensor * | parent, |
const TensorShape & | tensor_shape, | ||
const Coordinates & | coords | ||
) |
Constructor.
[in] | parent | Parent tensor |
[in] | tensor_shape | Shape of the subtensor |
[in] | coords | Coordinates of the first subtensor element inside the parent tensor. |
|
default |
Destructor: free the tensor's memory.
|
delete |
Restrict instances of this class to be copy constructed.
|
default |
Allow instances of this class to be move constructed.
|
overridevirtual |
Interface to be implemented by the child class to return a reference to the OpenCL buffer containing the image's data.
Implements ICLTensor.
|
overridevirtual |
Interface to be implemented by the child class to return the tensor's metadata.
Implements ITensor.
|
overridevirtual |
Interface to be implemented by the child class to return the tensor's metadata.
Implements ITensor.
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. |
|
delete |
Restrict instances of this class to be copied.
|
default |
Allow instances of this class to be moved.
ICLTensor* parent | ( | ) |
Return the parent tensor of the subtensor.
void unmap | ( | ) |
Enqueue an unmap operation of the allocated and mapped buffer.