mxnet
|
provide resource APIs memory allocation mechanism to Forward/Backward functions More...
#include <lib_api.h>
Public Member Functions | |
OpResource (xpu_malloc_t cpu_malloc_fp, void *cpu_alloc_fp, xpu_malloc_t gpu_malloc_fp, void *gpu_alloc_fp, void *stream, sparse_malloc_t sparse_malloc_fp, void *sparse_alloc_fp, void *rng_cpu_states, void *rng_gpu_states) | |
void * | alloc_cpu (int size) const |
allocate cpu memory controlled by MXNet More... | |
void * | alloc_gpu (int size) const |
allocate gpu memory controlled by MXNet More... | |
mx_stream_t | get_cuda_stream () const |
return the cuda stream object with correct type More... | |
void | alloc_sparse (MXSparse *sparse, int index, int indices_len, int indptr_len=0) const |
allocate sparse memory controlled by MXNet More... | |
mx_cpu_rand_t * | get_cpu_rand_states () const |
get pointer to initialized and seeded random number states located on CPU More... | |
mx_gpu_rand_t * | get_gpu_rand_states () const |
get pointer to initialized and seeded random number states located on GPU More... | |
provide resource APIs memory allocation mechanism to Forward/Backward functions
mxnet::ext::OpResource::OpResource | ( | xpu_malloc_t | cpu_malloc_fp, |
void * | cpu_alloc_fp, | ||
xpu_malloc_t | gpu_malloc_fp, | ||
void * | gpu_alloc_fp, | ||
void * | stream, | ||
sparse_malloc_t | sparse_malloc_fp, | ||
void * | sparse_alloc_fp, | ||
void * | rng_cpu_states, | ||
void * | rng_gpu_states | ||
) |
void* mxnet::ext::OpResource::alloc_cpu | ( | int | size | ) | const |
allocate cpu memory controlled by MXNet
void* mxnet::ext::OpResource::alloc_gpu | ( | int | size | ) | const |
allocate gpu memory controlled by MXNet
void mxnet::ext::OpResource::alloc_sparse | ( | MXSparse * | sparse, |
int | index, | ||
int | indices_len, | ||
int | indptr_len = 0 |
||
) | const |
allocate sparse memory controlled by MXNet
mx_cpu_rand_t* mxnet::ext::OpResource::get_cpu_rand_states | ( | ) | const |
get pointer to initialized and seeded random number states located on CPU
|
inline |
return the cuda stream object with correct type
|
inline |
get pointer to initialized and seeded random number states located on GPU