提交 0ba9326e 编写于 作者: M Megvii Engine Team

docs(api/lite): add doc for lite common_enum_c_h

GitOrigin-RevId: 8f7da9d91fdf534758d9ecd2092b40185f9bbee7
上级 92ded721
#ifndef LITE_COMMON_ENUM_C_H_ #ifndef LITE_COMMON_ENUM_C_H_
#define LITE_COMMON_ENUM_C_H_ #define LITE_COMMON_ENUM_C_H_
/*! /**
* \brief The log level. * @brief The log level
*/ */
typedef enum { typedef enum {
DEBUG = 0, /*!< The lowest level and most verbose */ DEBUG = 0, ///< the lowest level and most verbose
INFO = 1, /*!< The lowest level and most verbose */ INFO = 1, ///< print information, warning and errors
WARN = 2, /*!< Print only warning and errors */ WARN = 2, ///< print only warning and errors
ERROR = 3, /*!< Print only errors */ ERROR = 3, ///< print only errors
} LiteLogLevel; } LiteLogLevel;
/*! /**
* \brief The Error Code * @brief The error code
*/ */
typedef enum { typedef enum {
OK = 0, OK = 0, ///< no error
LITE_INTERNAL_ERROR = 1, LITE_INTERNAL_ERROR = 1, ///< internal error
LITE_UNKNOWN_ERROR = 2, LITE_UNKNOWN_ERROR = 2, ///< unknown error
} ErrorCode; } ErrorCode;
/**
* @brief The backend type
*
*/
typedef enum { typedef enum {
LITE_DEFAULT = 0, //! default backend is mge LITE_DEFAULT = 0, ///< default backend is mge
} LiteBackend; } LiteBackend;
/**
* @brief The device type
*
*/
typedef enum { typedef enum {
LITE_CPU = 0, LITE_CPU = 0, ///< the device used is cpu
LITE_CUDA = 1, LITE_CUDA = 1, ///< the device used is cuda
LITE_ATLAS = 3, LITE_ATLAS = 3, ///< the device used is atlas
LITE_NPU = 4, LITE_NPU = 4, ///< the device used is npu
LITE_CAMBRICON = 5, LITE_CAMBRICON = 5, ///< the device used is cambricon
//! when the device information is set in model, so set LITE_DEVICE_DEFAULT ///< when the device information is set in model, so set LITE_DEVICE_DEFAULT
//! in lite, which equal to xpu in megengine ///< in lite, which equal to xpu in megengine
LITE_DEVICE_DEFAULT = 7, LITE_DEVICE_DEFAULT = 7,
} LiteDeviceType; } LiteDeviceType;
/**
* @brief The data type
*
*/
typedef enum { typedef enum {
LITE_FLOAT = 0, LITE_FLOAT = 0, ///< data type is float32
LITE_HALF = 1, LITE_HALF = 1, ///< data type is float16
LITE_INT = 2, LITE_INT = 2, ///< data type is int32
LITE_INT16 = 3, LITE_INT16 = 3, ///< data type is int16
LITE_INT8 = 4, LITE_INT8 = 4, ///< data type is int8
LITE_UINT8 = 5, LITE_UINT8 = 5, ///< data type is uint8
LITE_UINT = 6, LITE_UINT = 6, ///< data type is uint32
LITE_UINT16 = 7, LITE_UINT16 = 7, ///< data type is uint16
LITE_INT64 = 8, LITE_INT64 = 8, ///< data type is int64
} LiteDataType; } LiteDataType;
/**
* @brief The tensor phase
*
*/
typedef enum { typedef enum {
//! Tensor maybe input or output LITE_IO = 0, ///< tensor maybe input or output
LITE_IO = 0, LITE_INPUT = 1, ///< tensor is input
//! Tensor is input LITE_OUTPUT = 2, ///< tensor is output
LITE_INPUT = 1,
//! Tensor is output
LITE_OUTPUT = 2,
} LiteTensorPhase; } LiteTensorPhase;
/*! /**
* \brief the input and output type, include SHAPE and VALUE * @brief the input and output type, include SHAPE and VALUE
* sometimes user only need the shape of the output tensor * sometimes user only need the shape of the output tensor
*/ */
typedef enum { typedef enum {
LITE_IO_VALUE = 0, LITE_IO_VALUE = 0, ///< the type of input or output is value
LITE_IO_SHAPE = 1, LITE_IO_SHAPE = 1, ///< the type of input or output is shape
} LiteIOType; } LiteIOType;
/*! /**
* \brief operation algorithm seletion strategy type, some operations have * @brief Operation algorithm seletion strategy type, some operations have
* multi algorithms, different algorithm has different attribute, according to * multi algorithms, different algorithm has different attribute, according to
* the strategy, the best algorithm will be selected. * the strategy, the best algorithm will be selected
* *
* Note: These strategies can be combined * Note: These strategies can be combined
* *
...@@ -94,21 +107,22 @@ typedef enum { ...@@ -94,21 +107,22 @@ typedef enum {
LITE_ALGO_OPTIMIZED = 1 << 3, LITE_ALGO_OPTIMIZED = 1 << 3,
} LiteAlgoSelectStrategy; } LiteAlgoSelectStrategy;
/*! /**
* \brief enum for cache compat level, for example: adreno 630 cache may be apply to * @brief Enum for cache compat level, for example: adreno 630 cache may be apply to
* adreno 640, if you do not want search cache for adreno 640, just config SERIES_COMPAT * adreno 640, if you do not want search cache for adreno 640, just config SERIES_COMPAT
* or VENDOR_COMPAT, adreno 506 cache may be apply to adreno 630, if you do not want * or VENDOR_COMPAT, adreno 506 cache may be apply to adreno 630, if you do not want
* search cache for adreno 630, just config VENDOR_COMPAT * search cache for adreno 630, just config VENDOR_COMPAT
* WARN: this config just let program_cache_io try `use a old cache` for `device compile *
* the cache` do not means MegEngine will insure the compile will be ok! it`s a device * `WARN`: this config just let program_cache_io try use a old cache for device compile
* CL driver behavior, if compile failed!, MegEngine will try build from source, What`s * the cache do not means MegEngine will insure the compile will be ok! it's a device
* more, even though compile from binary success, this cross-use-cache may affect * CL driver behavior, if compile failed!, MegEngine will try build from source,
* performance, VENDOR_COMPAT will contain SERIES_COMPAT * What's more, even though compile from binary success, this cross-use-cache may
* affect performance, VENDOR_COMPAT will contain SERIES_COMPAT
*/ */
typedef enum { typedef enum {
LITE_NOT_COMPAT = 0, //! default not compat for series and vendor LITE_NOT_COMPAT = 0, ///< default not compat for series and vendor
LITE_SERIES_COMPAT = 1, //! for scene adreno 640 use adreno 630 cache LITE_SERIES_COMPAT = 1, ///< for scene adreno 640 use adreno 630 cache
LITE_VENDOR_COMPAT = 2, //! for scene adreno 630 use adreno 506 cache LITE_VENDOR_COMPAT = 2, ///< for scene adreno 630 use adreno 506 cache
LITE_CACHE_COMPAT_LEVEL_CNT = 3 LITE_CACHE_COMPAT_LEVEL_CNT = 3
} LiteOpenCLCacheCompatLevel; } LiteOpenCLCacheCompatLevel;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册