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 {
...
@@ -39,7 +39,7 @@ class LightPredictorImpl : public PaddlePredictor {
};
};
void
LightPredictorImpl
::
Init
(
const
MobileConfig
&
config
)
{
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
#ifdef LITE_WITH_ARM
lite
::
DeviceInfo
::
Init
();
lite
::
DeviceInfo
::
Init
();
lite
::
DeviceInfo
::
Global
().
SetRunMode
(
config
.
power_mode
(),
config
.
threads
());
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 {
...
@@ -113,9 +113,14 @@ class LITE_API CxxConfig : public ConfigBase {
class
LITE_API
MobileConfig
:
public
ConfigBase
{
class
LITE_API
MobileConfig
:
public
ConfigBase
{
PowerMode
mode_
{
LITE_POWER_HIGH
};
PowerMode
mode_
{
LITE_POWER_HIGH
};
int
threads_
{
1
};
int
threads_
{
1
};
public:
MobileConfig
(
Place
preferred_place
=
Place
(
TARGET
(
kARM
),
PRECISION
(
kFloat
),
DATALAYOUT
(
kNCHW
)),
public:
PowerMode
mode
=
LITE_POWER_HIGH
,
int
threads
=
1
)
:
mode_
(
mode
),
threads_
(
threads
)
{}
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_power_mode
(
PowerMode
mode
)
{
mode_
=
mode
;
}
void
set_threads
(
int
threads
)
{
threads_
=
threads
;
}
void
set_threads
(
int
threads
)
{
threads_
=
threads
;
}
...
...
lite/api/paddle_place.h
浏览文件 @
3f56474f
lite/core/cpu_info.cc
浏览文件 @
3f56474f
...
@@ -827,7 +827,7 @@ void DeviceInfo::RequestPowerHighMode(int thread_num) {
...
@@ -827,7 +827,7 @@ void DeviceInfo::RequestPowerHighMode(int thread_num) {
int
little_core_size
=
little_core_ids_
.
size
();
int
little_core_size
=
little_core_ids_
.
size
();
active_ids_
.
clear
();
active_ids_
.
clear
();
if
(
big_core_size
>
0
)
{
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
)
{
if
(
thread_num
>
big_core_size
)
{
LOG
(
ERROR
)
<<
"Request thread num: "
<<
thread_num
LOG
(
ERROR
)
<<
"Request thread num: "
<<
thread_num
<<
", exceed the big cores size: "
<<
big_core_size
<<
", exceed the big cores size: "
<<
big_core_size
...
@@ -1031,7 +1031,8 @@ int DeviceInfo::Setup() {
...
@@ -1031,7 +1031,8 @@ int DeviceInfo::Setup() {
}
}
LOG
(
INFO
)
<<
"Total memory: "
<<
mem_size_
<<
"KB"
;
LOG
(
INFO
)
<<
"Total memory: "
<<
mem_size_
<<
"KB"
;
// set default run mode
// 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
;
return
0
;
}
}
...
...
lite/tests/kernels/matmul_compute_test.cc
浏览文件 @
3f56474f
...
@@ -180,7 +180,8 @@ class MatMulComputeTester : public arena::TestCase {
...
@@ -180,7 +180,8 @@ class MatMulComputeTester : public arena::TestCase {
if
(
y_dims_
.
size
()
>
2
)
{
if
(
y_dims_
.
size
()
>
2
)
{
int
y_inner
=
y_dims_
[
y_dims_
.
size
()
-
2
]
*
y_dims_
[
y_dims_
.
size
()
-
1
];
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
)
{
for
(
size_t
i
=
0
;
i
<
x_dims_
.
count
(
0
,
x_dims_
.
size
()
-
2
);
++
i
)
{
mul_low_efficiency
(
mul_low_efficiency
(
DDim
({
x_dims_
[
x_dims_
.
size
()
-
2
],
x_dims_
[
x_dims_
.
size
()
-
1
]}),
DDim
({
x_dims_
[
x_dims_
.
size
()
-
2
],
x_dims_
[
x_dims_
.
size
()
-
1
]}),
...
@@ -193,7 +194,8 @@ class MatMulComputeTester : public arena::TestCase {
...
@@ -193,7 +194,8 @@ class MatMulComputeTester : public arena::TestCase {
out_data
+
i
*
o_inner
);
out_data
+
i
*
o_inner
);
}
}
}
else
{
}
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
)
{
for
(
size_t
i
=
0
;
i
<
x_dims_
.
count
(
0
,
x_dims_
.
size
()
-
2
);
++
i
)
{
mul_low_efficiency
(
mul_low_efficiency
(
DDim
({
x_dims_
[
x_dims_
.
size
()
-
2
],
x_dims_
[
x_dims_
.
size
()
-
1
]}),
DDim
({
x_dims_
[
x_dims_
.
size
()
-
2
],
x_dims_
[
x_dims_
.
size
()
-
1
]}),
...
...
lite/tools/debug/model_debug_tool.cc
浏览文件 @
3f56474f
...
@@ -33,7 +33,8 @@ void Run(DebugConfig* conf) {
...
@@ -33,7 +33,8 @@ void Run(DebugConfig* conf) {
CHECK
(
conf
);
CHECK
(
conf
);
#ifdef LITE_WITH_ARM
#ifdef LITE_WITH_ARM
DeviceInfo
::
Init
();
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
#endif
lite
::
Predictor
predictor
;
lite
::
Predictor
predictor
;
std
::
vector
<
Place
>
valid_places
({
std
::
vector
<
Place
>
valid_places
({
...
...
lite/utils/logging.h
浏览文件 @
3f56474f
...
@@ -18,13 +18,13 @@
...
@@ -18,13 +18,13 @@
*/
*/
#pragma once
#pragma once
#include <assert.h>
#include <sys/time.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/types.h>
#include <time.h>
#include <time.h>
#include <cstdlib>
#include <cstdlib>
#include <cstring>
#include <cstring>
#include <string>
#include <string>
#include <assert.h>
#include "lite/utils/replace_stl/stream.h"
#include "lite/utils/replace_stl/stream.h"
// NOLINTFILE()
// NOLINTFILE()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录