mxnet
Public Member Functions | Static Public Member Functions | List of all members
mxnet::cpp::Context Class Reference

Context interface. More...

#include <ndarray.h>

Collaboration diagram for mxnet::cpp::Context:
Collaboration graph

Public Member Functions

 Context (const DeviceType &type, int id)
 Context constructor. More...
 
DeviceType GetDeviceType () const
 
int GetDeviceId () const
 

Static Public Member Functions

static Context gpu (int device_id=0)
 Return a GPU context. More...
 
static Context cpu (int device_id=0)
 Return a CPU context. More...
 

Detailed Description

Context interface.

Constructor & Destructor Documentation

mxnet::cpp::Context::Context ( const DeviceType type,
int  id 
)
inline

Context constructor.

Parameters
typetype of the device
idid of the device

Member Function Documentation

static Context mxnet::cpp::Context::cpu ( int  device_id = 0)
inlinestatic

Return a CPU context.

Parameters
device_idid of the device. this is not needed by CPU
Returns
the corresponding CPU context
int mxnet::cpp::Context::GetDeviceId ( ) const
inline
Returns
the id of the device
DeviceType mxnet::cpp::Context::GetDeviceType ( ) const
inline
Returns
the type of the device
static Context mxnet::cpp::Context::gpu ( int  device_id = 0)
inlinestatic

Return a GPU context.

Parameters
device_idid of the device
Returns
the corresponding GPU context

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