Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
b5c14d86
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看板
提交
b5c14d86
编写于
8月 02, 2018
作者:
Z
zhangyang0701
提交者:
GitHub
8月 02, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #679 from chonwhite/develop
fix:
#678
上级
a74ccea0
207f5695
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
52 addition
and
30 deletion
+52
-30
src/fpga/api/fpga_api.cpp
src/fpga/api/fpga_api.cpp
+3
-3
src/fpga/api/fpga_api.h
src/fpga/api/fpga_api.h
+31
-9
src/operators/op_param.h
src/operators/op_param.h
+18
-18
未找到文件。
src/fpga/api/fpga_api.cpp
浏览文件 @
b5c14d86
...
...
@@ -58,9 +58,9 @@ void fpga_copy(void *dest, const void *src, size_t num) {
memcpy
(
dest
,
src
,
num
);
}
int
ComputeFpgaConv
(
struct
Fpga
ConvArgs
args
)
{}
int
ComputeFpgaPool
(
struct
FpgaPool
Args
args
)
{}
int
ComputeFpgaEWAdd
(
struct
Fpga
EWAddArgs
args
)
{}
int
ComputeFpgaConv
(
struct
ConvArgs
args
)
{}
int
ComputeFpgaPool
(
struct
Pooling
Args
args
)
{}
int
ComputeFpgaEWAdd
(
struct
EWAddArgs
args
)
{}
}
// namespace fpga
}
// namespace paddle_mobile
src/fpga/api/fpga_api.h
浏览文件 @
b5c14d86
...
...
@@ -58,7 +58,8 @@ struct KernelArgs {
};
struct
ImageInputArgs
{
void
*
address
;
// input featuremap virtual address
void
*
address
;
// input featuremap virtual address
float
*
scale_address
;
// input scale address;
uint32_t
channels
;
uint32_t
width
;
// featuremap width
uint32_t
height
;
...
...
@@ -73,29 +74,26 @@ struct ImageOutputArgs {
struct
ConvArgs
{
bool
relu_enabled
;
float
scale
;
// input scale;
void
*
bias_address
;
void
*
filter_address
;
uint32_t
filter_num
;
uint32_t
group_num
;
struct
BNArgs
bn
;
struct
KernelArgs
kernel
;
struct
ImageInputArgs
image
;
// input image;
struct
ImageOutputArgs
output
;
struct
KernelArgs
kernel
;
};
struct
PoolingArgs
{
float
scale
;
struct
KernelArgs
kernel
;
struct
ImageInputArgs
image
;
// input image;
struct
ImageOutputArgs
output
;
struct
KernelArgs
kernel
;
};
// elementwise add arguments
struct
EWAddArgs
{
bool
relu_enabled
;
float
scale
;
float
const0
;
// output0 = const0 x input0 + const1 x input1;
float
const1
;
...
...
@@ -130,11 +128,35 @@ struct FpgaRegReadArgs {
#define IOCTL_CONFIG_POOLING _IOW(IOCTL_FPGA_MAGIC, 22, struct PoolingArgs)
#define IOCTL_CONFIG_EW _IOW(IOCTL_FPGA_MAGIC, 23, struct EWAddArgs)
enum
FPGA_ERR_TYPE
{
ERR_IOCTL_CMD
=
-
1
,
ERR_TIMEOUT
=
-
2
,
ERR_COMPLETION_TIMEOUT
=
-
3
,
ERR_INVALID_FPGA_ADDR
=
-
4
,
ERR_NOMEM
=
-
5
,
ERR_NO_RESERVE_MEM
=
-
6
,
ERR_COPY_FROM_USER
=
-
7
,
ERR_COPY_TO_USER
=
-
8
,
ERR_DEL_TIMER
=
-
9
,
ERR_ENABLE_MSI
=
-
10
,
ERR_REGISTER_IRQ
=
-
11
,
ERR_PCIE_REGISTER
=
-
12
,
ERR_PCIE_PROBE
=
-
13
,
ERR_REGISTER_BLOCK
=
-
14
,
ERR_ALLOC_GENDISK
=
-
15
,
ERR_INIT_QUEUE
=
-
16
,
ERR_WAIT
=
-
17
,
ERR_ECC_ERROR
=
-
31
,
ERR_FPGA_FAIL_STOP
=
-
64
,
ERR_FPGA_DEBUG_STOP
=
-
113
,
DEV_TMP_UNAVAILABLE
=
-
128
};
//============================== API =============================
int
ComputeFpgaConv
(
struct
Fpga
ConvArgs
args
);
int
ComputeFpgaPool
(
struct
FpgaPool
Args
args
);
int
ComputeFpgaEWAdd
(
struct
Fpga
EWAddArgs
args
);
int
ComputeFpgaConv
(
struct
ConvArgs
args
);
int
ComputeFpgaPool
(
struct
Pooling
Args
args
);
int
ComputeFpgaEWAdd
(
struct
EWAddArgs
args
);
}
// namespace fpga
}
// namespace paddle_mobile
src/operators/op_param.h
浏览文件 @
b5c14d86
...
...
@@ -262,11 +262,11 @@ class ElementwiseAddParam : OpParam {
#ifdef PADDLE_MOBILE_FPGA
private:
fpga
::
Fpga
EWAddArgs
fpga_EW_add_args
;
fpga
::
EWAddArgs
fpga_EW_add_args
;
public:
const
fpga
::
Fpga
EWAddArgs
&
FpgaArgs
()
const
{
return
fpga_EW_add_args
;
}
void
SetFpgaArgs
(
const
fpga
::
Fpga
EWAddArgs
&
args
)
{
fpga_EW_add_args
=
args
;
}
const
fpga
::
EWAddArgs
&
FpgaArgs
()
const
{
return
fpga_EW_add_args
;
}
void
SetFpgaArgs
(
const
fpga
::
EWAddArgs
&
args
)
{
fpga_EW_add_args
=
args
;
}
#endif
};
...
...
@@ -465,11 +465,11 @@ class PoolParam : public OpParam {
#ifdef PADDLE_MOBILE_FPGA
private:
fpga
::
FpgaPool
Args
fpga_pool_args
;
fpga
::
Pooling
Args
fpga_pool_args
;
public:
const
fpga
::
FpgaPool
Args
&
FpgaArgs
()
const
{
return
fpga_pool_args
;
}
void
SetFpgaArgs
(
const
fpga
::
FpgaPool
Args
&
args
)
{
fpga_pool_args
=
args
;
}
const
fpga
::
Pooling
Args
&
FpgaArgs
()
const
{
return
fpga_pool_args
;
}
void
SetFpgaArgs
(
const
fpga
::
Pooling
Args
&
args
)
{
fpga_pool_args
=
args
;
}
#endif
};
#endif
...
...
@@ -933,11 +933,11 @@ class FusionFcParam : public OpParam {
#ifdef PADDLE_MOBILE_FPGA
private:
fpga
::
Fpga
ConvArgs
fpga_conv_args
;
fpga
::
ConvArgs
fpga_conv_args
;
public:
const
fpga
::
Fpga
ConvArgs
&
FpgaArgs
()
const
{
return
fpga_conv_args
;
}
void
SetFpgaArgs
(
const
fpga
::
Fpga
ConvArgs
&
args
)
{
fpga_conv_args
=
args
;
}
const
fpga
::
ConvArgs
&
FpgaArgs
()
const
{
return
fpga_conv_args
;
}
void
SetFpgaArgs
(
const
fpga
::
ConvArgs
&
args
)
{
fpga_conv_args
=
args
;
}
#endif
};
...
...
@@ -991,11 +991,11 @@ class FusionConvAddParam : public OpParam {
#ifdef PADDLE_MOBILE_FPGA
private:
fpga
::
Fpga
ConvArgs
fpga_conv_args
;
fpga
::
ConvArgs
fpga_conv_args
;
public:
const
fpga
::
Fpga
ConvArgs
&
FpgaArgs
()
const
{
return
fpga_conv_args
;
}
void
SetFpgaArgs
(
const
fpga
::
Fpga
ConvArgs
&
args
)
{
fpga_conv_args
=
args
;
}
const
fpga
::
ConvArgs
&
FpgaArgs
()
const
{
return
fpga_conv_args
;
}
void
SetFpgaArgs
(
const
fpga
::
ConvArgs
&
args
)
{
fpga_conv_args
=
args
;
}
#endif
};
...
...
@@ -1096,11 +1096,11 @@ class FusionConvAddBNReluParam : public OpParam {
#ifdef PADDLE_MOBILE_FPGA
private:
fpga
::
Fpga
ConvArgs
fpga_conv_args
;
fpga
::
ConvArgs
fpga_conv_args
;
public:
const
fpga
::
Fpga
ConvArgs
&
FpgaArgs
()
const
{
return
fpga_conv_args
;
}
void
SetFpgaArgs
(
const
fpga
::
Fpga
ConvArgs
&
args
)
{
fpga_conv_args
=
args
;
}
const
fpga
::
ConvArgs
&
FpgaArgs
()
const
{
return
fpga_conv_args
;
}
void
SetFpgaArgs
(
const
fpga
::
ConvArgs
&
args
)
{
fpga_conv_args
=
args
;
}
#endif
};
#endif
...
...
@@ -1190,11 +1190,11 @@ class FusionConvAddBNParam : public OpParam {
#ifdef PADDLE_MOBILE_FPGA
private:
fpga
::
Fpga
ConvArgs
fpga_conv_args
;
fpga
::
ConvArgs
fpga_conv_args
;
public:
const
fpga
::
Fpga
ConvArgs
&
FpgaArgs
()
const
{
return
fpga_conv_args
;
}
void
SetFpgaArgs
(
const
fpga
::
Fpga
ConvArgs
&
args
)
{
fpga_conv_args
=
args
;
}
const
fpga
::
ConvArgs
&
FpgaArgs
()
const
{
return
fpga_conv_args
;
}
void
SetFpgaArgs
(
const
fpga
::
ConvArgs
&
args
)
{
fpga_conv_args
=
args
;
}
#endif
};
#endif
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录