tvm
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Attributes | List of all members
MemoryManagerInterface Struct Reference

#include <page_allocator.h>

Collaboration diagram for MemoryManagerInterface:

Public Attributes

tvm_crt_error_t(* Allocate )(MemoryManagerInterface *interface, size_t num_bytes, DLDevice dev, void **out_ptr)
 Allocate a chunk of memory. More...
 
tvm_crt_error_t(* Free )(MemoryManagerInterface *interface, void *ptr, DLDevice dev)
 Free a chunk of previously-used memory. More...
 
int vleak_size
 Used in testing; the number of allocated objects. More...
 

Member Data Documentation

◆ Allocate

tvm_crt_error_t(* MemoryManagerInterface::Allocate) (MemoryManagerInterface *interface, size_t num_bytes, DLDevice dev, void **out_ptr)

Allocate a chunk of memory.

Parameters
interfacePointer to this structure.
num_bytesNumber of bytes requested.
devExecution device that will be used with the allocated memory. Must be {kDLCPU, 0}.
out_ptrA pointer to which is written a pointer to the newly-allocated memory.
Returns
kTvmErrorNoError if successful; a descriptive error code otherwise.

◆ Free

tvm_crt_error_t(* MemoryManagerInterface::Free) (MemoryManagerInterface *interface, void *ptr, DLDevice dev)

Free a chunk of previously-used memory.

Parameters
interfacePointer to this structure.
ptrA pointer returned from TVMPlatformMemoryAllocate which should be free'd.
devExecution device passed to TVMPlatformMemoryAllocate. Fixed to {kDLCPU, 0}.
Returns
kTvmErrorNoError if successful; a descriptive error code otherwise.

◆ vleak_size

int MemoryManagerInterface::vleak_size

Used in testing; the number of allocated objects.


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