Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
d1bef473
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
d1bef473
编写于
6月 29, 2019
作者:
开心的小妮
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[LITE][ARM] Remove Eigen deps of ARM
上级
42f25806
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
65 addition
and
8 deletion
+65
-8
paddle/fluid/lite/arm/math/CMakeLists.txt
paddle/fluid/lite/arm/math/CMakeLists.txt
+1
-1
paddle/fluid/lite/core/CMakeLists.txt
paddle/fluid/lite/core/CMakeLists.txt
+5
-0
paddle/fluid/lite/kernels/arm/fc_compute_test.cc
paddle/fluid/lite/kernels/arm/fc_compute_test.cc
+33
-4
paddle/fluid/lite/kernels/arm/mul_compute_test.cc
paddle/fluid/lite/kernels/arm/mul_compute_test.cc
+26
-3
未找到文件。
paddle/fluid/lite/arm/math/CMakeLists.txt
浏览文件 @
d1bef473
...
...
@@ -78,5 +78,5 @@ if (NOT HAS_ARM_MATH_LIB_DIR)
gemv_arm_int8.cc
conv3x3s1_direct_int8.cc
conv3x3s2_direct_int8.cc
DEPS
${
lite_kernel_deps
}
eigen3
framework_proto_lite)
DEPS
${
lite_kernel_deps
}
framework_proto_lite)
endif()
paddle/fluid/lite/core/CMakeLists.txt
浏览文件 @
d1bef473
...
...
@@ -29,7 +29,12 @@ endif()
lite_cc_library
(
op_registry_lite SRCS op_registry.cc DEPS framework_proto_lite
)
lite_cc_library
(
scope_lite SRCS scope.cc DEPS
${
tensor_lite
}
)
lite_cc_library
(
cpu_info_lite SRCS cpu_info.cc
)
if
(
LITE_WITH_ARM
)
lite_cc_library
(
context_lite SRCS context.cc DEPS
${
tensor_lite
}
any_lite cpu_info_lite CL_DEPS cl_helper
)
else
()
lite_cc_library
(
context_lite SRCS context.cc DEPS
${
tensor_lite
}
any_lite cpu_info_lite eigen3 CL_DEPS cl_helper
)
endif
()
lite_cc_library
(
kernel_lite SRCS kernel.cc DEPS context_lite type_system target_wrapper_lite any_lite op_params_lite framework_proto_lite
${
tensor_lite
}
)
lite_cc_library
(
op_lite SRCS op_lite.cc DEPS scope_lite op_registry_lite target_wrapper_lite kernel_lite
cpp_op_desc_lite
${
tensor_lite
}
)
...
...
paddle/fluid/lite/kernels/arm/fc_compute_test.cc
浏览文件 @
d1bef473
...
...
@@ -28,6 +28,35 @@ namespace lite {
namespace
kernels
{
namespace
arm
{
#define A(i, j) a[i * lda + j]
#define B(i, j) b[i * ldb + j]
#define C(i, j) c[i * ldc + j]
template
<
typename
T
>
void
gemm_bias
(
const
T
*
a
,
const
int
M
,
const
int
K
,
const
T
*
b
,
const
int
K_
,
const
int
N
,
T
*
biases
,
T
*
c
)
{
EXPECT_TRUE
(
K_
==
K
&&
M
>
0
&&
N
>
0
&&
K
>
0
);
EXPECT_TRUE
(
a
&&
b
&&
c
);
const
int
lda
=
K
;
const
int
ldb
=
N
;
const
int
ldc
=
N
;
for
(
int
m
=
0
;
m
<
M
;
++
m
)
{
for
(
int
n
=
0
;
n
<
N
;
++
n
)
{
C
(
m
,
n
)
=
0.0
f
;
for
(
int
k
=
0
;
k
<
K
;
++
k
)
{
C
(
m
,
n
)
+=
A
(
m
,
k
)
*
B
(
k
,
n
);
}
}
}
if
(
biases
)
{
for
(
int
m
=
0
;
m
<
M
;
++
m
)
{
for
(
int
n
=
0
;
n
<
N
;
++
n
)
{
C
(
m
,
n
)
+=
biases
[
n
];
}
}
}
}
template
<
typename
T
>
void
FillData
(
T
*
a
,
const
int
n
,
const
T
lower
=
static_cast
<
T
>
(
-
2.
f
),
const
T
upper
=
static_cast
<
T
>
(
2.
f
))
{
...
...
@@ -103,8 +132,8 @@ TEST(fc_arm, compare_test) {
fc
.
PrepareForRun
();
fc
.
Run
();
lite
::
arm
::
math
::
fc_compute_eigen
(
x_data
,
m
,
k
,
w_data
,
k
,
n
,
b_data
,
ref_data
);
gemm_bias
<
T
>
(
x_data
,
m
,
k
,
w_data
,
k
,
n
,
b_data
,
ref_data
);
for
(
int
i
=
0
;
i
<
out
.
dims
().
production
();
i
++
)
{
EXPECT_NEAR
(
out_data
[
i
],
ref_data
[
i
],
1e-3
);
}
...
...
@@ -158,8 +187,8 @@ TEST(fc_arm, num_col_dims) {
fc
.
PrepareForRun
();
fc
.
Run
();
lite
::
arm
::
math
::
fc_compute_eigen
(
x_data
,
2
,
3
,
w_data
,
3
,
4
,
b_data
,
ref_data
);
gemm_bias
<
T
>
(
x_data
,
2
,
3
,
w_data
,
3
,
4
,
b_data
,
ref_data
);
for
(
int
i
=
0
;
i
<
out
.
dims
().
production
();
i
++
)
{
EXPECT_NEAR
(
out_data
[
i
],
ref_data
[
i
],
1e-3
);
}
...
...
paddle/fluid/lite/kernels/arm/mul_compute_test.cc
浏览文件 @
d1bef473
...
...
@@ -28,6 +28,28 @@ namespace lite {
namespace
kernels
{
namespace
arm
{
#define A(i, j) a[i * lda + j]
#define B(i, j) b[i * ldb + j]
#define C(i, j) c[i * ldc + j]
template
<
typename
T
>
void
mul_gemm
(
const
T
*
a
,
const
int
M
,
const
int
K
,
const
T
*
b
,
const
int
K_
,
const
int
N
,
T
*
c
)
{
EXPECT_TRUE
(
K_
==
K
&&
M
>
0
&&
N
>
0
&&
K
>
0
);
EXPECT_TRUE
(
a
&&
b
&&
c
);
const
int
lda
=
K
;
const
int
ldb
=
N
;
const
int
ldc
=
N
;
for
(
int
m
=
0
;
m
<
M
;
++
m
)
{
for
(
int
n
=
0
;
n
<
N
;
++
n
)
{
C
(
m
,
n
)
=
0.0
f
;
for
(
int
k
=
0
;
k
<
K
;
++
k
)
{
C
(
m
,
n
)
+=
A
(
m
,
k
)
*
B
(
k
,
n
);
}
}
}
}
template
<
typename
T
>
void
FillData
(
T
*
a
,
const
int
n
,
const
T
lower
=
static_cast
<
T
>
(
-
2.
f
),
const
T
upper
=
static_cast
<
T
>
(
2.
f
))
{
...
...
@@ -91,8 +113,8 @@ TEST(mul_arm, compare_test) {
mul
.
Run
();
lite
::
arm
::
math
::
mul_compute_eigen
(
x_data
,
m
,
k
,
y_data
,
k
,
n
,
ref_data
);
mul_gemm
<
T
>
(
x_data
,
m
,
k
,
y_data
,
k
,
n
,
ref_data
);
for
(
int
i
=
0
;
i
<
out
.
dims
().
production
();
i
++
)
{
EXPECT_NEAR
(
out_data
[
i
],
ref_data
[
i
],
1e-3
);
}
...
...
@@ -138,7 +160,8 @@ TEST(mul_arm, num_col_dims) {
mul
.
Run
();
lite
::
arm
::
math
::
mul_compute_eigen
(
x_data
,
2
,
12
,
y_data
,
12
,
5
,
ref_data
);
mul_gemm
<
T
>
(
x_data
,
2
,
12
,
y_data
,
12
,
5
,
ref_data
);
for
(
int
i
=
0
;
i
<
out
.
dims
().
production
();
i
++
)
{
EXPECT_NEAR
(
out_data
[
i
],
ref_data
[
i
],
1e-3
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录