Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
678ee306
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看板
提交
678ee306
编写于
12月 06, 2019
作者:
qnqinan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix a bug in ewadd in FPGA v2, test=mobile
上级
c6c1d514
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
6 addition
and
5 deletion
+6
-5
mobile/src/fpga/V2/pe.cpp
mobile/src/fpga/V2/pe.cpp
+2
-1
mobile/src/operators/kernel/fpga/V2/elementwise_add_kernel.cpp
...e/src/operators/kernel/fpga/V2/elementwise_add_kernel.cpp
+2
-2
mobile/src/operators/kernel/fpga/V2/elementwise_add_relu_kernel.cpp
.../operators/kernel/fpga/V2/elementwise_add_relu_kernel.cpp
+2
-2
未找到文件。
mobile/src/fpga/V2/pe.cpp
浏览文件 @
678ee306
...
@@ -534,7 +534,8 @@ uint64_t bypass_interrupt = reg_readq(REG_INTERRUPT);
...
@@ -534,7 +534,8 @@ uint64_t bypass_interrupt = reg_readq(REG_INTERRUPT);
(((
uint64_t
)
args
.
image0
.
height
*
2
)
<<
32
);
(((
uint64_t
)
args
.
image0
.
height
*
2
)
<<
32
);
uint64_t
image_row_col_padding_down
=
image_amount_per_row
|
uint64_t
image_row_col_padding_down
=
image_amount_per_row
|
(
image_amount_per_row
<<
32
);
(
image_amount_per_row
<<
32
);
float
quantParam
=
(
args
.
output
.
scale_address
)[
0
];
float
quantParam
=
((
args
.
image0
.
scale_address
)[
0
])
/
((
args
.
output
.
scale_address
)[
0
]);
uint32_t
*
ew_scale
=
reinterpret_cast
<
uint32_t
*>
(
&
quantParam
);
uint32_t
*
ew_scale
=
reinterpret_cast
<
uint32_t
*>
(
&
quantParam
);
uint64_t
ew_scale_mult_factor
=
(
*
ew_scale
)
|
uint64_t
ew_scale_mult_factor
=
(
*
ew_scale
)
|
((
uint64_t
)
args
.
const0
<<
32
)
|
((
uint64_t
)
args
.
const1
<<
40
);
((
uint64_t
)
args
.
const0
<<
32
)
|
((
uint64_t
)
args
.
const1
<<
40
);
...
...
mobile/src/operators/kernel/fpga/V2/elementwise_add_kernel.cpp
浏览文件 @
678ee306
...
@@ -33,8 +33,8 @@ bool ElementwiseAddKernel<FPGA, float>::Init(ElementwiseAddParam<FPGA> *param) {
...
@@ -33,8 +33,8 @@ bool ElementwiseAddKernel<FPGA, float>::Init(ElementwiseAddParam<FPGA> *param) {
float
C1
=
Si_1
/
So
;
float
C1
=
Si_1
/
So
;
float
C2
=
Si_2
/
So
;
float
C2
=
Si_2
/
So
;
fpga
::
EWAddArgs
ewaddArgs
=
{
0
};
fpga
::
EWAddArgs
ewaddArgs
=
{
0
};
ewaddArgs
.
const0
=
fpga
::
fp32_2_fp16
(
C1
)
;
ewaddArgs
.
const0
=
1
;
ewaddArgs
.
const1
=
fpga
::
fp32_2_fp16
(
C2
)
;
ewaddArgs
.
const1
=
1
;
ewaddArgs
.
relu_enabled
=
0
;
ewaddArgs
.
relu_enabled
=
0
;
ewaddArgs
.
image0
.
address
=
input_x_ptr
;
ewaddArgs
.
image0
.
address
=
input_x_ptr
;
ewaddArgs
.
image0
.
channels
=
(
uint32_t
)
input_x
->
dims
()[
1
];
ewaddArgs
.
image0
.
channels
=
(
uint32_t
)
input_x
->
dims
()[
1
];
...
...
mobile/src/operators/kernel/fpga/V2/elementwise_add_relu_kernel.cpp
浏览文件 @
678ee306
...
@@ -35,8 +35,8 @@ bool ElementwiseAddReluKernel<FPGA, float>::Init(
...
@@ -35,8 +35,8 @@ bool ElementwiseAddReluKernel<FPGA, float>::Init(
float
C2
=
Si_2
/
So
;
float
C2
=
Si_2
/
So
;
fpga
::
EWAddArgs
ewaddArgs
=
{
0
};
fpga
::
EWAddArgs
ewaddArgs
=
{
0
};
ewaddArgs
.
relu_enabled
=
1
;
ewaddArgs
.
relu_enabled
=
1
;
ewaddArgs
.
const0
=
fpga
::
fp32_2_fp16
(
C1
)
;
ewaddArgs
.
const0
=
1
;
ewaddArgs
.
const1
=
fpga
::
fp32_2_fp16
(
C2
)
;
ewaddArgs
.
const1
=
1
;
ewaddArgs
.
image0
.
address
=
input_x_ptr
;
ewaddArgs
.
image0
.
address
=
input_x_ptr
;
ewaddArgs
.
image0
.
channels
=
(
uint32_t
)
input_x
->
dims
()[
1
];
ewaddArgs
.
image0
.
channels
=
(
uint32_t
)
input_x
->
dims
()[
1
];
ewaddArgs
.
image0
.
scale_address
=
input_x
->
scale
;
ewaddArgs
.
image0
.
scale_address
=
input_x
->
scale
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录