ONE - On-device Neural Engine
Loading...
Searching...
No Matches
onert::backend::acl_common::AclLinearMemoryManager< T_ITensor, T_Tensor, T_SubTensor, T_MemoryManager, T_PoolManager, T_LifetimeManager, T_Allocator, T_MemoryGroup > Class Template Reference

#include <AclLinearMemoryManager.h>

Collaboration diagram for onert::backend::acl_common::AclLinearMemoryManager< T_ITensor, T_Tensor, T_SubTensor, T_MemoryManager, T_PoolManager, T_LifetimeManager, T_Allocator, T_MemoryGroup >:

Public Member Functions

 AclLinearMemoryManager ()
 
virtual ~AclLinearMemoryManager ()=default
 
void allocate (void) override
 
void deallocate (void) override
 
void startLifetime (const ir::OperandIndex &ind) override
 
void finishLifetime (const ir::OperandIndex &ind) override
 
- Public Member Functions inherited from onert::backend::acl_common::AclMemoryManager< T_ITensor, T_Tensor, T_SubTensor >
 AclMemoryManager ()
 
virtual ~AclMemoryManager ()=default
 
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, typename T_MemoryManager, typename T_PoolManager, typename T_LifetimeManager, typename T_Allocator, typename T_MemoryGroup>
class onert::backend::acl_common::AclLinearMemoryManager< T_ITensor, T_Tensor, T_SubTensor, T_MemoryManager, T_PoolManager, T_LifetimeManager, T_Allocator, T_MemoryGroup >

Definition at line 47 of file AclLinearMemoryManager.h.

Constructor & Destructor Documentation

◆ AclLinearMemoryManager()

template<typename T_ITensor , typename T_Tensor , typename T_SubTensor , typename T_MemoryManager , typename T_PoolManager , typename T_LifetimeManager , typename T_Allocator , typename T_MemoryGroup >
onert::backend::acl_common::AclLinearMemoryManager< T_ITensor, T_Tensor, T_SubTensor, T_MemoryManager, T_PoolManager, T_LifetimeManager, T_Allocator, T_MemoryGroup >::AclLinearMemoryManager ( )
inline

Definition at line 50 of file AclLinearMemoryManager.h.

51 : _allocator{nullptr},
52 _io_manager{createMemoryManager<T_MemoryManager, T_PoolManager, T_LifetimeManager>()},
53 _io_group{std::make_shared<T_MemoryGroup>(_io_manager)}
54 {
55 // DO NOTHING
56 }

◆ ~AclLinearMemoryManager()

template<typename T_ITensor , typename T_Tensor , typename T_SubTensor , typename T_MemoryManager , typename T_PoolManager , typename T_LifetimeManager , typename T_Allocator , typename T_MemoryGroup >
virtual onert::backend::acl_common::AclLinearMemoryManager< T_ITensor, T_Tensor, T_SubTensor, T_MemoryManager, T_PoolManager, T_LifetimeManager, T_Allocator, T_MemoryGroup >::~AclLinearMemoryManager ( )
virtualdefault

Member Function Documentation

◆ allocate()

template<typename T_ITensor , typename T_Tensor , typename T_SubTensor , typename T_MemoryManager , typename T_PoolManager , typename T_LifetimeManager , typename T_Allocator , typename T_MemoryGroup >
void onert::backend::acl_common::AclLinearMemoryManager< T_ITensor, T_Tensor, T_SubTensor, T_MemoryManager, T_PoolManager, T_LifetimeManager, T_Allocator, T_MemoryGroup >::allocate ( void  )
inlineoverridevirtual

Reimplemented from onert::backend::acl_common::AclMemoryManager< T_ITensor, T_Tensor, T_SubTensor >.

Definition at line 60 of file AclLinearMemoryManager.h.

61 {
62 _allocator = std::make_shared<T_Allocator>();
63 _io_manager->populate(*_allocator, 1);
64 _io_group->acquire();
65 }

◆ deallocate()

template<typename T_ITensor , typename T_Tensor , typename T_SubTensor , typename T_MemoryManager , typename T_PoolManager , typename T_LifetimeManager , typename T_Allocator , typename T_MemoryGroup >
void onert::backend::acl_common::AclLinearMemoryManager< T_ITensor, T_Tensor, T_SubTensor, T_MemoryManager, T_PoolManager, T_LifetimeManager, T_Allocator, T_MemoryGroup >::deallocate ( void  )
inlineoverridevirtual

Reimplemented from onert::backend::acl_common::AclMemoryManager< T_ITensor, T_Tensor, T_SubTensor >.

Definition at line 67 of file AclLinearMemoryManager.h.

68 {
69 _io_group->release();
70 _io_manager->clear();
71 }

◆ finishLifetime()

template<typename T_ITensor , typename T_Tensor , typename T_SubTensor , typename T_MemoryManager , typename T_PoolManager , typename T_LifetimeManager , typename T_Allocator , typename T_MemoryGroup >
void onert::backend::acl_common::AclLinearMemoryManager< T_ITensor, T_Tensor, T_SubTensor, T_MemoryManager, T_PoolManager, T_LifetimeManager, T_Allocator, T_MemoryGroup >::finishLifetime ( const ir::OperandIndex ind)
inlineoverridevirtual

Reimplemented from onert::backend::acl_common::AclMemoryManager< T_ITensor, T_Tensor, T_SubTensor >.

Definition at line 84 of file AclLinearMemoryManager.h.

85 {
86 auto &tensors = this->tensors();
87 assert(tensors.find(ind) != tensors.end());
88
89 auto tensor = tensors[ind];
90 assert(tensor->allocator());
91
92 tensor->allocator()->allocate();
93 }
ir::OperandIndexMap< std::shared_ptr< T_Tensor > > & tensors(void)

References onert::backend::acl_common::AclMemoryManager< T_ITensor, T_Tensor, T_SubTensor >::tensors().

◆ startLifetime()

template<typename T_ITensor , typename T_Tensor , typename T_SubTensor , typename T_MemoryManager , typename T_PoolManager , typename T_LifetimeManager , typename T_Allocator , typename T_MemoryGroup >
void onert::backend::acl_common::AclLinearMemoryManager< T_ITensor, T_Tensor, T_SubTensor, T_MemoryManager, T_PoolManager, T_LifetimeManager, T_Allocator, T_MemoryGroup >::startLifetime ( const ir::OperandIndex ind)
inlineoverridevirtual

Reimplemented from onert::backend::acl_common::AclMemoryManager< T_ITensor, T_Tensor, T_SubTensor >.

Definition at line 73 of file AclLinearMemoryManager.h.

74 {
75 auto &tensors = this->tensors();
76 assert(tensors.find(ind) != tensors.end());
77
78 auto tensor = tensors[ind];
79 assert(tensor->handle());
80
81 _io_group->manage(tensor->handle());
82 }

References onert::backend::acl_common::AclMemoryManager< T_ITensor, T_Tensor, T_SubTensor >::tensors().


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