mxnet
Classes | Public Member Functions | Static Public Member Functions | List of all members
mxnet::Storage Class Referenceabstract

Storage manager across multiple devices. More...

#include <storage.h>

Collaboration diagram for mxnet::Storage:
Collaboration graph

Classes

struct  Handle
 Storage handle. More...
 

Public Member Functions

virtual Handle Alloc (size_t size, Context ctx)=0
 Allocate a new contiguous memory for a given size. More...
 
virtual void Free (Handle handle)=0
 Free storage. More...
 
virtual void DirectFree (Handle handle)=0
 Free storage directly, without putting it into memory pool. This can synchronization of all previous runned device functions. More...
 
virtual ~Storage ()
 Destructor. More...
 

Static Public Member Functions

static StorageGet ()
 
static std::shared_ptr< Storage_GetSharedRef ()
 Get shared pointer reference to storage singleton. Most user should not call this function. This function is called by another singleton X who requires Storage to be destructed after X. More...
 

Detailed Description

Storage manager across multiple devices.

Constructor & Destructor Documentation

virtual mxnet::Storage::~Storage ( )
inlinevirtual

Destructor.

Member Function Documentation

static std::shared_ptr<Storage> mxnet::Storage::_GetSharedRef ( )
static

Get shared pointer reference to storage singleton. Most user should not call this function. This function is called by another singleton X who requires Storage to be destructed after X.

Returns
A shared pointer to Storage singleton.
virtual Handle mxnet::Storage::Alloc ( size_t  size,
Context  ctx 
)
pure virtual

Allocate a new contiguous memory for a given size.

Parameters
sizeTotal size of memory in bytes.
ctxContext information about the device and ID.
Returns
Handle struct.
virtual void mxnet::Storage::DirectFree ( Handle  handle)
pure virtual

Free storage directly, without putting it into memory pool. This can synchronization of all previous runned device functions.

This function is suitable for conatiner structure with requirement on upsizing in the beginning phase of the iteration.

Parameters
handleHandle struct.
virtual void mxnet::Storage::Free ( Handle  handle)
pure virtual

Free storage.

Parameters
handleHandle struect.
static Storage* mxnet::Storage::Get ( )
static
Returns
Storage singleton.

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