提交 33310ee8 编写于 作者: Y yejianwu

update opencl linkage lib

上级 c379f31d
...@@ -15,27 +15,25 @@ cc_library( ...@@ -15,27 +15,25 @@ cc_library(
deps = [ deps = [
"//mace/core", "//mace/core",
"//mace/ops", "//mace/ops",
"//mace/codegen:distribute_lib", ] + if_embed_binary_program(["//mace/core:opencl_binary_linkage"]) +
if_use_source_program(["//mace/core:opencl_source_linkage"]) + [
"//mace/codegen:version_lib", "//mace/codegen:version_lib",
"//mace/codegen:generated_opencl_lib", "//mace/codegen:generated_opencl_source_lib",
"//mace/codegen:generated_opencl_compiled_lib",
"//mace/codegen:generated_tuning_lib", "//mace/codegen:generated_tuning_lib",
], ],
) )
cc_library( cc_library(
name = "distribute_lib", name = "generated_opencl_source_lib",
srcs = if_embed_binary_program(["distribute/use_binary.cc"]) + srcs = glob(["opencl/opencl_encrypt_program.cc"]),
if_use_source_program(["distribute/use_source.cc"]),
copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1", "-Werror=return-type"], copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1", "-Werror=return-type"],
linkstatic = 1, linkstatic = 1,
deps = [
"//mace/core",
],
) )
cc_library( cc_library(
name = "generated_opencl_lib", name = "generated_opencl_compiled_lib",
srcs = glob(["opencl/*.cc"]), srcs = glob(["opencl/opencl_compiled_program.cc"]),
copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1", "-Werror=return-type"], copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1", "-Werror=return-type"],
linkstatic = 1, linkstatic = 1,
) )
......
...@@ -14,6 +14,8 @@ cc_library( ...@@ -14,6 +14,8 @@ cc_library(
srcs = glob([ srcs = glob([
"*.cc", "*.cc",
"runtime/opencl/*.cc", "runtime/opencl/*.cc",
], exclude=["runtime/opencl/opencl_binary_linkage.cc",
"runtime/opencl/opencl_source_linkage.cc",
]), ]),
hdrs = glob([ hdrs = glob([
"*.h", "*.h",
...@@ -49,3 +51,23 @@ cc_library( ...@@ -49,3 +51,23 @@ cc_library(
"//mace/utils:utils_hdrs", "//mace/utils:utils_hdrs",
], ],
) )
cc_library(
name = "opencl_source_linkage",
srcs = ["runtime/opencl/opencl_source_linkage.cc"],
copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1", "-Werror=return-type"],
linkstatic = 1,
deps = [
":core",
],
)
cc_library(
name = "opencl_binary_linkage",
srcs = ["runtime/opencl/opencl_binary_linkage.cc"],
copts = ["-std=c++11", "-D_GLIBCXX_USE_C99_MATH_TR1", "-Werror=return-type"],
linkstatic = 1,
deps = [
":core",
],
)
...@@ -115,8 +115,6 @@ build_and_run false ...@@ -115,8 +115,6 @@ build_and_run false
echo "Step 6: Generate OpenCL binary program and config code" echo "Step 6: Generate OpenCL binary program and config code"
rm -rf ${CL_BIN_DIR} rm -rf ${CL_BIN_DIR}
adb pull ${KERNEL_DIR} ${CL_BIN_DIR} adb pull ${KERNEL_DIR} ${CL_BIN_DIR}
rm -rf ${CL_CODEGEN_DIR}
mkdir -p ${CL_CODEGEN_DIR}
python mace/python/tools/opencl_codegen.py \ python mace/python/tools/opencl_codegen.py \
--cl_binary_dir=${CL_BIN_DIR} --output_path=${CL_CODEGEN_DIR}/opencl_compiled_program.cc --cl_binary_dir=${CL_BIN_DIR} --output_path=${CL_CODEGEN_DIR}/opencl_compiled_program.cc
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册