21.02
|
Interface for OpenGL ES tensor. More...
#include <GCTensor.h>
Public Member Functions | |
GCTensor (IRuntimeContext *ctx=nullptr) | |
Default constructor. More... | |
GCTensor (const GCTensor &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
GCTensor & | operator= (const GCTensor &)=delete |
Prevent instances of this class from being copy assigned (As this class contains pointers) More... | |
GCTensor (GCTensor &&)=default | |
Allow instances of this class to be moved. More... | |
GCTensor & | operator= (GCTensor &&)=default |
Allow instances of this class to be moved. More... | |
virtual | ~GCTensor ()=default |
Virtual destructor. More... | |
ITensorAllocator * | allocator () |
Return a pointer to the tensor's allocator. More... | |
void | map (bool blocking=true) |
Enqueue a map operation of the allocated buffer on the given queue. More... | |
void | unmap () |
Enqueue an unmap operation of the allocated and mapped buffer on the given queue. More... | |
TensorInfo * | info () const override |
Interface to be implemented by the child class to return the tensor's metadata. More... | |
TensorInfo * | info () override |
Interface to be implemented by the child class to return the tensor's metadata. More... | |
uint8_t * | buffer () const override |
Interface to be implemented by the child class to return a pointer to CPU memory. More... | |
GLuint | gc_buffer () const override |
Interface to be implemented by the child class to return the tensor's gles compute buffer id. More... | |
void | associate_memory_group (IMemoryGroup *memory_group) override |
Associates a memory managable object with the memory group that manages it. More... | |
Public Member Functions inherited from IGCTensor | |
IGCTensor () | |
Default constructor. More... | |
IGCTensor (const IGCTensor &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
IGCTensor & | operator= (const IGCTensor &)=delete |
Prevent instances of this class from being copy assigned (As this class contains pointers) More... | |
IGCTensor (IGCTensor &&)=default | |
Allow instances of this class to be moved. More... | |
IGCTensor & | operator= (IGCTensor &&)=default |
Allow instances of this class to be moved. More... | |
virtual | ~IGCTensor ()=default |
Virtual destructor. More... | |
void | map (bool blocking=true) |
Map on an allocated buffer. More... | |
void | unmap () |
Unmap an allocated and mapped buffer. More... | |
void | clear () |
Clear the contents of the tensor synchronously. More... | |
bool | needs_shifting () const |
Flag indicating whether the tensor has been left aligned by a kernel and therefore needs shifting. More... | |
void | set_needs_shifting (bool needs_shifting) |
Set the flag indicating whether or not a tensor needs shifting. 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... | |
bool | is_used () const |
Flags if the tensor is used or not. More... | |
void | mark_as_unused () const |
Marks a tensor as unused. More... | |
Public Member Functions inherited from IMemoryManageable | |
virtual | ~IMemoryManageable ()=default |
Default virtual destructor. More... | |
Interface for OpenGL ES tensor.
Definition at line 38 of file GCTensor.h.
GCTensor | ( | IRuntimeContext * | ctx = nullptr | ) |
Default constructor.
[in] | ctx | (Optional) Pointer to the runtime context. |
Definition at line 29 of file GCTensor.cpp.
Prevent instances of this class from being copied (As this class contains pointers)
|
virtualdefault |
Virtual destructor.
ITensorAllocator * allocator | ( | ) |
Return a pointer to the tensor's allocator.
Definition at line 34 of file GCTensor.cpp.
Referenced by GCTensorHandle::allocate(), GCNormalizationLayer::configure(), GCSoftmaxLayer::configure(), GCGEMM::configure(), GCConvolutionLayer::configure(), arm_compute::test::create_tensor(), GCTensorHandle::free(), GCTensorHandle::GCTensorHandle(), GCFullyConnectedLayer::prepare(), GCGEMM::prepare(), GCConvolutionLayer::prepare(), and GCTensorHandle::release_if_unused().
|
overridevirtual |
Associates a memory managable object with the memory group that manages it.
[in] | memory_group | Memory group that manages the object. |
Implements IMemoryManageable.
Definition at line 59 of file GCTensor.cpp.
References GCTensorAllocator::set_associated_memory_group().
|
overridevirtual |
Interface to be implemented by the child class to return a pointer to CPU memory.
Reimplemented from IGCTensor.
Definition at line 49 of file GCTensor.cpp.
References GCTensorAllocator::data().
|
overridevirtual |
Interface to be implemented by the child class to return the tensor's gles compute buffer id.
Implements IGCTensor.
Definition at line 54 of file GCTensor.cpp.
References GCTensorAllocator::get_gl_ssbo_name().
Referenced by GCFullyConnectedLayer::configure().
|
overridevirtual |
Interface to be implemented by the child class to return the tensor's metadata.
Implements ITensor.
Definition at line 39 of file GCTensor.cpp.
References ITensorAllocator::info().
Referenced by GCConvolutionLayer::configure(), GCAccessor::data_layout(), GCAccessor::data_type(), GCAccessor::element_size(), GCAccessor::format(), GCAccessor::num_channels(), GCAccessor::num_elements(), GCAccessor::padding(), GCAccessor::quantization_info(), GCAccessor::shape(), and GCAccessor::size().
|
overridevirtual |
Interface to be implemented by the child class to return the tensor's metadata.
Implements ITensor.
Definition at line 44 of file GCTensor.cpp.
References ITensorAllocator::info().
void map | ( | bool | blocking = true | ) |
Enqueue a map operation of the allocated buffer on the given queue.
[in] | blocking | (Optional) 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 64 of file GCTensor.cpp.
References IGCTensor::map().
Referenced by GCAccessor::GCAccessor(), GCTensorHandle::map(), and arm_compute::utils::unmap().
Prevent instances of this class from being copy assigned (As this class contains pointers)
void unmap | ( | ) |
Enqueue an unmap operation of the allocated and mapped buffer on the given queue.
Definition at line 69 of file GCTensor.cpp.
References GCTensorAllocator::map(), IGCTensor::unmap(), and GCTensorAllocator::unmap().
Referenced by GCTensorHandle::unmap(), arm_compute::utils::unmap(), and GCAccessor::~GCAccessor().