HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
onnxruntime::CPUAllocator Class Reference

#include <allocator.h>

+ Inheritance diagram for onnxruntime::CPUAllocator:

Public Member Functions

 CPUAllocator (const OrtMemoryInfo &memory_info)
 
 CPUAllocator ()
 
voidAlloc (size_t size) override
 
void Free (void *p) override
 
- Public Member Functions inherited from onnxruntime::IAllocator
 IAllocator (const OrtMemoryInfo &info)
 
virtual ~IAllocator ()=default
 
virtual voidReserve (size_t size)
 
const OrtMemoryInfoInfo () const
 
virtual void GetStats (AllocatorStats *)
 
voidAllocArray (size_t nmemb, size_t size)
 
template<size_t alignment>
voidAllocArrayWithAlignment (size_t nmemb, size_t size)
 

Additional Inherited Members

- Static Public Member Functions inherited from onnxruntime::IAllocator
static bool CalcMemSizeForArray (size_t nmemb, size_t size, size_t *out) noexcept
 
static bool CalcMemSizeForArrayWithAlignment (size_t nmemb, size_t size, size_t alignment, size_t *out) noexcept
 
template<size_t alignment>
static bool CalcMemSizeForArrayWithAlignment (size_t nmemb, size_t size, size_t *out) noexcept
 
template<typename T >
static IAllocatorUniquePtr< T > MakeUniquePtr (std::shared_ptr< IAllocator > allocator, size_t count_or_bytes, bool use_reserve=false, Stream *stream=nullptr, WaitNotificationFn wait_fn=nullptr)
 

Detailed Description

Definition at line 180 of file allocator.h.

Constructor & Destructor Documentation

onnxruntime::CPUAllocator::CPUAllocator ( const OrtMemoryInfo memory_info)
inlineexplicit

Definition at line 182 of file allocator.h.

onnxruntime::CPUAllocator::CPUAllocator ( )
inline

Definition at line 184 of file allocator.h.

Member Function Documentation

void* onnxruntime::CPUAllocator::Alloc ( size_t  size)
overridevirtual
Remarks
Use SafeInt when calculating the size of memory to allocate using Alloc.

Implements onnxruntime::IAllocator.

void onnxruntime::CPUAllocator::Free ( void p)
overridevirtual

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