Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
4d530acc
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看板
未验证
提交
4d530acc
编写于
10月 15, 2019
作者:
J
juncaipeng
提交者:
GitHub
10月 15, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix benchmark, test=develop (#2188)
* fix benchmark, test=develop
上级
435f942b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
14 addition
and
9 deletion
+14
-9
lite/api/CMakeLists.txt
lite/api/CMakeLists.txt
+2
-2
lite/api/benchmark.cc
lite/api/benchmark.cc
+9
-7
lite/api/model_test.cc
lite/api/model_test.cc
+3
-0
未找到文件。
lite/api/CMakeLists.txt
浏览文件 @
4d530acc
...
@@ -246,14 +246,14 @@ endif()
...
@@ -246,14 +246,14 @@ endif()
# Some bins
# Some bins
if
(
NOT IOS
)
if
(
NOT IOS
)
lite_cc_binary
(
test_model_bin SRCS model_test.cc DEPS paddle_api_full paddle_api_light gflags utils
lite_cc_binary
(
test_model_bin SRCS model_test.cc DEPS paddle_api_full paddle_api_light gflags utils
${
ops
}
${
ops
}
${
host_kernels
}
ARM_DEPS
${
arm_kernels
}
ARM_DEPS
${
arm_kernels
}
NPU_DEPS
${
npu_kernels
}
NPU_DEPS
${
npu_kernels
}
CL_DEPS
${
opencl_kernels
}
CL_DEPS
${
opencl_kernels
}
FPGA_DEPS
${
fpga_kernels
}
FPGA_DEPS
${
fpga_kernels
}
X86_DEPS
${
x86_kernels
}
)
X86_DEPS
${
x86_kernels
}
)
lite_cc_binary
(
benchmark_bin SRCS benchmark.cc DEPS paddle_api_full paddle_api_light gflags utils
lite_cc_binary
(
benchmark_bin SRCS benchmark.cc DEPS paddle_api_full paddle_api_light gflags utils
${
ops
}
${
ops
}
${
host_kernels
}
ARM_DEPS
${
arm_kernels
}
ARM_DEPS
${
arm_kernels
}
NPU_DEPS
${
npu_kernels
}
NPU_DEPS
${
npu_kernels
}
CL_DEPS
${
opencl_kernels
}
CL_DEPS
${
opencl_kernels
}
...
...
lite/api/benchmark.cc
浏览文件 @
4d530acc
...
@@ -18,6 +18,9 @@
...
@@ -18,6 +18,9 @@
#include <string>
#include <string>
#include <vector>
#include <vector>
#include "lite/api/paddle_api.h"
#include "lite/api/paddle_api.h"
#include "lite/api/paddle_use_kernels.h"
#include "lite/api/paddle_use_ops.h"
#include "lite/api/paddle_use_passes.h"
#include "lite/api/test_helper.h"
#include "lite/api/test_helper.h"
#include "lite/core/device_info.h"
#include "lite/core/device_info.h"
#include "lite/utils/cp_logging.h"
#include "lite/utils/cp_logging.h"
...
@@ -39,11 +42,14 @@ void OutputOptModel(const std::string& load_model_dir,
...
@@ -39,11 +42,14 @@ void OutputOptModel(const std::string& load_model_dir,
const
std
::
vector
<
std
::
vector
<
int64_t
>>&
input_shapes
)
{
const
std
::
vector
<
std
::
vector
<
int64_t
>>&
input_shapes
)
{
lite_api
::
CxxConfig
config
;
lite_api
::
CxxConfig
config
;
config
.
set_model_dir
(
load_model_dir
);
config
.
set_model_dir
(
load_model_dir
);
config
.
set_preferred_place
(
Place
{
TARGET
(
kX86
),
PRECISION
(
kFloat
)});
config
.
set_valid_places
({
config
.
set_valid_places
({
Place
{
TARGET
(
kX86
),
PRECISION
(
kFloat
)},
Place
{
TARGET
(
kARM
),
PRECISION
(
kFloat
)},
Place
{
TARGET
(
kARM
),
PRECISION
(
kFloat
)},
Place
{
TARGET
(
kARM
),
PRECISION
(
kInt8
)},
Place
{
TARGET
(
kX86
),
PRECISION
(
kFloat
)},
Place
{
TARGET
(
kOpenCL
),
PRECISION
(
kFloat
)},
Place
{
TARGET
(
kHost
),
PRECISION
(
kFloat
)},
});
});
config
.
set_preferred_place
(
Place
{
TARGET
(
kARM
),
PRECISION
(
kFloat
)});
auto
predictor
=
lite_api
::
CreatePaddlePredictor
(
config
);
auto
predictor
=
lite_api
::
CreatePaddlePredictor
(
config
);
int
ret
=
system
(
int
ret
=
system
(
...
@@ -67,11 +73,7 @@ void Run(const std::vector<std::vector<int64_t>>& input_shapes,
...
@@ -67,11 +73,7 @@ void Run(const std::vector<std::vector<int64_t>>& input_shapes,
const
std
::
string
model_name
)
{
const
std
::
string
model_name
)
{
lite_api
::
MobileConfig
config
;
lite_api
::
MobileConfig
config
;
config
.
set_threads
(
thread_num
);
config
.
set_threads
(
thread_num
);
if
(
thread_num
==
1
)
{
config
.
set_power_mode
(
LITE_POWER_NO_BIND
);
config
.
set_power_mode
(
LITE_POWER_NO_BIND
);
}
else
{
config
.
set_power_mode
(
LITE_POWER_NO_BIND
);
}
config
.
set_model_dir
(
model_dir
);
config
.
set_model_dir
(
model_dir
);
auto
predictor
=
lite_api
::
CreatePaddlePredictor
(
config
);
auto
predictor
=
lite_api
::
CreatePaddlePredictor
(
config
);
...
...
lite/api/model_test.cc
浏览文件 @
4d530acc
...
@@ -16,6 +16,9 @@
...
@@ -16,6 +16,9 @@
#include <string>
#include <string>
#include <vector>
#include <vector>
#include "lite/api/paddle_api.h"
#include "lite/api/paddle_api.h"
#include "lite/api/paddle_use_kernels.h"
#include "lite/api/paddle_use_ops.h"
#include "lite/api/paddle_use_passes.h"
#include "lite/api/test_helper.h"
#include "lite/api/test_helper.h"
#include "lite/core/device_info.h"
#include "lite/core/device_info.h"
#include "lite/utils/cp_logging.h"
#include "lite/utils/cp_logging.h"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录