Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
c2be5da3
P
Paddle
项目概览
机器未来
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c2be5da3
编写于
6月 24, 2019
作者:
开心的小妮
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[LITE][CI] Enable android armv7 CI, Fix mul, fc bug
上级
57e66daa
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
27 addition
and
21 deletion
+27
-21
paddle/fluid/lite/kernels/arm/fc_compute.cc
paddle/fluid/lite/kernels/arm/fc_compute.cc
+7
-1
paddle/fluid/lite/kernels/arm/mul_compute.cc
paddle/fluid/lite/kernels/arm/mul_compute.cc
+16
-12
paddle/fluid/lite/kernels/arm/mul_compute.h
paddle/fluid/lite/kernels/arm/mul_compute.h
+3
-0
paddle/fluid/lite/tools/build.sh
paddle/fluid/lite/tools/build.sh
+1
-8
未找到文件。
paddle/fluid/lite/kernels/arm/fc_compute.cc
浏览文件 @
c2be5da3
...
@@ -13,10 +13,10 @@
...
@@ -13,10 +13,10 @@
// limitations under the License.
// limitations under the License.
#include "paddle/fluid/lite/kernels/arm/fc_compute.h"
#include "paddle/fluid/lite/kernels/arm/fc_compute.h"
#include <vector>
#include "paddle/fluid/lite/arm/math/funcs.h"
#include "paddle/fluid/lite/arm/math/funcs.h"
#include "paddle/fluid/lite/core/op_registry.h"
#include "paddle/fluid/lite/core/op_registry.h"
#include "paddle/fluid/lite/core/type_system.h"
#include "paddle/fluid/lite/core/type_system.h"
namespace
paddle
{
namespace
paddle
{
namespace
lite
{
namespace
lite
{
namespace
kernels
{
namespace
kernels
{
...
@@ -53,6 +53,12 @@ void FcCompute::PrepareForRun() {
...
@@ -53,6 +53,12 @@ void FcCompute::PrepareForRun() {
}
}
}
}
}
}
if
(
m_
>
1
)
{
int
hblock
=
lite
::
arm
::
math
::
get_hblock
(
ctx
.
arch
());
int
m_round
=
hblock
*
((
m_
+
hblock
-
1
)
/
hblock
);
ctx
.
ExtendWorkspace
(
DDimLite
(
std
::
vector
<
int64_t
>
({
m_round
*
k_
})));
}
}
}
void
FcCompute
::
Run
()
{
void
FcCompute
::
Run
()
{
...
...
paddle/fluid/lite/kernels/arm/mul_compute.cc
浏览文件 @
c2be5da3
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
// limitations under the License.
// limitations under the License.
#include "paddle/fluid/lite/kernels/arm/mul_compute.h"
#include "paddle/fluid/lite/kernels/arm/mul_compute.h"
#include <vector>
#include "paddle/fluid/lite/arm/math/funcs.h"
#include "paddle/fluid/lite/arm/math/funcs.h"
#include "paddle/fluid/lite/core/op_registry.h"
#include "paddle/fluid/lite/core/op_registry.h"
#include "paddle/fluid/lite/core/type_system.h"
#include "paddle/fluid/lite/core/type_system.h"
...
@@ -33,7 +34,7 @@ void MulCompute::Run() {
...
@@ -33,7 +34,7 @@ void MulCompute::Run() {
const
auto
*
y_data
=
param
.
y
->
data
<
float
>
();
const
auto
*
y_data
=
param
.
y
->
data
<
float
>
();
auto
*
o_data
=
param
.
output
->
mutable_data
<
float
>
();
auto
*
o_data
=
param
.
output
->
mutable_data
<
float
>
();
int
m
=
static_cast
<
int
>
(
m_
=
static_cast
<
int
>
(
param
.
x
->
dims
().
Slice
(
0
,
param
.
x_num_col_dims
).
production
());
param
.
x
->
dims
().
Slice
(
0
,
param
.
x_num_col_dims
).
production
());
int
x_w
=
int
x_w
=
static_cast
<
int
>
(
param
.
x
->
dims
()
static_cast
<
int
>
(
param
.
x
->
dims
()
...
@@ -41,26 +42,29 @@ void MulCompute::Run() {
...
@@ -41,26 +42,29 @@ void MulCompute::Run() {
.
production
());
.
production
());
int
y_h
=
static_cast
<
int
>
(
int
y_h
=
static_cast
<
int
>
(
param
.
y
->
dims
().
Slice
(
0
,
param
.
y_num_col_dims
).
production
());
param
.
y
->
dims
().
Slice
(
0
,
param
.
y_num_col_dims
).
production
());
int
n
=
n_
=
static_cast
<
int
>
(
param
.
y
->
dims
()
static_cast
<
int
>
(
param
.
y
->
dims
()
.
Slice
(
param
.
y_num_col_dims
,
param
.
y
->
dims
().
size
())
.
Slice
(
param
.
y_num_col_dims
,
param
.
y
->
dims
().
size
())
.
production
());
.
production
());
CHECK_EQ
(
x_w
,
y_h
)
<<
"x_w must be equal with y_h"
;
CHECK_EQ
(
x_w
,
y_h
)
<<
"x_w must be equal with y_h"
;
auto
k
=
x_w
;
k_
=
x_w
;
if
(
n
==
1
)
{
lite
::
arm
::
math
::
sgemv
(
x_data
,
y_data
,
o_data
,
false
,
m
,
k
,
false
,
nullptr
,
if
(
n_
==
1
)
{
false
);
lite
::
arm
::
math
::
sgemv
(
x_data
,
y_data
,
o_data
,
false
,
m_
,
k_
,
false
,
nullptr
,
false
);
}
else
{
}
else
{
constexpr
bool
is_tranposed_y
=
false
;
constexpr
bool
is_tranposed_y
=
false
;
auto
&
ctx
=
this
->
ctx_
->
template
As
<
ARMContext
>();
auto
&
ctx
=
this
->
ctx_
->
template
As
<
ARMContext
>();
int
hblock
=
lite
::
arm
::
math
::
get_hblock
(
ctx
.
arch
());
int
m_round
=
hblock
*
((
m_
+
hblock
-
1
)
/
hblock
);
ctx
.
ExtendWorkspace
(
DDimLite
(
std
::
vector
<
int64_t
>
({
m_round
*
k_
})));
float
*
packed_x
=
static_cast
<
float
*>
(
ctx
.
workspace_data
<
float
>
())
+
float
*
packed_x
=
static_cast
<
float
*>
(
ctx
.
workspace_data
<
float
>
())
+
ctx
.
l2_cache_size
()
/
sizeof
(
float
);
ctx
.
l2_cache_size
()
/
sizeof
(
float
);
lite
::
arm
::
math
::
prepackA
(
packed_x
,
x_data
,
k
,
0
,
m
,
0
,
k
,
false
,
&
ctx
);
lite
::
arm
::
math
::
prepackA
(
packed_x
,
x_data
,
k
_
,
0
,
m_
,
0
,
k_
,
false
,
&
ctx
);
lite
::
arm
::
math
::
sgemm_prepack
(
packed_x
,
y_data
,
nullptr
,
o_data
,
m
,
n
,
k
,
lite
::
arm
::
math
::
sgemm_prepack
(
packed_x
,
y_data
,
nullptr
,
o_data
,
m
_
,
n_
,
false
,
false
,
is_tranposed_y
,
&
ctx
);
k_
,
false
,
false
,
is_tranposed_y
,
&
ctx
);
}
}
}
}
...
...
paddle/fluid/lite/kernels/arm/mul_compute.h
浏览文件 @
c2be5da3
...
@@ -31,6 +31,9 @@ class MulCompute : public KernelLite<TARGET(kARM), PRECISION(kFloat)> {
...
@@ -31,6 +31,9 @@ class MulCompute : public KernelLite<TARGET(kARM), PRECISION(kFloat)> {
void
Run
()
override
;
void
Run
()
override
;
virtual
~
MulCompute
()
=
default
;
virtual
~
MulCompute
()
=
default
;
private:
int
m_
,
n_
,
k_
;
};
};
}
// namespace arm
}
// namespace arm
...
...
paddle/fluid/lite/tools/build.sh
浏览文件 @
c2be5da3
...
@@ -246,14 +246,7 @@ function test_arm {
...
@@ -246,14 +246,7 @@ function test_arm {
echo
"android do not need armv7hf"
echo
"android do not need armv7hf"
return
0
return
0
fi
fi
# TODO(yuanshuai): enable armv7 on android
if
[[
${
abi
}
==
"armv7"
]]
;
then
echo
"skip android v7 test yet"
return
0
fi
echo
"test file:
${
TESTS_FILE
}
"
echo
"test file:
${
TESTS_FILE
}
"
for
_test
in
$(
cat
$TESTS_FILE
)
;
do
for
_test
in
$(
cat
$TESTS_FILE
)
;
do
test_arm_android
$_test
$port
test_arm_android
$_test
$port
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录