|
mxnet
|
definitions of base types, operators, macros functions More...
#include <algorithm>#include <cfloat>#include <climits>#include <cmath>#include <cstdio>#include <functional>#include <limits>#include <sstream>#include <string>#include <inttypes.h>#include <mkl_blas.h>#include <mkl_cblas.h>#include <mkl_vsl.h>#include <mkl_vsl_functions.h>#include <mkl_version.h>#include <cuda.h>#include <cublas_v2.h>#include <curand.h>#include <cusolverDn.h>#include "./half.h"#include "./bfloat.h"#include "dmlc/logging.h"

Go to the source code of this file.
Namespaces | |
| mshadow | |
| overloaded + operator between half_t and bf16_t | |
| mshadow::op | |
| namespace for operators | |
| mshadow::sv | |
| namespace for savers | |
| mshadow::isnan_typed | |
| determines if the given floating point number is not a number | |
| mshadow::isinf_typed | |
| determines if the given floating point number is a positive or negative infinity | |
| mshadow::red | |
| namespace for potential reducer operations | |
| mshadow::red::limits | |
Macros | |
| #define | MSHADOW_STAND_ALONE 0 |
| if this macro is define to be 1, mshadow should compile without any of other libs More... | |
| #define | MSHADOW_ALLOC_PAD true |
| whether do padding during allocation More... | |
| #define | MSHADOW_MIN_PAD_RATIO 2 |
| x dimension of data must be bigger pad_size * ratio to be alloced padded memory, otherwise use tide allocation for example, if pad_ratio=2, GPU memory alignement size is 32, then we will only allocate padded memory if x dimension > 64 set it to 0 then we will always allocate padded memory More... | |
| #define | MSHADOW_FORCE_STREAM 1 |
| force user to use GPU stream during computation error will be shot when default stream NULL is used More... | |
| #define | MSHADOW_USE_CBLAS 0 |
| use CBLAS for CBLAS More... | |
| #define | MSHADOW_USE_MKL 1 |
| use MKL for BLAS More... | |
| #define | MSHADOW_USE_CUDA 1 |
| use CUDA support, must ensure that the cuda include path is correct, or directly compile using nvcc More... | |
| #define | MSHADOW_USE_CUDNN 0 |
| use CUDNN support, must ensure that the cudnn include path is correct More... | |
| #define | MSHADOW_USE_CUTENSOR 0 |
| use CUTENSOR support, must ensure that the cutensor include path is correct More... | |
| #define | MSHADOW_USE_CUSOLVER MSHADOW_USE_CUDA |
| use CUSOLVER support More... | |
| #define | MSHADOW_OLD_CUDA 0 |
| seems CUDAARCH is deprecated in future NVCC set this to 1 if you want to use CUDA version smaller than 2.0 More... | |
| #define | MSHADOW_USE_SSE 1 |
| whether use SSE More... | |
| #define | MSHADOW_USE_F16C 1 |
| whether use F16C instruction set architecture extension More... | |
| #define | MSHADOW_USE_NVML 0 |
| whether use NVML to get dynamic info More... | |
| #define | MSHADOW_FORCE_INLINE inline __attribute__((always_inline)) |
| #define | MSHADOW_XINLINE MSHADOW_FORCE_INLINE |
| #define | MSHADOW_CINLINE MSHADOW_FORCE_INLINE |
| cpu force inline More... | |
| #define | MSHADOW_DEFAULT_DTYPE = ::mshadow::default_real_t |
| default data type for tensor string in code release, change it to default_real_t during development, change it to empty string so that missing template arguments can be detected More... | |
| #define | MSHADOW_USE_GLOG DMLC_USE_GLOG |
| DMLC marco for logging. More... | |
| #define | MSHADOW_THROW_EXCEPTION noexcept(false) |
| #define | MSHADOW_NO_EXCEPTION noexcept(true) |
| #define | MSHADOW_ALIGNED(x) __attribute__ ((aligned(x))) |
| #define | MSHADOW_CUDA_CALL(func) |
| Protected cuda call in mshadow. More... | |
| #define | MSHADOW_CATCH_ERROR(func) |
| Run function and catch error, log unknown error. More... | |
| #define | MSHADOW_HALF_BF_OPERATOR(RTYPE, OP) |
| #define | MSHADOW_TYPE_SWITCH(type, DType, ...) |
| #define | MSHADOW_SGL_DBL_TYPE_SWITCH(type, DType, ...) |
| #define | MSHADOW_REAL_TYPE_SWITCH(type, DType, ...) |
| #define | MSHADOW_REAL_TYPE_SWITCH_EX(type, DType, DLargeType, ...) |
| #define | MSHADOW_LAYOUT_SWITCH(layout, Layout, ...) |
| #define | MSHADOW_IDX_TYPE_SWITCH(type, DType, ...) |
| Only supports int64 index type for aux_data in NDArray class for now. More... | |
| #define | MSHADOW_TYPE_SWITCH_WITH_BOOL(type, DType, ...) |
| #define | MSHADOW_TYPE_SWITCH_EXT(type, DType, ...) |
| #define | MSHADOW_TYPE_SWITCH_EXT_WITH_BOOL(type, DType, ...) |
Typedefs | |
| typedef int32_t | mshadow::index_t |
| type that will be used for index More... | |
| typedef index_t | mshadow::openmp_index_t |
| openmp index for linux More... | |
| typedef int | mshadow::lapack_index_t |
| typedef float | mshadow::default_real_t |
| float point type that will be used in default by mshadow More... | |
Enumerations | |
| enum | mshadow::TypeFlag { mshadow::kFloat32 = 0, mshadow::kFloat64 = 1, mshadow::kFloat16 = 2, mshadow::kUint8 = 3, mshadow::kInt32 = 4, mshadow::kInt8 = 5, mshadow::kInt64 = 6, mshadow::kBool = 7, mshadow::kInt16 = 8, mshadow::kUint16 = 9, mshadow::kUint32 = 10, mshadow::kUint64 = 11, mshadow::kBfloat16 = 12 } |
| data type flag More... | |
| enum | mshadow::LayoutFlag { mshadow::kUNKNOWN = -1, mshadow::kNCHW = 0, mshadow::kNHWC, mshadow::kCHWN, mshadow::kNCW = 1 << 3, mshadow::kNWC, mshadow::kCWN, mshadow::kNCDHW = 1 << 5, mshadow::kNDHWC, mshadow::kCDHWN } |
Functions | |
| LayoutFlag | mshadow::layoutFlag (std::string layoutstr) |
| std::string | mshadow::toString (LayoutFlag layout) |
| template<typename DType > | |
| MSHADOW_XINLINE bool | mshadow::isnan_typed::IsNan (volatile DType val) |
| template<> | |
| MSHADOW_XINLINE bool | mshadow::isnan_typed::IsNan (volatile float val) |
| template<> | |
| MSHADOW_XINLINE bool | mshadow::isnan_typed::IsNan (volatile double val) |
| template<> | |
| MSHADOW_XINLINE bool | mshadow::isnan_typed::IsNan (volatile long double val) |
| template<> | |
| MSHADOW_XINLINE bool | mshadow::isnan_typed::IsNan (volatile mshadow::half::half_t val) |
| template<> | |
| MSHADOW_XINLINE bool | mshadow::isnan_typed::IsNan (volatile mshadow::bfloat::bf16_t val) |
| template<typename DType > | |
| MSHADOW_XINLINE bool | mshadow::isinf_typed::IsInf (volatile DType val) |
| template<> | |
| MSHADOW_XINLINE bool | mshadow::isinf_typed::IsInf (volatile float val) |
| template<> | |
| MSHADOW_XINLINE bool | mshadow::isinf_typed::IsInf (volatile double val) |
| template<> | |
| MSHADOW_XINLINE bool | mshadow::isinf_typed::IsInf (volatile long double val) |
| template<> | |
| MSHADOW_XINLINE bool | mshadow::isinf_typed::IsInf (volatile mshadow::half::half_t val) |
| template<> | |
| MSHADOW_XINLINE bool | mshadow::isinf_typed::IsInf (volatile mshadow::bfloat::bf16_t val) |
| template<typename DType > | |
| MSHADOW_XINLINE DType | mshadow::red::limits::MinValue (void) |
| minimum value of certain types More... | |
| template<> | |
| MSHADOW_XINLINE float | mshadow::red::limits::MinValue< float > (void) |
| minimum value of float More... | |
| template<> | |
| MSHADOW_XINLINE double | mshadow::red::limits::MinValue< double > (void) |
| minimum value of double More... | |
| template<> | |
| MSHADOW_XINLINE half::half_t | mshadow::red::limits::MinValue< half::half_t > (void) |
| minimum value of half More... | |
| template<> | |
| MSHADOW_XINLINE bfloat::bf16_t | mshadow::red::limits::MinValue< bfloat::bf16_t > (void) |
| minimum value of bf16 More... | |
| template<> | |
| MSHADOW_XINLINE uint8_t | mshadow::red::limits::MinValue< uint8_t > (void) |
| minimum value of uint8_t More... | |
| template<> | |
| MSHADOW_XINLINE int8_t | mshadow::red::limits::MinValue< int8_t > (void) |
| minimum value of int8_t More... | |
| template<> | |
| MSHADOW_XINLINE int | mshadow::red::limits::MinValue< int32_t > (void) |
| minimum value of int32_t More... | |
| template<> | |
| MSHADOW_XINLINE int64_t | mshadow::red::limits::MinValue< int64_t > (void) |
| minimum value of int64_t More... | |
| template<> | |
| MSHADOW_XINLINE bool | mshadow::red::limits::MinValue< bool > (void) |
| minimum value of bool More... | |
| template<> | |
| MSHADOW_XINLINE unsigned int | mshadow::red::limits::MinValue< unsigned int > (void) |
| minimum value of unsigned int More... | |
| template<typename DType > | |
| MSHADOW_XINLINE DType | mshadow::red::limits::NegInfValue (void) |
| negative infinity of certain types More... | |
| template<> | |
| MSHADOW_XINLINE float | mshadow::red::limits::NegInfValue< float > (void) |
| negative infinity value of float More... | |
| template<> | |
| MSHADOW_XINLINE double | mshadow::red::limits::NegInfValue< double > (void) |
| negative infinity value of double More... | |
| template<> | |
| MSHADOW_XINLINE half::half_t | mshadow::red::limits::NegInfValue< half::half_t > (void) |
| negative infinity value of float16 More... | |
| template<> | |
| MSHADOW_XINLINE bfloat::bf16_t | mshadow::red::limits::NegInfValue< bfloat::bf16_t > (void) |
| negative infinity value of bfloat16 More... | |
| template<typename DType > | |
| MSHADOW_XINLINE DType | mshadow::red::limits::MaxValue (void) |
| maximum value of certain types More... | |
| template<> | |
| MSHADOW_XINLINE float | mshadow::red::limits::MaxValue< float > (void) |
| maximum value of float More... | |
| template<> | |
| MSHADOW_XINLINE double | mshadow::red::limits::MaxValue< double > (void) |
| maximum value of double More... | |
| template<> | |
| MSHADOW_XINLINE half::half_t | mshadow::red::limits::MaxValue< half::half_t > (void) |
| maximum value of half More... | |
| template<> | |
| MSHADOW_XINLINE bfloat::bf16_t | mshadow::red::limits::MaxValue< bfloat::bf16_t > (void) |
| maximum value of bf16 More... | |
| template<> | |
| MSHADOW_XINLINE uint8_t | mshadow::red::limits::MaxValue< uint8_t > (void) |
| maximum value of uint8_t More... | |
| template<> | |
| MSHADOW_XINLINE int8_t | mshadow::red::limits::MaxValue< int8_t > (void) |
| maximum value of int8_t More... | |
| template<> | |
| MSHADOW_XINLINE int | mshadow::red::limits::MaxValue< int32_t > (void) |
| maximum value of int32_t More... | |
| template<> | |
| MSHADOW_XINLINE int64_t | mshadow::red::limits::MaxValue< int64_t > (void) |
| maximum value of int64_t More... | |
| template<> | |
| MSHADOW_XINLINE bool | mshadow::red::limits::MaxValue< bool > (void) |
| maximum value of bool More... | |
| template<> | |
| MSHADOW_XINLINE uint32_t | mshadow::red::limits::MaxValue< uint32_t > (void) |
| maximum value of uint32_t More... | |
| template<typename DType > | |
| MSHADOW_XINLINE DType | mshadow::red::limits::PosInfValue (void) |
| positive infinity of certain types More... | |
| template<> | |
| MSHADOW_XINLINE float | mshadow::red::limits::PosInfValue< float > (void) |
| positive infinity value of float More... | |
| template<> | |
| MSHADOW_XINLINE double | mshadow::red::limits::PosInfValue< double > (void) |
| positive infinity value of double More... | |
| template<> | |
| MSHADOW_XINLINE half::half_t | mshadow::red::limits::PosInfValue< half::half_t > (void) |
| positive infinity value of float16 More... | |
| template<> | |
| MSHADOW_XINLINE bfloat::bf16_t | mshadow::red::limits::PosInfValue< bfloat::bf16_t > (void) |
| positive infinity value of bfloat16 More... | |
| size_t | mshadow::mshadow_sizeof (int type) |
| get data type size from type enum More... | |
| std::string | mshadow::dtype_string (const int dtype) |
Variables | |
| const unsigned | mshadow::kRandBufferSize = 1000000 |
| buffer size for each random number generator More... | |
| const float | mshadow::kPi = 3.1415926f |
| pi More... | |
| const int | mshadow::default_type_flag = DataType<default_real_t>::kFlag |
| type enum value for default real type More... | |
| const int | mshadow::index_type_flag = DataType<lapack_index_t>::kFlag |
| TypeFlag value for type of indexes. More... | |
| const int | mshadow::default_layout = kNCHW |
| default layout for 4d tensor More... | |
| const int | mshadow::default_layout_5d = kNCDHW |
| default layout for 5d tensor More... | |
definitions of base types, operators, macros functions
| #define MSHADOW_ALIGNED | ( | x | ) | __attribute__ ((aligned(x))) |
| #define MSHADOW_ALLOC_PAD true |
whether do padding during allocation
| #define MSHADOW_CATCH_ERROR | ( | func | ) |
Run function and catch error, log unknown error.
| func | Expression to call. |
| #define MSHADOW_CINLINE MSHADOW_FORCE_INLINE |
cpu force inline
| #define MSHADOW_CUDA_CALL | ( | func | ) |
Protected cuda call in mshadow.
| func | Expression to call. It checks for CUDA errors after invocation of the expression. |
| #define MSHADOW_DEFAULT_DTYPE = ::mshadow::default_real_t |
default data type for tensor string in code release, change it to default_real_t during development, change it to empty string so that missing template arguments can be detected
| #define MSHADOW_FORCE_INLINE inline __attribute__((always_inline)) |
| #define MSHADOW_FORCE_STREAM 1 |
force user to use GPU stream during computation error will be shot when default stream NULL is used
| #define MSHADOW_HALF_BF_OPERATOR | ( | RTYPE, | |
| OP | |||
| ) |
| #define MSHADOW_IDX_TYPE_SWITCH | ( | type, | |
| DType, | |||
| ... | |||
| ) |
Only supports int64 index type for aux_data in NDArray class for now.
| #define MSHADOW_LAYOUT_SWITCH | ( | layout, | |
| Layout, | |||
| ... | |||
| ) |
| #define MSHADOW_MIN_PAD_RATIO 2 |
x dimension of data must be bigger pad_size * ratio to be alloced padded memory, otherwise use tide allocation for example, if pad_ratio=2, GPU memory alignement size is 32, then we will only allocate padded memory if x dimension > 64 set it to 0 then we will always allocate padded memory
| #define MSHADOW_NO_EXCEPTION noexcept(true) |
| #define MSHADOW_OLD_CUDA 0 |
seems CUDAARCH is deprecated in future NVCC set this to 1 if you want to use CUDA version smaller than 2.0
| #define MSHADOW_REAL_TYPE_SWITCH | ( | type, | |
| DType, | |||
| ... | |||
| ) |
| #define MSHADOW_REAL_TYPE_SWITCH_EX | ( | type, | |
| DType, | |||
| DLargeType, | |||
| ... | |||
| ) |
| #define MSHADOW_SGL_DBL_TYPE_SWITCH | ( | type, | |
| DType, | |||
| ... | |||
| ) |
| #define MSHADOW_STAND_ALONE 0 |
if this macro is define to be 1, mshadow should compile without any of other libs
| #define MSHADOW_THROW_EXCEPTION noexcept(false) |
| #define MSHADOW_TYPE_SWITCH | ( | type, | |
| DType, | |||
| ... | |||
| ) |
| #define MSHADOW_TYPE_SWITCH_EXT | ( | type, | |
| DType, | |||
| ... | |||
| ) |
| #define MSHADOW_TYPE_SWITCH_EXT_WITH_BOOL | ( | type, | |
| DType, | |||
| ... | |||
| ) |
| #define MSHADOW_TYPE_SWITCH_WITH_BOOL | ( | type, | |
| DType, | |||
| ... | |||
| ) |
| #define MSHADOW_USE_CBLAS 0 |
use CBLAS for CBLAS
| #define MSHADOW_USE_CUDA 1 |
use CUDA support, must ensure that the cuda include path is correct, or directly compile using nvcc
| #define MSHADOW_USE_CUDNN 0 |
use CUDNN support, must ensure that the cudnn include path is correct
| #define MSHADOW_USE_CUSOLVER MSHADOW_USE_CUDA |
use CUSOLVER support
| #define MSHADOW_USE_CUTENSOR 0 |
use CUTENSOR support, must ensure that the cutensor include path is correct
| #define MSHADOW_USE_F16C 1 |
whether use F16C instruction set architecture extension
| #define MSHADOW_USE_GLOG DMLC_USE_GLOG |
DMLC marco for logging.
| #define MSHADOW_USE_MKL 1 |
use MKL for BLAS
| #define MSHADOW_USE_NVML 0 |
whether use NVML to get dynamic info
| #define MSHADOW_USE_SSE 1 |
whether use SSE
| #define MSHADOW_XINLINE MSHADOW_FORCE_INLINE |
1.8.17