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 stream_id=0) |
bool | 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 void * | New (size_t nbytes) |
static void | Delete (void *data) |
Protected Attributes | |
int | random_seed_ {1701} |
std::unique_ptr< std::mt19937 > | random_generator_ |
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 20 of file mkl_context.h.