Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
41f776b8
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看板
提交
41f776b8
编写于
3月 28, 2019
作者:
J
jameswu2014
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
anchor_generator+version
上级
8924f226
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
28 addition
and
4 deletion
+28
-4
src/fpga/V1/api.cpp
src/fpga/V1/api.cpp
+1
-1
src/fpga/V1/pe.cpp
src/fpga/V1/pe.cpp
+9
-1
src/fpga/common/fpga_common.cpp
src/fpga/common/fpga_common.cpp
+3
-2
src/operators/kernel/fpga/V1/anchor_generator_kernel.cpp
src/operators/kernel/fpga/V1/anchor_generator_kernel.cpp
+15
-0
未找到文件。
src/fpga/V1/api.cpp
浏览文件 @
41f776b8
...
...
@@ -207,7 +207,7 @@ void format_DWDconv_filter(framework::Tensor *filter_tensor, float *scale_ptr,
// framework::make_ddim({num, 1, height, width});
// filter_tensor->Resize(dims_new);
filter_tensor
->
reset_data_ptr
(
new_data
);
filter_tensor
->
set_type
(
typeid
(
int
8
_t
));
filter_tensor
->
set_type
(
typeid
(
int
16
_t
));
}
void
format_fc_filter
(
framework
::
Tensor
*
filter_tensor
,
float
max_value
)
{
...
...
src/fpga/V1/pe.cpp
浏览文件 @
41f776b8
...
...
@@ -19,6 +19,7 @@ limitations under the License. */
#include "fpga/V1/image.h"
#include "fpga/common/config.h"
#include "fpga/common/driver.h"
#include "fpga/common/fpga_common.h"
#ifdef COST_TIME_PRINT
#include <sys/time.h>
#include <time.h>
...
...
@@ -253,7 +254,14 @@ int ComputeBasicConv(const struct ConvArgs &args) {
reg_writeq
(
((
uint64_t
)
args
.
kernel
.
height
)
|
(((
uint64_t
)
args
.
kernel
.
width
)
<<
32
),
REG_CONV_FILTER_PIXEL
);
reg_writeq
(
args
.
driver
.
output_height
|
(
args
.
driver
.
output_width
<<
32
),
uint64_t
output_height_fraction
=
args
.
driver
.
output_height
/
ROW_PARALLEL_NUM
;
uint64_t
output_height_remainder
=
args
.
driver
.
output_height
%
ROW_PARALLEL_NUM
;
reg_writeq
(
args
.
driver
.
output_height
|
(
output_height_fraction
<<
16
)
|
(
output_height_remainder
<<
26
)
|
(
args
.
driver
.
output_width
<<
32
),
REG_CONV_RESULT_PIXEL
);
reg_writeq
(((
uint64_t
)
args
.
image
.
pad_height
)
|
(((
uint64_t
)
args
.
image
.
pad_width
)
<<
32
),
...
...
src/fpga/common/fpga_common.cpp
浏览文件 @
41f776b8
...
...
@@ -15,6 +15,7 @@ limitations under the License. */
#include "fpga/common/fpga_common.h"
#include <algorithm>
#include <map>
#include <utility>
#include "fpga/common/config.h"
#include "fpga/common/driver.h"
...
...
@@ -199,8 +200,8 @@ uint64_t vaddr_to_paddr(void *address) {
}
uint32_t
paddle_mobile_version
()
{
uint32_t
v_master
=
3
4
;
uint32_t
v_slave
=
3
4
;
uint32_t
v_master
=
3
5
;
uint32_t
v_slave
=
3
5
;
uint32_t
first
=
1
,
second
=
2
,
fourth_master
=
1
,
fourth_slave
=
2
;
uint32_t
master
=
first
<<
24
|
second
<<
16
|
v_master
<<
8
|
fourth_master
;
...
...
src/operators/kernel/fpga/V1/anchor_generator_kernel.cpp
浏览文件 @
41f776b8
...
...
@@ -14,6 +14,9 @@ limitations under the License. */
#ifdef ANCHOR_GENERATOR_OP
#include <string.h>
#include <iostream>
#include <utility>
#include <vector>
#include "operators/kernel/detection_kernel.h"
...
...
@@ -29,11 +32,23 @@ bool AnchorGeneratorKernel<FPGA, float>::Init(
auto
stride
=
param
->
stride_
;
auto
feature_width
=
input
->
dims
()[
3
],
feature_height
=
input
->
dims
()[
2
];
auto
stride_width
=
stride
[
0
],
stride_height
=
stride
[
1
];
auto
offset
=
param
->
offset_
;
int
anchors_offset
[]
=
{
-
2
,
-
2
,
18
,
18
,
-
10
,
-
9
,
26
,
25
,
-
23
,
-
20
,
39
,
36
,
-
43
,
-
34
,
59
,
49
,
-
63
,
-
54
,
79
,
69
,
-
96
,
-
77
,
112
,
93
,
-
137
,
-
118
,
153
,
134
,
-
204
,
-
188
,
220
,
204
,
-
281
,
-
395
,
296
,
441
};
int
anchors_offset2
[]
=
{
0
,
0
,
51
,
77
,
0
,
0
,
30
,
35
,
0
,
0
,
81
,
103
,
0
,
0
,
20
,
21
,
0
,
0
,
36
,
44
,
0
,
0
,
43
,
58
,
0
,
0
,
34
,
68
,
0
,
0
,
24
,
28
,
0
,
0
,
19
,
46
};
if
(
offset
>
0.6
)
{
memcpy
(
anchors_offset
,
anchors_offset2
,
sizeof
(
anchors_offset
));
std
::
cout
<<
"anchor generator marker"
<<
std
::
endl
;
}
else
{
std
::
cout
<<
"anchor generator rfcn"
<<
std
::
endl
;
}
int
num_anchors
=
sizeof
(
anchors_offset
)
/
(
sizeof
(
int
)
*
4
);
// DLOG << "feature_height: " << feature_height;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录