ONE - On-device Neural Engine
Loading...
Searching...
No Matches
onert::backend::acl_common::AclMemoryManager< T_ITensor, T_Tensor, T_SubTensor > Class Template Reference

#include <AclMemoryManager.h>

Public Member Functions

 AclMemoryManager ()
 
virtual ~AclMemoryManager ()=default
 
virtual void allocate (void)
 
virtual void deallocate (void)
 
virtual void startLifetime (const ir::OperandIndex &)
 
virtual void finishLifetime (const ir::OperandIndex &)
 
void buildTensor (const ir::OperandIndex &ind, const ::arm_compute::TensorInfo &info, size_t rank, size_t num_uses)
 
void buildSubtensor (std::shared_ptr< T_ITensor > parent_tensor, const ir::OperandIndex &child_ind, const ::arm_compute::TensorShape &shape, const ::arm_compute::Coordinates &coordinates, size_t rank, bool extent_parent)
 
ir::OperandIndexMap< std::shared_ptr< T_Tensor > > & tensors (void)
 
ir::OperandIndexMap< std::shared_ptr< T_SubTensor > > & subtensors (void)
 

Detailed Description

template<typename T_ITensor, typename T_Tensor, typename T_SubTensor>
class onert::backend::acl_common::AclMemoryManager< T_ITensor, T_Tensor, T_SubTensor >

Definition at line 35 of file AclMemoryManager.h.

Constructor & Destructor Documentation

◆ AclMemoryManager()

template<typename T_ITensor , typename T_Tensor , typename T_SubTensor >
onert::backend::acl_common::AclMemoryManager< T_ITensor, T_Tensor, T_SubTensor >::AclMemoryManager ( )
inline

Definition at line 38 of file AclMemoryManager.h.

39 {
40 // DO NOTHING
41 }

◆ ~AclMemoryManager()

template<typename T_ITensor , typename T_Tensor , typename T_SubTensor >
virtual onert::backend::acl_common::AclMemoryManager< T_ITensor, T_Tensor, T_SubTensor >::~AclMemoryManager ( )
virtualdefault

Member Function Documentation

◆ allocate()

template<typename T_ITensor , typename T_Tensor , typename T_SubTensor >
virtual void onert::backend::acl_common::AclMemoryManager< T_ITensor, T_Tensor, T_SubTensor >::allocate ( void  )
inlinevirtual

Reimplemented in onert::backend::acl_common::AclLinearMemoryManager< T_ITensor, T_Tensor, T_SubTensor, T_MemoryManager, T_PoolManager, T_LifetimeManager, T_Allocator, T_MemoryGroup >.

Definition at line 45 of file AclMemoryManager.h.

46 {
47 for (const auto &tensor_entry : _tensors)
48 {
49 auto tensor = tensor_entry.second;
50 tensor->allocator()->allocate();
51 }
52 }

◆ buildSubtensor()

template<typename T_ITensor , typename T_Tensor , typename T_SubTensor >
void onert::backend::acl_common::AclMemoryManager< T_ITensor, T_Tensor, T_SubTensor >::buildSubtensor ( std::shared_ptr< T_ITensor >  parent_tensor,
const ir::OperandIndex child_ind,
const ::arm_compute::TensorShape &  shape,
const ::arm_compute::Coordinates &  coordinates,
size_t  rank,
bool  extent_parent 
)
inline

Definition at line 77 of file AclMemoryManager.h.

81 {
82 auto subtensor =
83 std::make_shared<T_SubTensor>(parent_tensor.get(), shape, coordinates, rank, extent_parent);
84 _subtensors[child_ind] = subtensor;
85 }

◆ buildTensor()

template<typename T_ITensor , typename T_Tensor , typename T_SubTensor >
void onert::backend::acl_common::AclMemoryManager< T_ITensor, T_Tensor, T_SubTensor >::buildTensor ( const ir::OperandIndex ind,
const ::arm_compute::TensorInfo &  info,
size_t  rank,
size_t  num_uses 
)
inline

Definition at line 70 of file AclMemoryManager.h.

72 {
73 auto tensor = std::make_shared<T_Tensor>(info, rank, num_uses);
74 _tensors[ind] = tensor;
75 }
volatile const char info[]

References info.

◆ deallocate()

template<typename T_ITensor , typename T_Tensor , typename T_SubTensor >
virtual void onert::backend::acl_common::AclMemoryManager< T_ITensor, T_Tensor, T_SubTensor >::deallocate ( void  )
inlinevirtual

Reimplemented in onert::backend::acl_common::AclLinearMemoryManager< T_ITensor, T_Tensor, T_SubTensor, T_MemoryManager, T_PoolManager, T_LifetimeManager, T_Allocator, T_MemoryGroup >.

Definition at line 54 of file AclMemoryManager.h.

55 {
56 for (const auto &tensor_entry : _tensors)
57 {
58 auto tensor = tensor_entry.second;
59 tensor->allocator()->free();
60 }
61 }

◆ finishLifetime()

template<typename T_ITensor , typename T_Tensor , typename T_SubTensor >
virtual void onert::backend::acl_common::AclMemoryManager< T_ITensor, T_Tensor, T_SubTensor >::finishLifetime ( const ir::OperandIndex )
inlinevirtual

◆ startLifetime()

template<typename T_ITensor , typename T_Tensor , typename T_SubTensor >
virtual void onert::backend::acl_common::AclMemoryManager< T_ITensor, T_Tensor, T_SubTensor >::startLifetime ( const ir::OperandIndex )
inlinevirtual

◆ subtensors()

template<typename T_ITensor , typename T_Tensor , typename T_SubTensor >
ir::OperandIndexMap< std::shared_ptr< T_SubTensor > > & onert::backend::acl_common::AclMemoryManager< T_ITensor, T_Tensor, T_SubTensor >::subtensors ( void  )
inline

Definition at line 89 of file AclMemoryManager.h.

89{ return _subtensors; }

◆ tensors()


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