Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
f03217b4
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看板
提交
f03217b4
编写于
9月 25, 2019
作者:
X
Xiaoyang LI
提交者:
Yan Chunwei
9月 25, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add workspace compute funcs for direct conv, test=develop (#2132)
上级
4de0f778
变更
7
展开全部
显示空白变更内容
内联
并排
Showing
7 changed file
with
924 addition
and
1518 deletion
+924
-1518
lite/backends/arm/math/conv3x3s1_direct_fp32.cc
lite/backends/arm/math/conv3x3s1_direct_fp32.cc
+442
-714
lite/backends/arm/math/conv3x3s2_direct_fp32.cc
lite/backends/arm/math/conv3x3s2_direct_fp32.cc
+444
-799
lite/backends/arm/math/conv_impl.h
lite/backends/arm/math/conv_impl.h
+6
-0
lite/core/device_info.cc
lite/core/device_info.cc
+4
-4
lite/core/device_info.h
lite/core/device_info.h
+1
-1
lite/kernels/arm/conv_direct.cc
lite/kernels/arm/conv_direct.cc
+25
-0
lite/kernels/arm/conv_direct.h
lite/kernels/arm/conv_direct.h
+2
-0
未找到文件。
lite/backends/arm/math/conv3x3s1_direct_fp32.cc
浏览文件 @
f03217b4
此差异已折叠。
点击以展开。
lite/backends/arm/math/conv3x3s2_direct_fp32.cc
浏览文件 @
f03217b4
此差异已折叠。
点击以展开。
lite/backends/arm/math/conv_impl.h
浏览文件 @
f03217b4
...
...
@@ -23,6 +23,9 @@ namespace lite {
namespace
arm
{
namespace
math
{
/// conv 3x3s1
size_t
conv3x3s1_direct_workspace_size
(
const
operators
::
ConvParam
&
param
,
ARMContext
*
ctx
);
void
conv_3x3s1_direct_fp32
(
const
float
*
din
,
float
*
dout
,
int
num
,
...
...
@@ -53,6 +56,9 @@ void conv_3x3s1_direct_int8(const int8_t* din,
ARMContext
*
ctx
,
const
float
*
scale
);
/// conv3x3s2
size_t
conv3x3s2_direct_workspace_size
(
const
operators
::
ConvParam
&
param
,
ARMContext
*
ctx
);
void
conv_3x3s2_direct_fp32
(
const
float
*
din
,
float
*
dout
,
int
num
,
...
...
lite/core/device_info.cc
浏览文件 @
f03217b4
...
...
@@ -1104,13 +1104,13 @@ void DeviceInfo::SetCache(int l1size, int l2size, int l3size) {
SetCacheInfo
(
0
,
1
,
l1size
);
SetCacheInfo
(
1
,
1
,
l2size
);
SetCacheInfo
(
2
,
1
,
l3size
);
workspace_
.
Resize
({
2
*
(
l1size
+
l2size
)});
workspace_
.
Resize
({
llc_size
()});
workspace_
.
mutable_data
<
int8_t
>
();
}
bool
DeviceInfo
::
ExtendWorkspace
(
in
t
size
)
{
bool
DeviceInfo
::
ExtendWorkspace
(
size_
t
size
)
{
workspace_
.
Resize
({
size
+
llc_size
()});
workspace_
.
mutable_data
<
int8_t
>
();
return
true
;
return
workspace_
.
mutable_data
<
int8_t
>
()
!=
nullptr
;
}
#endif // LITE_WITH_ARM
...
...
lite/core/device_info.h
浏览文件 @
f03217b4
...
...
@@ -73,7 +73,7 @@ class DeviceInfo {
T
*
workspace_data
()
{
return
reinterpret_cast
<
T
*>
(
workspace_
.
mutable_data
<
int8_t
>
());
}
bool
ExtendWorkspace
(
in
t
size
);
bool
ExtendWorkspace
(
size_
t
size
);
private:
int
core_num_
;
...
...
lite/kernels/arm/conv_direct.cc
浏览文件 @
f03217b4
...
...
@@ -19,6 +19,25 @@ namespace lite {
namespace
kernels
{
namespace
arm
{
template
<
>
void
DirectConv
<
PRECISION
(
kFloat
),
PRECISION
(
kFloat
)
>::
ReInitWhenNeeded
()
{
auto
&
param
=
this
->
template
Param
<
param_t
>();
auto
x_dims
=
param
.
x
->
dims
();
auto
w_dims
=
param
.
filter
->
dims
();
auto
o_dims
=
param
.
output
->
dims
();
if
(
last_shape_
==
x_dims
)
{
return
;
}
auto
&
ctx
=
this
->
ctx_
->
template
As
<
ARMContext
>();
if
(
param
.
strides
[
0
]
==
2
)
{
ctx
.
ExtendWorkspace
(
lite
::
arm
::
math
::
conv3x3s2_direct_workspace_size
(
param
,
&
ctx
));
}
else
{
ctx
.
ExtendWorkspace
(
lite
::
arm
::
math
::
conv3x3s1_direct_workspace_size
(
param
,
&
ctx
));
}
}
template
<
>
void
DirectConv
<
PRECISION
(
kFloat
),
PRECISION
(
kFloat
)
>::
Run
()
{
auto
&
param
=
this
->
Param
<
param_t
>
();
...
...
@@ -70,6 +89,9 @@ void DirectConv<PRECISION(kFloat), PRECISION(kFloat)>::Run() {
}
}
template
<
>
void
DirectConv
<
PRECISION
(
kInt8
),
PRECISION
(
kFloat
)
>::
ReInitWhenNeeded
()
{}
template
<
>
void
DirectConv
<
PRECISION
(
kInt8
),
PRECISION
(
kFloat
)
>::
Run
()
{
auto
&
param
=
this
->
Param
<
param_t
>
();
...
...
@@ -126,6 +148,9 @@ void DirectConv<PRECISION(kInt8), PRECISION(kFloat)>::Run() {
}
}
template
<
>
void
DirectConv
<
PRECISION
(
kInt8
),
PRECISION
(
kInt8
)
>::
ReInitWhenNeeded
()
{}
template
<
>
void
DirectConv
<
PRECISION
(
kInt8
),
PRECISION
(
kInt8
)
>::
Run
()
{
auto
&
param
=
this
->
Param
<
param_t
>
();
...
...
lite/kernels/arm/conv_direct.h
浏览文件 @
f03217b4
...
...
@@ -178,10 +178,12 @@ class DirectConv : public KernelLite<TARGET(kARM), Ptype> {
w_scale_
);
}
virtual
void
ReInitWhenNeeded
();
virtual
void
Run
();
/// todo, support inplace weights transform
protected:
DDim
last_shape_
;
Tensor
weights_
;
Tensor
bias_
;
bool
flag_trans_weights_
{
false
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录