Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
05e5cfd0
P
Paddle-Lite
项目概览
PaddlePaddle
/
Paddle-Lite
通知
331
Star
4
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
271
列表
看板
标记
里程碑
合并请求
78
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle-Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
271
Issue
271
列表
看板
标记
里程碑
合并请求
78
合并请求
78
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
05e5cfd0
编写于
3月 31, 2020
作者:
J
jackzhang235
提交者:
GitHub
3月 31, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[MLU][lib_increased] add some basic mlu definition (#3275)
上级
c754a38f
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
41 addition
and
2 deletion
+41
-2
lite/api/paddle_place.h
lite/api/paddle_place.h
+2
-1
lite/core/context.h
lite/core/context.h
+1
-0
lite/core/op_registry.cc
lite/core/op_registry.cc
+12
-0
lite/core/op_registry.h
lite/core/op_registry.h
+26
-1
未找到文件。
lite/api/paddle_place.h
浏览文件 @
05e5cfd0
...
@@ -54,7 +54,8 @@ enum class TargetType : int {
...
@@ -54,7 +54,8 @@ enum class TargetType : int {
kXPU
=
9
,
kXPU
=
9
,
kBM
=
10
,
kBM
=
10
,
kAny
=
6
,
// any target
kAny
=
6
,
// any target
NUM
=
11
,
// number of fields.
kMLU
=
11
,
NUM
=
12
,
// number of fields.
};
};
enum
class
PrecisionType
:
int
{
enum
class
PrecisionType
:
int
{
kUnk
=
0
,
kUnk
=
0
,
...
...
lite/core/context.h
浏览文件 @
05e5cfd0
...
@@ -52,6 +52,7 @@ using XPUContext = Context<TargetType::kXPU>;
...
@@ -52,6 +52,7 @@ using XPUContext = Context<TargetType::kXPU>;
using
OpenCLContext
=
Context
<
TargetType
::
kOpenCL
>
;
using
OpenCLContext
=
Context
<
TargetType
::
kOpenCL
>
;
using
FPGAContext
=
Context
<
TargetType
::
kFPGA
>
;
using
FPGAContext
=
Context
<
TargetType
::
kFPGA
>
;
using
BMContext
=
Context
<
TargetType
::
kBM
>
;
using
BMContext
=
Context
<
TargetType
::
kBM
>
;
using
MLUContext
=
Context
<
TargetType
::
kMLU
>
;
template
<
>
template
<
>
class
Context
<
TargetType
::
kHost
>
{
class
Context
<
TargetType
::
kHost
>
{
...
...
lite/core/op_registry.cc
浏览文件 @
05e5cfd0
...
@@ -107,6 +107,9 @@ std::list<std::unique_ptr<KernelBase>> KernelRegistry::Create(
...
@@ -107,6 +107,9 @@ std::list<std::unique_ptr<KernelBase>> KernelRegistry::Create(
case
TARGET
(
kBM
):
{
case
TARGET
(
kBM
):
{
CREATE_KERNEL
(
kBM
);
CREATE_KERNEL
(
kBM
);
}
break
;
}
break
;
case
TARGET
(
kMLU
):
{
CREATE_KERNEL
(
kMLU
);
}
break
;
default:
default:
CHECK
(
false
)
<<
"not supported kernel target "
<<
TargetToStr
(
target
);
CHECK
(
false
)
<<
"not supported kernel target "
<<
TargetToStr
(
target
);
}
}
...
@@ -139,6 +142,15 @@ KernelRegistry::KernelRegistry()
...
@@ -139,6 +142,15 @@ KernelRegistry::KernelRegistry()
INIT_FOR
(
kCUDA
,
kInt64
,
kNCHW
);
INIT_FOR
(
kCUDA
,
kInt64
,
kNCHW
);
INIT_FOR
(
kCUDA
,
kInt64
,
kNHWC
);
INIT_FOR
(
kCUDA
,
kInt64
,
kNHWC
);
INIT_FOR
(
kMLU
,
kFloat
,
kNHWC
);
INIT_FOR
(
kMLU
,
kFloat
,
kNCHW
);
INIT_FOR
(
kMLU
,
kFP16
,
kNHWC
);
INIT_FOR
(
kMLU
,
kFP16
,
kNCHW
);
INIT_FOR
(
kMLU
,
kInt8
,
kNHWC
);
INIT_FOR
(
kMLU
,
kInt8
,
kNCHW
);
INIT_FOR
(
kMLU
,
kInt16
,
kNHWC
);
INIT_FOR
(
kMLU
,
kInt16
,
kNCHW
);
INIT_FOR
(
kHost
,
kFloat
,
kNCHW
);
INIT_FOR
(
kHost
,
kFloat
,
kNCHW
);
INIT_FOR
(
kHost
,
kAny
,
kNCHW
);
INIT_FOR
(
kHost
,
kAny
,
kNCHW
);
INIT_FOR
(
kHost
,
kFloat
,
kNHWC
);
INIT_FOR
(
kHost
,
kFloat
,
kNHWC
);
...
...
lite/core/op_registry.h
浏览文件 @
05e5cfd0
...
@@ -268,7 +268,32 @@ class KernelRegistry final {
...
@@ -268,7 +268,32 @@ class KernelRegistry final {
DATALAYOUT
(
kAny
)
>
*
,
//
DATALAYOUT
(
kAny
)
>
*
,
//
KernelRegistryForTarget
<
TARGET
(
kFPGA
),
KernelRegistryForTarget
<
TARGET
(
kFPGA
),
PRECISION
(
kAny
),
PRECISION
(
kAny
),
DATALAYOUT
(
kAny
)
>
*
//
DATALAYOUT
(
kAny
)
>
*
,
//
KernelRegistryForTarget
<
TARGET
(
kMLU
),
PRECISION
(
kFloat
),
DATALAYOUT
(
kNHWC
)
>
*
,
//
KernelRegistryForTarget
<
TARGET
(
kMLU
),
PRECISION
(
kFloat
),
DATALAYOUT
(
kNCHW
)
>
*
,
//
KernelRegistryForTarget
<
TARGET
(
kMLU
),
PRECISION
(
kFP16
),
DATALAYOUT
(
kNHWC
)
>
*
,
//
KernelRegistryForTarget
<
TARGET
(
kMLU
),
PRECISION
(
kFP16
),
DATALAYOUT
(
kNCHW
)
>
*
,
//
KernelRegistryForTarget
<
TARGET
(
kMLU
),
PRECISION
(
kInt8
),
DATALAYOUT
(
kNHWC
)
>
*
,
//
KernelRegistryForTarget
<
TARGET
(
kMLU
),
PRECISION
(
kInt8
),
DATALAYOUT
(
kNCHW
)
>
*
,
//
KernelRegistryForTarget
<
TARGET
(
kMLU
),
PRECISION
(
kInt16
),
DATALAYOUT
(
kNHWC
)
>
*
,
//
KernelRegistryForTarget
<
TARGET
(
kMLU
),
PRECISION
(
kInt16
),
DATALAYOUT
(
kNCHW
)
>
*
//
>
;
>
;
KernelRegistry
();
KernelRegistry
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录