ONNX Runtime
Loading...
Searching...
No Matches
Ort::MemoryAllocation Struct Reference

Represents native memory allocation coming from one of the OrtAllocators registered with OnnxRuntime. Use it to wrap an allocation made by an allocator so it can be automatically released when no longer needed. More...

#include <onnxruntime_cxx_api.h>

Public Member Functions

 MemoryAllocation (OrtAllocator *allocator, void *p, size_t size)
 
 ~MemoryAllocation ()
 
 MemoryAllocation (const MemoryAllocation &)=delete
 
MemoryAllocationoperator= (const MemoryAllocation &)=delete
 
 MemoryAllocation (MemoryAllocation &&) noexcept
 
MemoryAllocationoperator= (MemoryAllocation &&) noexcept
 
void * get ()
 
size_t size () const
 

Detailed Description

Represents native memory allocation coming from one of the OrtAllocators registered with OnnxRuntime. Use it to wrap an allocation made by an allocator so it can be automatically released when no longer needed.

Constructor & Destructor Documentation

◆ MemoryAllocation() [1/3]

Ort::MemoryAllocation::MemoryAllocation ( OrtAllocator allocator,
void *  p,
size_t  size 
)

◆ ~MemoryAllocation()

Ort::MemoryAllocation::~MemoryAllocation ( )

◆ MemoryAllocation() [2/3]

Ort::MemoryAllocation::MemoryAllocation ( const MemoryAllocation )
delete

◆ MemoryAllocation() [3/3]

Ort::MemoryAllocation::MemoryAllocation ( MemoryAllocation &&  )
noexcept

Member Function Documentation

◆ get()

void * Ort::MemoryAllocation::get ( )
inline

◆ operator=() [1/2]

MemoryAllocation & Ort::MemoryAllocation::operator= ( const MemoryAllocation )
delete

◆ operator=() [2/2]

MemoryAllocation & Ort::MemoryAllocation::operator= ( MemoryAllocation &&  )
noexcept

◆ size()

size_t Ort::MemoryAllocation::size ( ) const
inline