Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MegEngine 天元
MegEngine
提交
0ba9326e
MegEngine
项目概览
MegEngine 天元
/
MegEngine
1 年多 前同步成功
通知
404
Star
4705
Fork
582
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
MegEngine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
0ba9326e
编写于
6月 22, 2022
作者:
M
Megvii Engine Team
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
docs(api/lite): add doc for lite common_enum_c_h
GitOrigin-RevId: 8f7da9d91fdf534758d9ecd2092b40185f9bbee7
上级
92ded721
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
65 addition
and
51 deletion
+65
-51
lite/include/lite/common_enum_c.h
lite/include/lite/common_enum_c.h
+65
-51
未找到文件。
lite/include/lite/common_enum_c.h
浏览文件 @
0ba9326e
#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 C
ode
*
@brief The error c
ode
*/
*/
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 o
peration algorithm seletion strategy type, some operations have
*
@brief O
peration 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 e
num for cache compat level, for example: adreno 630 cache may be apply to
*
@brief E
num 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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录