ONE - On-device Neural Engine
Loading...
Searching...
No Matches
PrivateMemory Class Referencefinal

#include <Memory.h>

Collaboration diagram for PrivateMemory:

Public Member Functions

 PrivateMemory ()=default
 
 ~PrivateMemory ()
 
 PrivateMemory (const PrivateMemory &)=delete
 
PrivateMemoryoperator= (const PrivateMemory &)=delete
 
virtual int create (uint32_t size)
 
virtual int getPointer (uint8_t **buffer) const
 
virtual bool validateSize (uint32_t offset, uint32_t length) const
 
- Public Member Functions inherited from AllocatedMemory
 AllocatedMemory ()=default
 
virtual ~AllocatedMemory ()=default
 
- Public Member Functions inherited from Memory
 Memory ()=default
 
virtual ~Memory ()=default
 
 Memory (const Memory &)=delete
 
Memoryoperator= (const Memory &)=delete
 

Detailed Description

Definition at line 80 of file Memory.h.

Constructor & Destructor Documentation

◆ PrivateMemory() [1/2]

PrivateMemory::PrivateMemory ( )
default

◆ ~PrivateMemory()

PrivateMemory::~PrivateMemory ( )

Definition at line 77 of file Memory.cpp.

78{
79 if (_base)
80 {
81 delete[] _base;
82 }
83}

◆ PrivateMemory() [2/2]

PrivateMemory::PrivateMemory ( const PrivateMemory )
delete

Member Function Documentation

◆ create()

int PrivateMemory::create ( uint32_t  size)
virtual

Implements AllocatedMemory.

Definition at line 85 of file Memory.cpp.

86{
87 auto base = new uint8_t[size];
88
89 // TODO Check allocation failure
90 _base = base;
91 _size = size;
92
94}
@ ANEURALNETWORKS_NO_ERROR
int32_t size[5]
Definition Slice.cpp:35

References ANEURALNETWORKS_NO_ERROR, and size.

◆ getPointer()

int PrivateMemory::getPointer ( uint8_t **  buffer) const
virtual

Implements AllocatedMemory.

Definition at line 96 of file Memory.cpp.

97{
98 *buffer = _base;
100}

References ANEURALNETWORKS_NO_ERROR.

◆ operator=()

PrivateMemory & PrivateMemory::operator= ( const PrivateMemory )
delete

◆ validateSize()

bool PrivateMemory::validateSize ( uint32_t  offset,
uint32_t  length 
) const
virtual

Implements AllocatedMemory.

Definition at line 102 of file Memory.cpp.

103{
104 return true;
105}

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