ArmNN
 24.08
GpuFsaMemoryManager Class Reference

#include <GpuFsaMemoryManager.hpp>

Inheritance diagram for GpuFsaMemoryManager:
[legend]
Collaboration diagram for GpuFsaMemoryManager:
[legend]

Classes

class  Pool
 

Public Member Functions

 GpuFsaMemoryManager ()
 
virtual ~GpuFsaMemoryManager ()
 
PoolManage (unsigned int numBytes)
 
void Allocate (Pool *pool)
 
void * GetPointer (Pool *pool)
 
void Acquire () override
 
void Release () override
 
- Public Member Functions inherited from IMemoryManager
virtual ~IMemoryManager ()
 

Additional Inherited Members

- Protected Member Functions inherited from IMemoryManager
 IMemoryManager ()
 

Detailed Description

Definition at line 16 of file GpuFsaMemoryManager.hpp.

Constructor & Destructor Documentation

◆ GpuFsaMemoryManager()

Definition at line 13 of file GpuFsaMemoryManager.cpp.

14 {}

◆ ~GpuFsaMemoryManager()

~GpuFsaMemoryManager ( )
virtual

Definition at line 16 of file GpuFsaMemoryManager.cpp.

17 {}

Member Function Documentation

◆ Acquire()

void Acquire ( )
overridevirtual

Implements IMemoryManager.

Definition at line 50 of file GpuFsaMemoryManager.cpp.

51 {
52  for (Pool &pool: m_Pools)
53  {
54  pool.Acquire();
55  }
56 }

◆ Allocate()

void Allocate ( GpuFsaMemoryManager::Pool pool)

Definition at line 35 of file GpuFsaMemoryManager.cpp.

36 {
37  if (pool == nullptr)
38  {
40  "GpuFsaMemoryManager: Allocate: Attempting to allocate a null memory pool ptr");
41  }
42  m_FreePools.push_back(pool);
43 }

◆ GetPointer()

void * GetPointer ( GpuFsaMemoryManager::Pool pool)

Definition at line 45 of file GpuFsaMemoryManager.cpp.

46 {
47  return pool->GetPointer();
48 }

References GpuFsaMemoryManager::Pool::GetPointer().

◆ Manage()

GpuFsaMemoryManager::Pool * Manage ( unsigned int  numBytes)

Definition at line 19 of file GpuFsaMemoryManager.cpp.

20 {
21  if (!m_FreePools.empty())
22  {
23  Pool* res = m_FreePools.back();
24  m_FreePools.pop_back();
25  res->Reserve(numBytes);
26  return res;
27  }
28  else
29  {
30  m_Pools.push_front(Pool(numBytes));
31  return &m_Pools.front();
32  }
33 }

References GpuFsaMemoryManager::Pool::Reserve().

◆ Release()

void Release ( )
overridevirtual

Implements IMemoryManager.

Definition at line 58 of file GpuFsaMemoryManager.cpp.

59 {
60  for (Pool &pool: m_Pools)
61  {
62  pool.Release();
63  }
64 }

Referenced by GpuFsaMemoryManager::Pool::~Pool().


The documentation for this class was generated from the following files:
armnn::MemoryValidationException
Definition: Exceptions.hpp:158