From 0ba9326e2a6ae2752ac63bd6752d783b6f4dc98c Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Wed, 22 Jun 2022 16:23:52 +0800 Subject: [PATCH] docs(api/lite): add doc for lite common_enum_c_h GitOrigin-RevId: 8f7da9d91fdf534758d9ecd2092b40185f9bbee7 --- lite/include/lite/common_enum_c.h | 116 +++++++++++++++++++++----------------- 1 file changed, 65 insertions(+), 51 deletions(-) diff --git a/lite/include/lite/common_enum_c.h b/lite/include/lite/common_enum_c.h index 04c24fd6..c39eb0e3 100644 --- a/lite/include/lite/common_enum_c.h +++ b/lite/include/lite/common_enum_c.h @@ -1,74 +1,87 @@ #ifndef LITE_COMMON_ENUM_C_H_ #define LITE_COMMON_ENUM_C_H_ -/*! - * \brief The log level. +/** + * @brief The log level */ typedef enum { - DEBUG = 0, /*!< The lowest level and most verbose */ - INFO = 1, /*!< The lowest level and most verbose */ - WARN = 2, /*!< Print only warning and errors */ - ERROR = 3, /*!< Print only errors */ + DEBUG = 0, ///< the lowest level and most verbose + INFO = 1, ///< print information, warning and errors + WARN = 2, ///< print only warning and errors + ERROR = 3, ///< print only errors } LiteLogLevel; -/*! - * \brief The Error Code +/** + * @brief The error code */ typedef enum { - OK = 0, - LITE_INTERNAL_ERROR = 1, - LITE_UNKNOWN_ERROR = 2, + OK = 0, ///< no error + LITE_INTERNAL_ERROR = 1, ///< internal error + LITE_UNKNOWN_ERROR = 2, ///< unknown error } ErrorCode; +/** + * @brief The backend type + * + */ typedef enum { - LITE_DEFAULT = 0, //! default backend is mge + LITE_DEFAULT = 0, ///< default backend is mge } LiteBackend; +/** + * @brief The device type + * + */ typedef enum { - LITE_CPU = 0, - LITE_CUDA = 1, - LITE_ATLAS = 3, - LITE_NPU = 4, - LITE_CAMBRICON = 5, - //! when the device information is set in model, so set LITE_DEVICE_DEFAULT - //! in lite, which equal to xpu in megengine + LITE_CPU = 0, ///< the device used is cpu + LITE_CUDA = 1, ///< the device used is cuda + LITE_ATLAS = 3, ///< the device used is atlas + LITE_NPU = 4, ///< the device used is npu + LITE_CAMBRICON = 5, ///< the device used is cambricon + ///< when the device information is set in model, so set LITE_DEVICE_DEFAULT + ///< in lite, which equal to xpu in megengine LITE_DEVICE_DEFAULT = 7, } LiteDeviceType; +/** + * @brief The data type + * + */ typedef enum { - LITE_FLOAT = 0, - LITE_HALF = 1, - LITE_INT = 2, - LITE_INT16 = 3, - LITE_INT8 = 4, - LITE_UINT8 = 5, - LITE_UINT = 6, - LITE_UINT16 = 7, - LITE_INT64 = 8, + LITE_FLOAT = 0, ///< data type is float32 + LITE_HALF = 1, ///< data type is float16 + LITE_INT = 2, ///< data type is int32 + LITE_INT16 = 3, ///< data type is int16 + LITE_INT8 = 4, ///< data type is int8 + LITE_UINT8 = 5, ///< data type is uint8 + LITE_UINT = 6, ///< data type is uint32 + LITE_UINT16 = 7, ///< data type is uint16 + LITE_INT64 = 8, ///< data type is int64 } LiteDataType; +/** + * @brief The tensor phase + * + */ typedef enum { - //! Tensor maybe input or output - LITE_IO = 0, - //! Tensor is input - LITE_INPUT = 1, - //! Tensor is output - LITE_OUTPUT = 2, + LITE_IO = 0, ///< tensor maybe input or output + LITE_INPUT = 1, ///< tensor is input + LITE_OUTPUT = 2, ///< tensor is output } 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 */ typedef enum { - LITE_IO_VALUE = 0, - LITE_IO_SHAPE = 1, + LITE_IO_VALUE = 0, ///< the type of input or output is value + LITE_IO_SHAPE = 1, ///< the type of input or output is shape } 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 - * the strategy, the best algorithm will be selected. + * the strategy, the best algorithm will be selected * * Note: These strategies can be combined * @@ -94,21 +107,22 @@ typedef enum { LITE_ALGO_OPTIMIZED = 1 << 3, } 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 * 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 - * 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 - * CL driver behavior, if compile failed!, MegEngine will try build from source, What`s - * more, even though compile from binary success, this cross-use-cache may affect - * performance, VENDOR_COMPAT will contain SERIES_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 + * CL driver behavior, if compile failed!, MegEngine will try build from source, + * What's more, even though compile from binary success, this cross-use-cache may + * affect performance, VENDOR_COMPAT will contain SERIES_COMPAT */ typedef enum { - LITE_NOT_COMPAT = 0, //! default not compat for series and vendor - 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_NOT_COMPAT = 0, ///< default not compat for series and vendor + 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_CACHE_COMPAT_LEVEL_CNT = 3 } LiteOpenCLCacheCompatLevel;