mxnet
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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

Handle Alloc (size_t size, Context ctx)
 Allocate a new contiguous memory for a given size. More...
 
virtual void Alloc (Handle *handle)=0
 Allocate a new contiguous memory for a given size. More...
 
virtual void SharedIncrementRefCount (Handle handle)=0
 Increase ref counter on shared memory. 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...
 
std::mutex & GetMutex (Context::DeviceType dev)
 Returns mutex used by storage manager. 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.
Handle mxnet::Storage::Alloc ( size_t  size,
Context  ctx 
)
inline

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::Alloc ( Handle handle)
pure virtual

Allocate a new contiguous memory for a given size.

Parameters
handlehandle initialized with size and ctx
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.
std::mutex& mxnet::Storage::GetMutex ( Context::DeviceType  dev)
inline

Returns mutex used by storage manager.

virtual void mxnet::Storage::SharedIncrementRefCount ( Handle  handle)
pure virtual

Increase ref counter on shared memory.

Parameters
handlehandle to shared memory.

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