ArmNN
 24.02
NeonTensorHandleDecorator Class Reference

#include <NeonTensorHandle.hpp>

Inheritance diagram for NeonTensorHandleDecorator:
[legend]
Collaboration diagram for NeonTensorHandleDecorator:
[legend]

Public Member Functions

 NeonTensorHandleDecorator (IAclTensorHandle *parent, const TensorInfo &info)
 
arm_compute::ITensor & GetTensor () override
 
arm_compute::ITensor const & GetTensor () const override
 
virtual void Allocate () override
 Indicate to the memory manager that this resource is no longer active. More...
 
virtual void Manage () override
 Indicate to the memory manager that this resource is active. More...
 
virtual ITensorHandleGetParent () const override
 Get the parent tensor if this is a subtensor. More...
 
virtual arm_compute::DataType GetDataType () const override
 
virtual void SetMemoryGroup (const std::shared_ptr< arm_compute::IMemoryGroup > &) override
 
virtual const void * Map (bool) const override
 Map the tensor data for access. More...
 
virtual void Unmap () const override
 Unmap the tensor data. More...
 
TensorShape GetStrides () const override
 Get the strides for each dimension ordered from largest to smallest where the smallest value is the same as the size of a single element in the tensor. More...
 
TensorShape GetShape () const override
 Get the number of elements for each dimension ordered from slowest iterating dimension to fastest iterating dimension. More...
 
virtual std::shared_ptr< ITensorHandleDecorateTensorHandle (const TensorInfo &) override
 Returns a decorated version of this TensorHandle allowing us to override the TensorInfo for it. More...
 
- Public Member Functions inherited from ITensorHandle
virtual ~ITensorHandle ()
 
void * Map (bool blocking=true)
 Map the tensor data for access. More...
 
void Unmap ()
 Unmap the tensor data that was previously mapped with call to Map(). More...
 
virtual unsigned int GetImportFlags () const
 Get flags describing supported import sources. More...
 
virtual bool Import (void *memory, MemorySource source)
 Import externally allocated memory. More...
 
virtual bool CanBeImported (void *memory, MemorySource source)
 Implementations must determine if this memory block can be imported. More...
 
virtual void Unimport ()
 Unimport externally allocated memory. More...
 

Detailed Description

Definition at line 438 of file NeonTensorHandle.hpp.

Constructor & Destructor Documentation

◆ NeonTensorHandleDecorator()

NeonTensorHandleDecorator ( IAclTensorHandle parent,
const TensorInfo info 
)
inline

Definition at line 441 of file NeonTensorHandle.hpp.

442  : m_Tensor(&parent->GetTensor(), info)
443  {
444  parentHandle = parent;
445  }

References armnn::info.

Member Function Documentation

◆ Allocate()

virtual void Allocate ( )
inlineoverridevirtual

Indicate to the memory manager that this resource is no longer active.

This is used to compute overlapping lifetimes of resources.

Implements ITensorHandle.

Definition at line 450 of file NeonTensorHandle.hpp.

450 {}

◆ DecorateTensorHandle()

virtual std::shared_ptr<ITensorHandle> DecorateTensorHandle ( const TensorInfo tensorInfo)
inlineoverridevirtual

Returns a decorated version of this TensorHandle allowing us to override the TensorInfo for it.

Parameters
tensorInfothe overidden TensorInfo.

Reimplemented from ITensorHandle.

Definition at line 478 of file NeonTensorHandle.hpp.

479  {
480  return nullptr;
481  };

◆ GetDataType()

virtual arm_compute::DataType GetDataType ( ) const
inlineoverridevirtual

Implements IAclTensorHandle.

Definition at line 455 of file NeonTensorHandle.hpp.

456  {
457  return m_Tensor.info()->data_type();
458  }

References NeonTensorDecorator::info().

◆ GetParent()

virtual ITensorHandle* GetParent ( ) const
inlineoverridevirtual

Get the parent tensor if this is a subtensor.

Returns
a pointer to the parent tensor. Otherwise nullptr if not a subtensor.

Implements ITensorHandle.

Definition at line 453 of file NeonTensorHandle.hpp.

453 { return nullptr; }

◆ GetShape()

TensorShape GetShape ( ) const
inlineoverridevirtual

Get the number of elements for each dimension ordered from slowest iterating dimension to fastest iterating dimension.

Returns
a TensorShape filled with the number of elements for each dimension.

Implements ITensorHandle.

Definition at line 473 of file NeonTensorHandle.hpp.

474  {
475  return armcomputetensorutils::GetShape(m_Tensor.info()->tensor_shape());
476  }

◆ GetStrides()

TensorShape GetStrides ( ) const
inlineoverridevirtual

Get the strides for each dimension ordered from largest to smallest where the smallest value is the same as the size of a single element in the tensor.

Returns
a TensorShape filled with the strides for each dimension

Implements ITensorHandle.

Definition at line 468 of file NeonTensorHandle.hpp.

469  {
470  return armcomputetensorutils::GetStrides(m_Tensor.info()->strides_in_bytes());
471  }

◆ GetTensor() [1/2]

arm_compute::ITensor const& GetTensor ( ) const
inlineoverridevirtual

Implements IAclTensorHandle.

Definition at line 448 of file NeonTensorHandle.hpp.

448 { return m_Tensor; }

◆ GetTensor() [2/2]

arm_compute::ITensor& GetTensor ( )
inlineoverridevirtual

Implements IAclTensorHandle.

Definition at line 447 of file NeonTensorHandle.hpp.

447 { return m_Tensor; }

◆ Manage()

virtual void Manage ( )
inlineoverridevirtual

Indicate to the memory manager that this resource is active.

This is used to compute overlapping lifetimes of resources.

Implements ITensorHandle.

Definition at line 451 of file NeonTensorHandle.hpp.

451 {}

◆ Map()

virtual const void* Map ( bool  blocking) const
inlineoverridevirtual

Map the tensor data for access.

Parameters
blockinghint to block the calling thread until all other accesses are complete. (backend dependent)
Returns
pointer to the first element of the mapped data.

Implements ITensorHandle.

Definition at line 462 of file NeonTensorHandle.hpp.

463  {
464  return static_cast<const void*>(m_Tensor.buffer() + m_Tensor.info()->offset_first_element_in_bytes());
465  }

References NeonTensorDecorator::buffer(), and NeonTensorDecorator::info().

◆ SetMemoryGroup()

virtual void SetMemoryGroup ( const std::shared_ptr< arm_compute::IMemoryGroup > &  )
inlineoverridevirtual

Implements IAclTensorHandle.

Definition at line 460 of file NeonTensorHandle.hpp.

460 {}

◆ Unmap()

virtual void Unmap ( ) const
inlineoverridevirtual

Unmap the tensor data.

Implements ITensorHandle.

Definition at line 466 of file NeonTensorHandle.hpp.

466 {}

The documentation for this class was generated from the following file:
armnn::NeonTensorDecorator::buffer
uint8_t * buffer() const override
Definition: NeonTensorHandle.cpp:42
armnn::NeonTensorDecorator::info
arm_compute::ITensorInfo * info() const override
Definition: NeonTensorHandle.cpp:32