Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Xiaomi
Mace
提交
5b1cda72
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,发现更多精彩内容 >>
提交
5b1cda72
编写于
1月 17, 2018
作者:
叶
叶剑武
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'change_profiling_macro_to_env_var' into 'master'
change profiling macro to environment variable See merge request !215
上级
f8637922
7d4c9286
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
9 addition
and
24 deletion
+9
-24
mace/BUILD
mace/BUILD
+0
-8
mace/core/BUILD
mace/core/BUILD
+0
-2
mace/core/runtime/opencl/opencl_runtime.cc
mace/core/runtime/opencl/opencl_runtime.cc
+5
-3
mace/mace.bzl
mace/mace.bzl
+0
-6
tools/bazel-adb-run.sh
tools/bazel-adb-run.sh
+2
-2
tools/validate_gcn.sh
tools/validate_gcn.sh
+2
-3
未找到文件。
mace/BUILD
浏览文件 @
5b1cda72
...
...
@@ -24,14 +24,6 @@ config_setting(
visibility
=
[
"//visibility:public"
],
)
config_setting
(
name
=
"profiling_enabled"
,
define_values
=
{
"profiling"
:
"true"
,
},
visibility
=
[
"//visibility:public"
],
)
config_setting
(
name
=
"production_mode"
,
define_values
=
{
...
...
mace/core/BUILD
浏览文件 @
5b1cda72
...
...
@@ -10,7 +10,6 @@ licenses(["notice"]) # Apache 2.0
load
(
"//mace:mace.bzl"
,
"if_android"
,
"if_profiling_enabled"
,
"if_hexagon_enabled"
,
"if_not_hexagon_enabled"
,
"if_production_mode"
,
...
...
@@ -43,7 +42,6 @@ cc_library(
"runtime/opencl/*.h"
,
"runtime/hexagon/*.h"
,
]),
copts
=
if_profiling_enabled
([
"-DMACE_OPENCL_PROFILING"
])
+
if_hexagon_enabled
([
"-DMACE_HEXAGON_ENABLED"
]),
linkopts
=
if_android
([
"-pie"
,
"-ldl"
,
...
...
mace/core/runtime/opencl/opencl_runtime.cc
浏览文件 @
5b1cda72
...
...
@@ -91,9 +91,11 @@ OpenCLRuntime::OpenCLRuntime() {
cl_command_queue_properties
properties
=
0
;
#ifdef MACE_OPENCL_PROFILING
properties
|=
CL_QUEUE_PROFILING_ENABLE
;
#endif
const
char
*
profiling
=
getenv
(
"MACE_OPENCL_PROFILING"
);
if
(
Tuner
<
uint32_t
>::
Get
()
->
IsTuning
()
||
(
profiling
!=
nullptr
&&
strlen
(
profiling
)
==
1
&&
profiling
[
0
]
==
'1'
))
{
properties
|=
CL_QUEUE_PROFILING_ENABLE
;
}
// a context is like a "runtime link" to the device and platform;
// i.e. communication is possible
...
...
mace/mace.bzl
浏览文件 @
5b1cda72
...
...
@@ -24,12 +24,6 @@ def if_android_arm64(a):
"//conditions:default"
:
[],
})
def
if_profiling_enabled
(
a
):
return
select
({
"//mace:profiling_enabled"
:
a
,
"//conditions:default"
:
[],
})
def
if_production_mode
(
a
):
return
select
({
"//mace:production_mode"
:
a
,
...
...
tools/bazel-adb-run.sh
浏览文件 @
5b1cda72
...
...
@@ -22,7 +22,7 @@ ANDROID_ABI=arm64-v8a
ANDROID_ABI
=
armeabi-v7a
STRIP
=
"--strip always"
VLOG_LEVEL
=
0
PROFILIN
E
=
"--define profiling=true
"
PROFILIN
G
=
"1
"
echo
"Step 1: Generate encrypted opencl source"
python mace/python/tools/encrypt_opencl_codegen.py
\
...
...
@@ -58,5 +58,5 @@ for device in `adb devices | grep "^[A-Za-z0-9]\+[[:space:]]\+device$"| cut -f1`
adb
-s
${
device
}
shell
"mkdir -p
$DEVICE_PATH
"
adb
-s
${
device
}
shell
"mkdir -p
$DEVICE_PATH
/cl"
adb
-s
${
device
}
push
$BAZEL_BIN_PATH
/
$BIN_NAME
$DEVICE_PATH
&&
\
adb
-s
${
device
}
shell
"MACE_KERNEL_PATH=
$DEVICE_CL_PATH
MACE_CPP_MIN_VLOG_LEVEL=
$VLOG_LEVEL
$DEVICE_PATH
/
$BIN_NAME
$@
"
adb
-s
${
device
}
shell
"MACE_
OPENCL_PROFILING=
$PROFILING
MACE_
KERNEL_PATH=
$DEVICE_CL_PATH
MACE_CPP_MIN_VLOG_LEVEL=
$VLOG_LEVEL
$DEVICE_PATH
/
$BIN_NAME
$@
"
done
tools/validate_gcn.sh
浏览文件 @
5b1cda72
...
...
@@ -5,7 +5,7 @@ Usage() {
echo
'Usage: bash tools/validate_gcn.sh tools/gcn.config tf_model_path model_tag image_size runtime[gpu/dsp] [tuning]'
}
if
[
$#
-lt
4
]
;
then
if
[
$#
-lt
5
]
;
then
Usage
exit
-1
fi
...
...
@@ -50,7 +50,6 @@ build_and_run()
fi
if
[[
"
${
TUNING_OR_NOT
}
"
!=
"0"
&&
"
$PRODUCTION_MODE
"
!=
true
]]
;
then
TUNING_MODE_BUILD_FLAGS
=
"--define profiling=true"
tuning_flag
=
1
round
=
0
# only warm up
else
...
...
@@ -68,7 +67,7 @@ build_and_run()
--copt
=
"-DMACE_MODEL_TAG=
${
MODEL_TAG
}
"
\
--copt
=
"-DMACE_OBFUSCATE_LITERALS"
\
$PRODUCTION_MODE_BUILD_FLAGS
\
$TUNING_MODE_BUILD_FLAGS
--define
hexagon
=
true
||
exit
-1
--define
hexagon
=
true
||
exit
-1
adb shell
"mkdir -p
${
PHONE_DATA_DIR
}
"
||
exit
-1
if
[
"
$PRODUCTION_MODE
"
=
false
]
;
then
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录