ArmNN
 24.02
GpuFsaMemoryManager::Pool Class Reference

#include <GpuFsaMemoryManager.hpp>

Public Member Functions

 Pool (unsigned int numBytes)
 
 ~Pool ()
 
void Acquire ()
 
void Release ()
 
void * GetPointer ()
 
void Reserve (unsigned int numBytes)
 

Detailed Description

Definition at line 33 of file GpuFsaMemoryManager.hpp.

Constructor & Destructor Documentation

◆ Pool()

Pool ( unsigned int  numBytes)

Definition at line 66 of file GpuFsaMemoryManager.cpp.

67  : m_Size(numBytes),
68  m_Pointer(nullptr)
69 {}

◆ ~Pool()

~Pool ( )

Definition at line 71 of file GpuFsaMemoryManager.cpp.

72 {
73  if (m_Pointer)
74  {
75  Release();
76  }
77 }

References GpuFsaMemoryManager::Release().

Member Function Documentation

◆ Acquire()

void Acquire ( )

Definition at line 99 of file GpuFsaMemoryManager.cpp.

100 {
101  if (m_Pointer != nullptr)
102  {
104  "GpuFsaMemoryManager::Pool::Acquire() called when memory already acquired");
105  }
106  m_Pointer = ::operator new(size_t(m_Size));
107 }

◆ GetPointer()

void * GetPointer ( )

Definition at line 79 of file GpuFsaMemoryManager.cpp.

80 {
81  if (m_Pointer == nullptr)
82  {
84  "GpuFsaMemoryManager::Pool::GetPointer() called when memory not acquired");
85  }
86  return m_Pointer;
87 }

Referenced by GpuFsaMemoryManager::GetPointer().

◆ Release()

void Release ( )

Definition at line 109 of file GpuFsaMemoryManager.cpp.

110 {
111  if (m_Pointer == nullptr)
112  {
114  "GpuFsaMemoryManager::Pool::Release() called when memory not acquired");
115  }
116  ::operator delete(m_Pointer);
117  m_Pointer = nullptr;
118 }

◆ Reserve()

void Reserve ( unsigned int  numBytes)

Definition at line 89 of file GpuFsaMemoryManager.cpp.

90 {
91  if (m_Pointer != nullptr)
92  {
94  "GpuFsaMemoryManager::Pool::Reserve() cannot be called after memory acquired");
95  }
96  m_Size = std::max(m_Size, numBytes);
97 }

Referenced by GpuFsaMemoryManager::Manage().


The documentation for this class was generated from the following files:
armnn::GpuFsaMemoryManager::Pool::Release
void Release()
Definition: GpuFsaMemoryManager.cpp:109
armnn::MemoryValidationException
Definition: Exceptions.hpp:158