Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
1e10b471
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看板
未验证
提交
1e10b471
编写于
12月 27, 2019
作者:
H
hong19860320
提交者:
GitHub
12月 27, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[LITE][NPU][XPU] Add kernel context to NPU/XPU subgraph engine (#2686)
上级
ad1dfbf2
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
15 addition
and
8 deletion
+15
-8
lite/kernels/npu/bridges/engine.h
lite/kernels/npu/bridges/engine.h
+5
-2
lite/kernels/npu/subgraph_compute.cc
lite/kernels/npu/subgraph_compute.cc
+2
-1
lite/kernels/npu/subgraph_compute.h
lite/kernels/npu/subgraph_compute.h
+3
-2
lite/kernels/xpu/subgraph_compute.cc
lite/kernels/xpu/subgraph_compute.cc
+2
-1
lite/kernels/xpu/subgraph_compute.h
lite/kernels/xpu/subgraph_compute.h
+3
-2
未找到文件。
lite/kernels/npu/bridges/engine.h
浏览文件 @
1e10b471
...
...
@@ -28,12 +28,14 @@ namespace subgraph {
class
Engine
{
public:
Engine
(
int
block_idx
,
Engine
(
KernelContext
*
ctx
,
int
block_idx
,
cpp
::
BlockDesc
*
block_desc
,
const
std
::
vector
<
std
::
string
>
&
input_names
,
const
std
::
vector
<
std
::
string
>
&
output_names
,
lite
::
Scope
*
scope
)
:
block_idx_
(
block_idx
),
:
ctx_
(
ctx
),
block_idx_
(
block_idx
),
block_desc_
(
block_desc
),
input_names_
(
input_names
),
output_names_
(
output_names
),
...
...
@@ -55,6 +57,7 @@ class Engine {
virtual
bool
InputShapeChanged
();
KernelContext
*
ctx_
{
nullptr
};
int
block_idx_
;
cpp
::
BlockDesc
*
block_desc_
;
std
::
vector
<
std
::
string
>
input_names_
;
...
...
lite/kernels/npu/subgraph_compute.cc
浏览文件 @
1e10b471
...
...
@@ -207,7 +207,8 @@ int SubgraphEngine::LaunchDeviceProgram() {
void
SubgraphCompute
::
PrepareForRun
()
{
auto
&
param
=
this
->
Param
<
param_t
>
();
engine_
.
reset
(
new
SubgraphEngine
(
param
.
sub_block_idx
,
engine_
.
reset
(
new
SubgraphEngine
(
ctx_
.
get
(),
param
.
sub_block_idx
,
param
.
sub_block_desc
,
param
.
input_data_names
,
param
.
output_data_names
,
...
...
lite/kernels/npu/subgraph_compute.h
浏览文件 @
1e10b471
...
...
@@ -29,13 +29,14 @@ namespace npu {
class
SubgraphEngine
:
public
subgraph
::
Engine
{
public:
SubgraphEngine
(
int
block_idx
,
SubgraphEngine
(
KernelContext
*
ctx
,
int
block_idx
,
cpp
::
BlockDesc
*
block_desc
,
const
std
::
vector
<
std
::
string
>
&
input_names
,
const
std
::
vector
<
std
::
string
>
&
output_names
,
Scope
*
scope
)
:
subgraph
::
Engine
(
block_idx
,
block_desc
,
input_names
,
output_names
,
scope
)
{}
ctx
,
block_idx
,
block_desc
,
input_names
,
output_names
,
scope
)
{}
protected:
int
BuildDeviceProgram
()
override
;
...
...
lite/kernels/xpu/subgraph_compute.cc
浏览文件 @
1e10b471
...
...
@@ -197,7 +197,8 @@ int SubgraphEngine::LaunchDeviceProgram() {
void
SubgraphCompute
::
PrepareForRun
()
{
auto
&
param
=
this
->
Param
<
param_t
>
();
engine_
.
reset
(
new
SubgraphEngine
(
param
.
sub_block_idx
,
engine_
.
reset
(
new
SubgraphEngine
(
ctx_
.
get
(),
param
.
sub_block_idx
,
param
.
sub_block_desc
,
param
.
input_data_names
,
param
.
output_data_names
,
...
...
lite/kernels/xpu/subgraph_compute.h
浏览文件 @
1e10b471
...
...
@@ -29,13 +29,14 @@ namespace xpu {
class
SubgraphEngine
:
public
subgraph
::
Engine
{
public:
SubgraphEngine
(
int
block_idx
,
SubgraphEngine
(
KernelContext
*
ctx
,
int
block_idx
,
cpp
::
BlockDesc
*
block_desc
,
const
std
::
vector
<
std
::
string
>
&
input_names
,
const
std
::
vector
<
std
::
string
>
&
output_names
,
Scope
*
scope
)
:
subgraph
::
Engine
(
block_idx
,
block_desc
,
input_names
,
output_names
,
scope
)
{}
ctx
,
block_idx
,
block_desc
,
input_names
,
output_names
,
scope
)
{}
protected:
int
BuildDeviceProgram
()
override
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录