Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
3f56474f
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看板
提交
3f56474f
编写于
8月 25, 2019
作者:
J
jiweibo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test=develop pre-commit command to run clang-format
上级
9d70dd4d
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
27 addition
and
18 deletion
+27
-18
lite/api/light_api_impl.cc
lite/api/light_api_impl.cc
+1
-1
lite/api/paddle_api.h
lite/api/paddle_api.h
+8
-3
lite/api/paddle_place.h
lite/api/paddle_place.h
+6
-6
lite/core/cpu_info.cc
lite/core/cpu_info.cc
+3
-2
lite/tests/kernels/matmul_compute_test.cc
lite/tests/kernels/matmul_compute_test.cc
+6
-4
lite/tools/debug/model_debug_tool.cc
lite/tools/debug/model_debug_tool.cc
+2
-1
lite/utils/logging.h
lite/utils/logging.h
+1
-1
未找到文件。
lite/api/light_api_impl.cc
浏览文件 @
3f56474f
...
...
@@ -39,7 +39,7 @@ class LightPredictorImpl : public PaddlePredictor {
};
void
LightPredictorImpl
::
Init
(
const
MobileConfig
&
config
)
{
// LightPredictor Only support NaiveBuffer backend in publish lib
// LightPredictor Only support NaiveBuffer backend in publish lib
#ifdef LITE_WITH_ARM
lite
::
DeviceInfo
::
Init
();
lite
::
DeviceInfo
::
Global
().
SetRunMode
(
config
.
power_mode
(),
config
.
threads
());
...
...
lite/api/paddle_api.h
浏览文件 @
3f56474f
...
...
@@ -113,9 +113,14 @@ class LITE_API CxxConfig : public ConfigBase {
class
LITE_API
MobileConfig
:
public
ConfigBase
{
PowerMode
mode_
{
LITE_POWER_HIGH
};
int
threads_
{
1
};
public:
MobileConfig
(
Place
preferred_place
=
Place
(
TARGET
(
kARM
),
PRECISION
(
kFloat
),
DATALAYOUT
(
kNCHW
)),
PowerMode
mode
=
LITE_POWER_HIGH
,
int
threads
=
1
)
:
mode_
(
mode
),
threads_
(
threads
)
{}
public:
MobileConfig
(
Place
preferred_place
=
Place
(
TARGET
(
kARM
),
PRECISION
(
kFloat
),
DATALAYOUT
(
kNCHW
)),
PowerMode
mode
=
LITE_POWER_HIGH
,
int
threads
=
1
)
:
mode_
(
mode
),
threads_
(
threads
)
{}
void
set_power_mode
(
PowerMode
mode
)
{
mode_
=
mode
;
}
void
set_threads
(
int
threads
)
{
threads_
=
threads
;
}
...
...
lite/api/paddle_place.h
浏览文件 @
3f56474f
...
...
@@ -71,12 +71,12 @@ enum class DataLayoutType : int {
NUM
=
4
,
// number of fields.
};
typedef
enum
{
LITE_POWER_HIGH
=
0
,
LITE_POWER_LOW
=
1
,
LITE_POWER_FULL
=
2
,
LITE_POWER_NO_BIND
=
3
,
LITE_POWER_RAND_HIGH
=
4
,
LITE_POWER_RAND_LOW
=
5
LITE_POWER_HIGH
=
0
,
LITE_POWER_LOW
=
1
,
LITE_POWER_FULL
=
2
,
LITE_POWER_NO_BIND
=
3
,
LITE_POWER_RAND_HIGH
=
4
,
LITE_POWER_RAND_LOW
=
5
}
PowerMode
;
enum
class
ActivationType
:
int
{
...
...
lite/core/cpu_info.cc
浏览文件 @
3f56474f
...
...
@@ -827,7 +827,7 @@ void DeviceInfo::RequestPowerHighMode(int thread_num) {
int
little_core_size
=
little_core_ids_
.
size
();
active_ids_
.
clear
();
if
(
big_core_size
>
0
)
{
mode_
=
lite_api
::
PowerMode
::
LITE_POWER_HIGH
;
mode_
=
lite_api
::
PowerMode
::
LITE_POWER_HIGH
;
if
(
thread_num
>
big_core_size
)
{
LOG
(
ERROR
)
<<
"Request thread num: "
<<
thread_num
<<
", exceed the big cores size: "
<<
big_core_size
...
...
@@ -1031,7 +1031,8 @@ int DeviceInfo::Setup() {
}
LOG
(
INFO
)
<<
"Total memory: "
<<
mem_size_
<<
"KB"
;
// set default run mode
SetRunMode
(
lite_api
::
PowerMode
::
LITE_POWER_NO_BIND
,
1
);
// use single thread by default
SetRunMode
(
lite_api
::
PowerMode
::
LITE_POWER_NO_BIND
,
1
);
// use single thread by default
return
0
;
}
...
...
lite/tests/kernels/matmul_compute_test.cc
浏览文件 @
3f56474f
...
...
@@ -180,7 +180,8 @@ class MatMulComputeTester : public arena::TestCase {
if
(
y_dims_
.
size
()
>
2
)
{
int
y_inner
=
y_dims_
[
y_dims_
.
size
()
-
2
]
*
y_dims_
[
y_dims_
.
size
()
-
1
];
int
o_inner
=
dim_out_vec
[
x_dims_
.
size
()
-
2
]
*
dim_out_vec
[
x_dims_
.
size
()
-
1
];
int
o_inner
=
dim_out_vec
[
x_dims_
.
size
()
-
2
]
*
dim_out_vec
[
x_dims_
.
size
()
-
1
];
for
(
size_t
i
=
0
;
i
<
x_dims_
.
count
(
0
,
x_dims_
.
size
()
-
2
);
++
i
)
{
mul_low_efficiency
(
DDim
({
x_dims_
[
x_dims_
.
size
()
-
2
],
x_dims_
[
x_dims_
.
size
()
-
1
]}),
...
...
@@ -193,7 +194,8 @@ class MatMulComputeTester : public arena::TestCase {
out_data
+
i
*
o_inner
);
}
}
else
{
int
o_inner
=
dim_out_vec
[
x_dims_
.
size
()
-
2
]
*
dim_out_vec
[
x_dims_
.
size
()
-
1
];
int
o_inner
=
dim_out_vec
[
x_dims_
.
size
()
-
2
]
*
dim_out_vec
[
x_dims_
.
size
()
-
1
];
for
(
size_t
i
=
0
;
i
<
x_dims_
.
count
(
0
,
x_dims_
.
size
()
-
2
);
++
i
)
{
mul_low_efficiency
(
DDim
({
x_dims_
[
x_dims_
.
size
()
-
2
],
x_dims_
[
x_dims_
.
size
()
-
1
]}),
...
...
@@ -297,10 +299,10 @@ class MatMulComputeTester : public arena::TestCase {
std
::
vector
<
float
>
y_data
(
y_dims_
.
production
());
for
(
int
i
=
0
;
i
<
x_dims_
.
production
();
++
i
)
{
x_data
[
i
]
=
1
;
// i * 1.1;
x_data
[
i
]
=
1
;
// i * 1.1;
}
for
(
int
i
=
0
;
i
<
y_dims_
.
production
();
++
i
)
{
y_data
[
i
]
=
1
;
// i * 0.9;
y_data
[
i
]
=
1
;
// i * 0.9;
}
SetCommonTensor
(
x_
,
x_dims_
,
x_data
.
data
());
...
...
lite/tools/debug/model_debug_tool.cc
浏览文件 @
3f56474f
...
...
@@ -33,7 +33,8 @@ void Run(DebugConfig* conf) {
CHECK
(
conf
);
#ifdef LITE_WITH_ARM
DeviceInfo
::
Init
();
DeviceInfo
::
Global
().
SetRunMode
(
lite_api
::
LITE_POWER_HIGH
,
conf
->
arm_thread_num
);
DeviceInfo
::
Global
().
SetRunMode
(
lite_api
::
LITE_POWER_HIGH
,
conf
->
arm_thread_num
);
#endif
lite
::
Predictor
predictor
;
std
::
vector
<
Place
>
valid_places
({
...
...
lite/utils/logging.h
浏览文件 @
3f56474f
...
...
@@ -18,13 +18,13 @@
*/
#pragma once
#include <assert.h>
#include <sys/time.h>
#include <sys/types.h>
#include <time.h>
#include <cstdlib>
#include <cstring>
#include <string>
#include <assert.h>
#include "lite/utils/replace_stl/stream.h"
// NOLINTFILE()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录