Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Xiaomi
Mace
提交
2215177e
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,发现更多精彩内容 >>
提交
2215177e
编写于
8月 02, 2018
作者:
L
liuqi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add if_opencl_enabled_str for build static library without opencl.
上级
77796bf7
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
12 addition
and
5 deletion
+12
-5
mace/libmace/BUILD
mace/libmace/BUILD
+5
-3
mace/mace.bzl
mace/mace.bzl
+6
-0
repository/opencl-kernel/opencl_kernel_configure.bzl
repository/opencl-kernel/opencl_kernel_configure.bzl
+1
-2
未找到文件。
mace/libmace/BUILD
浏览文件 @
2215177e
...
@@ -15,6 +15,7 @@ load(
...
@@ -15,6 +15,7 @@ load(
"if_android_armv7"
,
"if_android_armv7"
,
"if_hexagon_enabled"
,
"if_hexagon_enabled"
,
"if_opencl_enabled"
,
"if_opencl_enabled"
,
"if_opencl_enabled_str"
,
)
)
cc_library
(
cc_library
(
...
@@ -67,7 +68,6 @@ cc_library(
...
@@ -67,7 +68,6 @@ cc_library(
genrule
(
genrule
(
name
=
"libmace_static"
,
name
=
"libmace_static"
,
srcs
=
[
srcs
=
[
"//mace/codegen:generated_opencl"
,
"//mace/codegen:generated_version"
,
"//mace/codegen:generated_version"
,
"//mace/core"
,
"//mace/core"
,
"//mace/kernels"
,
"//mace/kernels"
,
...
@@ -76,11 +76,12 @@ genrule(
...
@@ -76,11 +76,12 @@ genrule(
"//mace/utils"
,
"//mace/utils"
,
"//mace/proto:mace_cc"
,
"//mace/proto:mace_cc"
,
"@com_google_protobuf//:protobuf_lite"
,
"@com_google_protobuf//:protobuf_lite"
,
],
]
+
if_opencl_enabled
([
"//mace/codegen:generated_opencl"
,
]),
outs
=
[
"libmace.a"
],
outs
=
[
"libmace.a"
],
cmd
=
"tmp_mri_file=$$(mktemp mace-static-lib-mri.XXXXXXXXXX);"
+
cmd
=
"tmp_mri_file=$$(mktemp mace-static-lib-mri.XXXXXXXXXX);"
+
"mri_stream=$$(python $(location //mace/python/tools:archive_static_lib) "
+
"mri_stream=$$(python $(location //mace/python/tools:archive_static_lib) "
+
"$(locations //mace/codegen:generated_opencl) "
+
"$(locations //mace/codegen:generated_version) "
+
"$(locations //mace/codegen:generated_version) "
+
"$(locations //mace/core:core) "
+
"$(locations //mace/core:core) "
+
"$(locations //mace/kernels:kernels) "
+
"$(locations //mace/kernels:kernels) "
+
...
@@ -89,6 +90,7 @@ genrule(
...
@@ -89,6 +90,7 @@ genrule(
"$(locations //mace/utils:utils) "
+
"$(locations //mace/utils:utils) "
+
"$(locations //mace/proto:mace_cc) "
+
"$(locations //mace/proto:mace_cc) "
+
"$(locations @com_google_protobuf//:protobuf_lite) "
+
"$(locations @com_google_protobuf//:protobuf_lite) "
+
if_opencl_enabled_str
(
"$(locations //mace/codegen:generated_opencl) "
)
+
"$@ "
+
"$@ "
+
"$$tmp_mri_file);"
+
"$$tmp_mri_file);"
+
"$(AR) -M <$$tmp_mri_file;"
+
"$(AR) -M <$$tmp_mri_file;"
+
...
...
mace/mace.bzl
浏览文件 @
2215177e
...
@@ -54,6 +54,12 @@ def if_opencl_enabled(a):
...
@@ -54,6 +54,12 @@ def if_opencl_enabled(a):
"//conditions:default"
:
[],
"//conditions:default"
:
[],
})
})
def
if_opencl_enabled_str
(
a
):
return
select
({
"//mace:opencl_enabled"
:
a
,
"//conditions:default"
:
""
,
})
def
mace_version_genrule
():
def
mace_version_genrule
():
native
.
genrule
(
native
.
genrule
(
name
=
"mace_version_gen"
,
name
=
"mace_version_gen"
,
...
...
repository/opencl-kernel/opencl_kernel_configure.bzl
浏览文件 @
2215177e
...
@@ -6,6 +6,7 @@ def _opencl_encrypt_kernel_impl(repository_ctx):
...
@@ -6,6 +6,7 @@ def _opencl_encrypt_kernel_impl(repository_ctx):
Label
(
"//repository/opencl-kernel:BUILD.tpl"
))
Label
(
"//repository/opencl-kernel:BUILD.tpl"
))
mace_root_path
=
str
(
repository_ctx
.
path
(
Label
(
"@mace//:BUILD"
)))[:
-
len
(
"BUILD"
)]
mace_root_path
=
str
(
repository_ctx
.
path
(
Label
(
"@mace//:BUILD"
)))[:
-
len
(
"BUILD"
)]
generated_files_path
=
repository_ctx
.
path
(
"gen"
)
ret
=
repository_ctx
.
execute
(
ret
=
repository_ctx
.
execute
(
[
"test"
,
"-f"
,
"%s/.git/logs/HEAD"
%
mace_root_path
])
[
"test"
,
"-f"
,
"%s/.git/logs/HEAD"
%
mace_root_path
])
...
@@ -46,8 +47,6 @@ def _opencl_encrypt_kernel_impl(repository_ctx):
...
@@ -46,8 +47,6 @@ def _opencl_encrypt_kernel_impl(repository_ctx):
unused_var
=
repository_ctx
.
path
(
Label
(
"//:mace/kernels/opencl/cl/space_to_batch.cl"
))
unused_var
=
repository_ctx
.
path
(
Label
(
"//:mace/kernels/opencl/cl/space_to_batch.cl"
))
unused_var
=
repository_ctx
.
path
(
Label
(
"//:mace/kernels/opencl/cl/winograd_transform.cl"
))
unused_var
=
repository_ctx
.
path
(
Label
(
"//:mace/kernels/opencl/cl/winograd_transform.cl"
))
generated_files_path
=
repository_ctx
.
path
(
"gen"
)
python_bin_path
=
repository_ctx
.
which
(
"python"
)
python_bin_path
=
repository_ctx
.
which
(
"python"
)
repository_ctx
.
execute
([
repository_ctx
.
execute
([
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录