Caffe2 - C++ API
A deep learning, cross platform ML framework
Public Member Functions | Static Public Member Functions | Protected Attributes
caffe2::MKLContext Class Referencefinal

The MKL Context, which is largely the same as the CPUContext. More...

#include <mkl_context.h>

Public Member Functions

 MKLContext (const DeviceOption &option)
 
void SwitchToDevice (int=0)
 
void WaitEvent (const Event &ev)
 
void Record (Event *ev, const char *err_msg=nullptr) const
 
void FinishDeviceComputation ()
 
std::mt19937 & RandGenerator ()
 
template<class SrcContext , class DstContext >
void CopyBytes (size_t nbytes, const void *src, void *dst)
 
template<typename T , class SrcContext , class DstContext >
void Copy (size_t n, const T *src, T *dst)
 
template<class SrcContext , class DstContext >
void CopyItems (const TypeMeta &meta, size_t n, const void *src, void *dst)
 
template<>
void CopyBytes (size_t nbytes, const void *src, void *dst)
 
template<>
void CopyBytes (size_t nbytes, const void *src, void *dst)
 
template<>
void CopyBytes (size_t nbytes, const void *src, void *dst)
 

Static Public Member Functions

static std::pair< void *, MemoryDeleter > New (size_t nbytes)
 
static bool HasAsyncPartDefault ()
 
static bool SupportsAsyncScheduling ()
 
static bool IsStreamFree (const DeviceOption &, int)
 

Protected Attributes

int random_seed_ {1701}
 
std::unique_ptr< std::mt19937 > random_generator_
 

Detailed Description

The MKL Context, which is largely the same as the CPUContext.

We instantiate this mainly in order to have a first-class MKL device.

Note that although New() and Delete() are implemented, we expect MKLContext operators to mainly perform input and output via MKLMemory. As a result, most likely MKLContext::New and ::Delete won't be used as often.

Definition at line 36 of file mkl_context.h.


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