mxnet
Classes | Functions
mxnet::common::cuda Namespace Reference

common utils for cuda More...

Classes

struct  CublasType
 Converts between C++ datatypes and enums/constants needed by cuBLAS. More...
 
struct  CublasType< double >
 
struct  CublasType< float >
 
struct  CublasType< int32_t >
 
struct  CublasType< mshadow::half::half_t >
 
struct  CublasType< uint8_t >
 
class  DeviceStore
 

Functions

const char * CublasGetErrorString (cublasStatus_t error)
 Get string representation of cuBLAS errors. More...
 
const char * CusolverGetErrorString (cusolverStatus_t error)
 Get string representation of cuSOLVER errors. More...
 
const char * CurandGetErrorString (curandStatus_t status)
 Get string representation of cuRAND errors. More...
 
template<typename DType >
DType __device__ CudaMax (DType a, DType b)
 
template<typename DType >
DType __device__ CudaMin (DType a, DType b)
 
int get_load_type (size_t N)
 Get the largest datatype suitable to read requested number of bytes. More...
 
int get_rows_per_block (size_t row_size, int num_threads_per_block)
 Determine how many rows in a 2D matrix should a block of threads handle based on the row size and the number of threads in a block. More...
 

Detailed Description

common utils for cuda

Function Documentation

const char* mxnet::common::cuda::CublasGetErrorString ( cublasStatus_t  error)
inline

Get string representation of cuBLAS errors.

Parameters
errorThe error.
Returns
String representation.
template<typename DType >
DType __device__ mxnet::common::cuda::CudaMax ( DType  a,
DType  b 
)
inline
template<typename DType >
DType __device__ mxnet::common::cuda::CudaMin ( DType  a,
DType  b 
)
inline
const char* mxnet::common::cuda::CurandGetErrorString ( curandStatus_t  status)
inline

Get string representation of cuRAND errors.

Parameters
statusThe status.
Returns
String representation.
const char* mxnet::common::cuda::CusolverGetErrorString ( cusolverStatus_t  error)
inline

Get string representation of cuSOLVER errors.

Parameters
errorThe error.
Returns
String representation.
int mxnet::common::cuda::get_load_type ( size_t  N)

Get the largest datatype suitable to read requested number of bytes.

Number of bytes to be read

Returns
mshadow representation of type that could be used for reading
int mxnet::common::cuda::get_rows_per_block ( size_t  row_size,
int  num_threads_per_block 
)

Determine how many rows in a 2D matrix should a block of threads handle based on the row size and the number of threads in a block.

Parameters
row_sizeSize of the row expressed in the number of reads required to fully load it. For example, if the row has N elements, but each thread reads 2 elements with a single read, row_size should be N / 2.
num_threads_per_blockNumber of threads in a block.
Returns
the number of rows that should be handled by a single block.