ArmNN
 21.08
ClImportSubTensorHandle Class Reference

#include <ClImportTensorHandle.hpp>

Inheritance diagram for ClImportSubTensorHandle:
IClImportTensorHandle IAclTensorHandle ITensorHandle

Public Member Functions

 ClImportSubTensorHandle (IClImportTensorHandle *parent, const arm_compute::TensorShape &shape, const arm_compute::Coordinates &coords)
 
arm_compute::CLSubTensor & GetTensor () override
 
arm_compute::CLSubTensor 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 const void * Map (bool blocking=true) const override
 Map the tensor data for access. More...
 
virtual void Unmap () const override
 Unmap the tensor data. 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 > &memoryGroup) override
 
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...
 
- 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...
 

Detailed Description

Definition at line 281 of file ClImportTensorHandle.hpp.

Constructor & Destructor Documentation

◆ ClImportSubTensorHandle()

ClImportSubTensorHandle ( IClImportTensorHandle parent,
const arm_compute::TensorShape &  shape,
const arm_compute::Coordinates &  coords 
)
inline

Definition at line 284 of file ClImportTensorHandle.hpp.

287  : m_Tensor(&parent->GetTensor(), shape, coords)
288  {
289  parentHandle = parent;
290  }

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 295 of file ClImportTensorHandle.hpp.

295 {}

◆ GetDataType()

virtual arm_compute::DataType GetDataType ( ) const
inlineoverridevirtual

Implements IClImportTensorHandle.

Definition at line 307 of file ClImportTensorHandle.hpp.

308  {
309  return m_Tensor.info()->data_type();
310  }

◆ 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 305 of file ClImportTensorHandle.hpp.

305 { return parentHandle; }

◆ 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 322 of file ClImportTensorHandle.hpp.

323  {
324  return armcomputetensorutils::GetShape(m_Tensor.info()->tensor_shape());
325  }

◆ 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 317 of file ClImportTensorHandle.hpp.

318  {
319  return armcomputetensorutils::GetStrides(m_Tensor.info()->strides_in_bytes());
320  }

◆ GetTensor() [1/2]

arm_compute::CLSubTensor& GetTensor ( )
inlineoverridevirtual

Implements IClImportTensorHandle.

Definition at line 292 of file ClImportTensorHandle.hpp.

292 { return m_Tensor; }

◆ GetTensor() [2/2]

arm_compute::CLSubTensor const& GetTensor ( ) const
inlineoverridevirtual

Implements IClImportTensorHandle.

Definition at line 293 of file ClImportTensorHandle.hpp.

293 { 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 296 of file ClImportTensorHandle.hpp.

296 {}

◆ Map()

virtual const void* Map ( bool  blocking = true) 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 298 of file ClImportTensorHandle.hpp.

References armnn::IgnoreUnused().

299  {
300  IgnoreUnused(blocking);
301  return static_cast<const void*>(m_Tensor.buffer() + m_Tensor.info()->offset_first_element_in_bytes());
302  }
void IgnoreUnused(Ts &&...)

◆ SetMemoryGroup()

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

Implements IClImportTensorHandle.

Definition at line 312 of file ClImportTensorHandle.hpp.

References armnn::IgnoreUnused().

313  {
314  IgnoreUnused(memoryGroup);
315  }
void IgnoreUnused(Ts &&...)

◆ Unmap()

virtual void Unmap ( ) const
inlineoverridevirtual

Unmap the tensor data.

Implements ITensorHandle.

Definition at line 303 of file ClImportTensorHandle.hpp.

303 {}

The documentation for this class was generated from the following file: