Compute Library
 19.08
BlobLifetimeManager Class Reference

Concrete class that tracks the lifetime of registered tensors and calculates the systems memory requirements in terms of blobs. More...

#include <BlobLifetimeManager.h>

Collaboration diagram for BlobLifetimeManager:
[legend]

Public Member Functions

 BlobLifetimeManager ()
 Constructor. More...
 
 BlobLifetimeManager (const BlobLifetimeManager &)=delete
 Prevent instances of this class to be copy constructed. More...
 
BlobLifetimeManageroperator= (const BlobLifetimeManager &)=delete
 Prevent instances of this class to be copied. More...
 
 BlobLifetimeManager (BlobLifetimeManager &&)=default
 Allow instances of this class to be move constructed. More...
 
BlobLifetimeManageroperator= (BlobLifetimeManager &&)=default
 Allow instances of this class to be moved. More...
 
std::unique_ptr< IMemoryPoolcreate_pool (IAllocator *allocator) override
 Creates a memory pool depending on the memory requirements. More...
 
MappingType mapping_type () const override
 Returns the type of mappings that the lifetime manager returns. More...
 
- Public Member Functions inherited from ISimpleLifetimeManager
 ISimpleLifetimeManager ()
 Constructor. More...
 
 ISimpleLifetimeManager (const ISimpleLifetimeManager &)=delete
 Prevent instances of this class to be copy constructed. More...
 
ISimpleLifetimeManageroperator= (const ISimpleLifetimeManager &)=delete
 Prevent instances of this class to be copied. More...
 
 ISimpleLifetimeManager (ISimpleLifetimeManager &&)=default
 Allow instances of this class to be move constructed. More...
 
ISimpleLifetimeManageroperator= (ISimpleLifetimeManager &&)=default
 Allow instances of this class to be moved. More...
 
void register_group (IMemoryGroup *group) override
 Registers a group to the lifetime manager and assigns a group id. More...
 
void start_lifetime (void *obj) override
 Registers and starts lifetime of an object. More...
 
void end_lifetime (void *obj, IMemory &obj_memory, size_t size, size_t alignment) override
 Ends lifetime of an object. More...
 
bool are_all_finalized () const override
 Checks if the lifetime of the registered object is complete. More...
 
- Public Member Functions inherited from ILifetimeManager
virtual ~ILifetimeManager ()=default
 Virtual Destructor. More...
 

Detailed Description

Concrete class that tracks the lifetime of registered tensors and calculates the systems memory requirements in terms of blobs.

Definition at line 41 of file BlobLifetimeManager.h.

Constructor & Destructor Documentation

◆ BlobLifetimeManager() [1/3]

Constructor.

Definition at line 38 of file BlobLifetimeManager.cpp.

39  : _blobs()
40 {
41 }

◆ BlobLifetimeManager() [2/3]

Prevent instances of this class to be copy constructed.

◆ BlobLifetimeManager() [3/3]

Allow instances of this class to be move constructed.

Member Function Documentation

◆ create_pool()

std::unique_ptr< IMemoryPool > create_pool ( IAllocator allocator)
overridevirtual

Creates a memory pool depending on the memory requirements.

Parameters
allocatorAllocator to use
Returns
A memory pool

Implements ILifetimeManager.

Definition at line 43 of file BlobLifetimeManager.cpp.

44 {
45  ARM_COMPUTE_ERROR_ON(allocator == nullptr);
46  return support::cpp14::make_unique<BlobMemoryPool>(allocator, _blobs);
47 }
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Definition: Error.h:337
src_target allocator() -> allocate()

References arm_compute::test::validation::allocator(), and ARM_COMPUTE_ERROR_ON.

◆ mapping_type()

MappingType mapping_type ( ) const
overridevirtual

Returns the type of mappings that the lifetime manager returns.

Returns
Mapping type of the lifetime manager

Implements ILifetimeManager.

Definition at line 49 of file BlobLifetimeManager.cpp.

50 {
51  return MappingType::BLOBS;
52 }
Mappings are in blob granularity.

References arm_compute::BLOBS.

◆ operator=() [1/2]

BlobLifetimeManager& operator= ( const BlobLifetimeManager )
delete

Prevent instances of this class to be copied.

◆ operator=() [2/2]

BlobLifetimeManager& operator= ( BlobLifetimeManager &&  )
default

Allow instances of this class to be moved.


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