ONE - On-device Neural Engine
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 31 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 34 of file AclMemoryManager.h.

35 {
36 // DO NOTHING
37 }

◆ ~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 41 of file AclMemoryManager.h.

42 {
43 for (const auto &tensor_entry : _tensors)
44 {
45 auto tensor = tensor_entry.second;
46 tensor->allocator()->allocate();
47 }
48 }

◆ 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 73 of file AclMemoryManager.h.

77 {
78 auto subtensor =
79 std::make_shared<T_SubTensor>(parent_tensor.get(), shape, coordinates, rank, extent_parent);
80 _subtensors[child_ind] = subtensor;
81 }

◆ 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 66 of file AclMemoryManager.h.

68 {
69 auto tensor = std::make_shared<T_Tensor>(info, rank, num_uses);
70 _tensors[ind] = tensor;
71 }
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 50 of file AclMemoryManager.h.

51 {
52 for (const auto &tensor_entry : _tensors)
53 {
54 auto tensor = tensor_entry.second;
55 tensor->allocator()->free();
56 }
57 }

◆ 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 85 of file AclMemoryManager.h.

85{ return _subtensors; }

◆ tensors()


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