提交 f3e416ce 编写于 作者: L liuqi

Fix travis CI problems.

上级 a46158c8
...@@ -4,7 +4,16 @@ package( ...@@ -4,7 +4,16 @@ package(
licenses(["notice"]) # Apache 2.0 licenses(["notice"]) # Apache 2.0
load("//mace:mace.bzl", "if_android", "if_neon_enabled", "if_openmp_enabled", "if_android_armv7", "if_hexagon_enabled") load(
"//mace:mace.bzl",
"if_android",
"if_hexagon_enabled",
"if_not_hexagon_enabled",
"if_openmp_enabled",
"if_neon_enabled",
"if_opencl_enabled",
"if_quantize_enabled",
)
cc_library( cc_library(
name = "mace_api_test_header", name = "mace_api_test_header",
...@@ -18,13 +27,22 @@ cc_test( ...@@ -18,13 +27,22 @@ cc_test(
name = "mace_api_test", name = "mace_api_test",
testonly = 1, testonly = 1,
srcs = ["mace_api_test.cc"], srcs = ["mace_api_test.cc"],
copts = ["-Werror", "-Wextra", "-Wno-missing-field-initializers"] + copts = [
if_openmp_enabled(["-fopenmp"]) + "-Werror",
if_neon_enabled(["-DMACE_ENABLE_NEON"]) + "-Wextra",
if_android_armv7(["-mfpu=neon"]) + "-Wno-missing-field-initializers",
if_android_armv7(["-mfloat-abi=softfp"]) + ] + if_openmp_enabled([
if_android(["-DMACE_ENABLE_OPENCL"]) + "-fopenmp",
if_hexagon_enabled(["-DMACE_ENABLE_HEXAGON"]), "-DMACE_ENABLE_OPENMP",
]) + if_opencl_enabled([
"-DMACE_ENABLE_OPENCL",
]) + if_quantize_enabled([
"-DMACE_ENABLE_QUANTIZE",
]) + if_hexagon_enabled([
"-DMACE_ENABLE_HEXAGON",
]) + if_neon_enabled([
"-DMACE_ENABLE_NEON",
]),
linkopts = ["-fopenmp"], linkopts = ["-fopenmp"],
linkstatic = 1, linkstatic = 1,
deps = [ deps = [
...@@ -39,13 +57,22 @@ cc_test( ...@@ -39,13 +57,22 @@ cc_test(
name = "mace_api_mt_test", name = "mace_api_mt_test",
testonly = 1, testonly = 1,
srcs = ["mace_api_mt_test.cc"], srcs = ["mace_api_mt_test.cc"],
copts = ["-Werror", "-Wextra", "-Wno-missing-field-initializers"] + copts = [
if_openmp_enabled(["-fopenmp"]) + "-Werror",
if_neon_enabled(["-DMACE_ENABLE_NEON"]) + "-Wextra",
if_android_armv7(["-mfpu=neon"]) + "-Wno-missing-field-initializers",
if_android_armv7(["-mfloat-abi=softfp"]) + ] + if_openmp_enabled([
if_android(["-DMACE_ENABLE_OPENCL"]) + "-fopenmp",
if_hexagon_enabled(["-DMACE_ENABLE_HEXAGON"]), "-DMACE_ENABLE_OPENMP",
]) + if_opencl_enabled([
"-DMACE_ENABLE_OPENCL",
]) + if_quantize_enabled([
"-DMACE_ENABLE_QUANTIZE",
]) + if_hexagon_enabled([
"-DMACE_ENABLE_HEXAGON",
]) + if_neon_enabled([
"-DMACE_ENABLE_NEON",
]),
linkopts = ["-fopenmp"], linkopts = ["-fopenmp"],
linkstatic = 1, linkstatic = 1,
deps = [ deps = [
...@@ -60,13 +87,22 @@ cc_test( ...@@ -60,13 +87,22 @@ cc_test(
name = "mace_api_exception_test", name = "mace_api_exception_test",
testonly = 1, testonly = 1,
srcs = ["mace_api_exception_test.cc"], srcs = ["mace_api_exception_test.cc"],
copts = ["-Werror", "-Wextra", "-Wno-missing-field-initializers"] + copts = [
if_openmp_enabled(["-fopenmp"]) + "-Werror",
if_neon_enabled(["-DMACE_ENABLE_NEON"]) + "-Wextra",
if_android_armv7(["-mfpu=neon"]) + "-Wno-missing-field-initializers",
if_android_armv7(["-mfloat-abi=softfp"]) + ] + if_openmp_enabled([
if_android(["-DMACE_ENABLE_OPENCL"]) + "-fopenmp",
if_hexagon_enabled(["-DMACE_ENABLE_HEXAGON"]), "-DMACE_ENABLE_OPENMP",
]) + if_opencl_enabled([
"-DMACE_ENABLE_OPENCL",
]) + if_quantize_enabled([
"-DMACE_ENABLE_QUANTIZE",
]) + if_hexagon_enabled([
"-DMACE_ENABLE_HEXAGON",
]) + if_neon_enabled([
"-DMACE_ENABLE_NEON",
]),
linkopts = ["-fopenmp"], linkopts = ["-fopenmp"],
linkstatic = 1, linkstatic = 1,
deps = [ deps = [
......
...@@ -33,8 +33,6 @@ void MaceRunFunc(const int in_out_size) { ...@@ -33,8 +33,6 @@ void MaceRunFunc(const int in_out_size) {
} }
std::string filter_tensor_name = "filter"; std::string filter_tensor_name = "filter";
const DeviceType device = DeviceType::GPU;
const std::vector<std::vector<int64_t>> input_shapes = {{1, 32, 32, 16}}; const std::vector<std::vector<int64_t>> input_shapes = {{1, 32, 32, 16}};
const std::vector<std::vector<int64_t>> output_shapes = {{1, 32, 32, 16}}; const std::vector<std::vector<int64_t>> output_shapes = {{1, 32, 32, 16}};
const std::vector<int64_t> filter_shape = {16, 16, 3, 3}; const std::vector<int64_t> filter_shape = {16, 16, 3, 3};
......
...@@ -125,20 +125,6 @@ def parse_args(): ...@@ -125,20 +125,6 @@ def parse_args():
def main(unused_args): def main(unused_args):
target_socs = None
target_devices = DeviceManager.list_devices(FLAGS.device_yml)
if FLAGS.target_socs != "all" and FLAGS.target_socs != "random":
target_socs = set(FLAGS.target_socs.split(','))
target_devices = [dev for dev in target_devices
if dev[YAMLKeyword.target_socs] in target_socs]
if FLAGS.target_socs == "random":
unlocked_devices = \
[d for d in target_devices if not sh_commands.is_device_locked(d)]
if len(unlocked_devices) > 0:
target_devices = [random.choice(unlocked_devices)]
else:
target_devices = [random.choice(target_devices)]
target = FLAGS.target target = FLAGS.target
host_bin_path, bin_name = sh_commands.bazel_target_to_bin(target) host_bin_path, bin_name = sh_commands.bazel_target_to_bin(target)
target_abis = FLAGS.target_abis.split(',') target_abis = FLAGS.target_abis.split(',')
...@@ -150,6 +136,21 @@ def main(unused_args): ...@@ -150,6 +136,21 @@ def main(unused_args):
enable_neon=FLAGS.enable_neon, enable_neon=FLAGS.enable_neon,
address_sanitizer=FLAGS.address_sanitizer) address_sanitizer=FLAGS.address_sanitizer)
if FLAGS.run_target: if FLAGS.run_target:
target_devices = DeviceManager.list_devices(FLAGS.device_yml)
if FLAGS.target_socs != "all" and FLAGS.target_socs != "random":
target_socs = set(FLAGS.target_socs.split(','))
target_devices = \
[dev for dev in target_devices
if dev[YAMLKeyword.target_socs] in target_socs]
if FLAGS.target_socs == "random":
unlocked_devices = \
[d for d in target_devices if
not sh_commands.is_device_locked(d)]
if len(unlocked_devices) > 0:
target_devices = [random.choice(unlocked_devices)]
else:
target_devices = [random.choice(target_devices)]
for dev in target_devices: for dev in target_devices:
if target_abi not in dev[YAMLKeyword.target_abis]: if target_abi not in dev[YAMLKeyword.target_abis]:
print("Skip device %s which does not support ABI %s" % print("Skip device %s which does not support ABI %s" %
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册