提交 82505ec4 编写于 作者: L Liangliang He

Skip devices for unsupported ABIs

上级 6ffd958c
......@@ -94,12 +94,15 @@ def main(unused_args):
sh_commands.bazel_build(target, abi=target_abi)
if FLAGS.run_target:
for serialno in target_devices:
device_properties = sh_commands.adb_getprop_by_serialno(serialno)
if target_abi not in set(sh_commands.adb_supported_abis(serialno)):
print("Skip device %s which does not support ABI %s" % (serialno, target_abi))
continue
stdouts = sh_commands.adb_run(serialno, host_bin_path, bin_name,
args=FLAGS.args,
opencl_profiling=1,
vlog_level=0,
device_bin_path="/data/local/tmp/mace")
device_properties = sh_commands.adb_getprop_by_serialno(serialno)
globals()[FLAGS.stdout_processor](stdouts, device_properties, target_abi)
if __name__ == "__main__":
......
......@@ -49,6 +49,12 @@ def adb_getprop_by_serialno(serialno):
props[m.group(1)] = m.group(2)
return props
def adb_supported_abis(serialno):
props = adb_getprop_by_serialno(serialno)
abilist_str = props["ro.product.cpu.abilist"]
abis = [abi.strip() for abi in abilist_str.split(',')]
return abis
def adb_get_all_socs():
socs = []
for d in adb_devices():
......@@ -88,6 +94,7 @@ def adb_run(serialno, host_bin_path, bin_name,
# bazel commands
################################
def bazel_build(target, strip="always", abi="armeabi-v7a"):
print("Build %s with ABI %s" % (target, abi))
stdout_buff=[]
process_output = make_output_processor(stdout_buff)
p= sh.bazel("build",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册