Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Xiaomi
Mace
提交
f138e8f7
Mace
项目概览
Xiaomi
/
Mace
通知
106
Star
40
Fork
27
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Mace
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f138e8f7
编写于
7月 10, 2018
作者:
L
liuqi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove unused code in example and fix some typo.
上级
b352192b
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
38 addition
and
46 deletion
+38
-46
mace/examples/README.md
mace/examples/README.md
+0
-32
mace/examples/cli/BUILD
mace/examples/cli/BUILD
+9
-2
mace/examples/cli/README.md
mace/examples/cli/README.md
+23
-0
mace/utils/tuner.h
mace/utils/tuner.h
+2
-0
tools/build-standalone-lib.sh
tools/build-standalone-lib.sh
+3
-3
tools/converter.py
tools/converter.py
+1
-9
未找到文件。
mace/examples/README.md
已删除
100644 → 0
浏览文件 @
b352192b
Examples
=======
*
Build the example (e.g., with armeabi-v7a target)
```
# To enable debug mode build, use '-c dbg' flag.
# To check the underlying commands executed, use '-s' flag.
# TO check the failed command, use '--verbose_failures' flag.
bazel build -c opt mace/examples:helloworld \
--crosstool_top=//external:android/crosstool \
--host_crosstool_top=@bazel_tools//tools/cpp:toolchain \
--cpu=arm64-v8a
```
*
To run adb inside docker, the container network should use 'host'
```
docker run -it --net=host mace-dev /bin/bash
```
*
Push and run the example
```
adb shell "mkdir /data/local/tmp"
adb push bazel-bin/mace/examples/helloworld /data/local/tmp/
adb shell /data/local/tmp/helloworld
```
*
Check the logs
```
adb logcat | grep native
```
mace/examples/cli/BUILD
浏览文件 @
f138e8f7
...
...
@@ -39,12 +39,19 @@ cc_binary(
]
+
if_android
([
"-DMACE_ENABLE_OPENCL"
,
]),
linkopts
=
[
"-lm"
,
"-pie"
,
"-fPIE"
]
+
if_openmp_enabled
([
"-fopenmp"
]),
linkopts
=
[
"-lm"
,
]
+
if_openmp_enabled
([
"-fopenmp"
])
+
if_android
([
"-ldl"
,
"-pie"
,
"-llog"
,
]),
linkstatic
=
0
,
deps
=
[
"//external:gflags_nothreads"
,
"//mace/codegen:generated_mace_engine_factory"
,
"//mace/utils:utils"
,
"//mace/codegen:generated_libmace"
,
],
)
...
...
mace/examples/cli/README.md
0 → 100644
浏览文件 @
f138e8f7
Examples
=======
*
Convert model
```
python tools/converter.py convert --config=/path/to/your/model_deployment_file
```
*
Run example
```
python tools/converter.py run --config=/path/to/your/model_deployment_file --example
```
*
Validate result
```
python tools/converter.py run --config=/path/to/your/model_deployment_file --example --example
```
*
Check the logs
```
adb logcat
```
mace/utils/tuner.h
浏览文件 @
f138e8f7
...
...
@@ -140,6 +140,8 @@ class Tuner {
param_table_
.
emplace
(
key
,
params
);
}
ifs
.
close
();
}
else
{
LOG
(
WARNING
)
<<
"Read OpenCL tuned parameters file failed."
;
}
}
else
{
LOG
(
INFO
)
<<
"There is no tuned parameters."
;
...
...
tools/build-standalone-lib.sh
浏览文件 @
f138e8f7
...
...
@@ -12,14 +12,14 @@ mkdir -p $INCLUDE_DIR
cp
mace/public/
*
.h
$INCLUDE_DIR
/
# make directories
rm
-rf
$LIB_DIR
/armeabi-v7a
mkdir
-p
$LIB_DIR
/armeabi-v7a
rm
-f
$LIB_DIR
/armeabi-v7a/
*
rm
-rf
$LIB_DIR
/arm64-v8a
mkdir
-p
$LIB_DIR
/arm64-v8a
rm
-f
$LIB_DIR
/arm64-v8a/
*
rm
-rf
$LIB_DIR
/linux-x86-64
mkdir
-p
$LIB_DIR
/linux-x86-64
rm
-f
$LIB_DIR
/linux-x86-64/
*
# build shared libraries
echo
"build shared lib for armeabi-v7a"
...
...
tools/converter.py
浏览文件 @
f138e8f7
...
...
@@ -168,7 +168,6 @@ class YAMLKeyword(object):
target_socs
=
'target_socs'
model_graph_format
=
'model_graph_format'
model_data_format
=
'model_data_format'
linkshared
=
'linkshared'
models
=
'models'
platform
=
'platform'
model_file_path
=
'model_file_path'
...
...
@@ -526,13 +525,6 @@ def get_opencl_parameter_output_path(library_name, target_abi,
target_soc
)
def
get_shared_library_dir
(
library_name
,
abi
):
return
'%s/%s/%s/%s'
%
(
BUILD_OUTPUT_DIR
,
library_name
,
OUTPUT_LIBRARY_DIR_NAME
,
abi
)
def
clear_build_dirs
(
library_name
):
# make build dir
if
not
os
.
path
.
exists
(
BUILD_OUTPUT_DIR
):
...
...
@@ -751,7 +743,7 @@ def build_model_lib(configs, address_sanitizer):
address_sanitizer
=
address_sanitizer
)
sh
.
cp
(
MODEL_LIB_PATH
,
model_lib_output_path
)
sh
.
cp
(
"-f"
,
MODEL_LIB_PATH
,
model_lib_output_path
)
def
print_library_summary
(
configs
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录