提交 241e2075 编写于 作者: Y yejianwu

update mace_tools output construction

上级 cc6e52a4
...@@ -169,6 +169,10 @@ def merge_libs_and_tuning_results(target_soc, output_dir, model_output_dirs): ...@@ -169,6 +169,10 @@ def merge_libs_and_tuning_results(target_soc, output_dir, model_output_dirs):
model_output_dirs_str) model_output_dirs_str)
run_command(command) run_command(command)
def packaging_lib_file(output_dir):
command = "bash tools/packaging_lib.sh {}".format(output_dir)
run_command(command)
def parse_model_configs(): def parse_model_configs():
with open(FLAGS.config) as f: with open(FLAGS.config) as f:
...@@ -273,7 +277,8 @@ def main(unused_args): ...@@ -273,7 +277,8 @@ def main(unused_args):
md5 = hashlib.md5() md5 = hashlib.md5()
md5.update(model_config["model_file_path"]) md5.update(model_config["model_file_path"])
model_path_digest = md5.hexdigest() model_path_digest = md5.hexdigest()
model_output_dir = "%s/%s/%s/%s/%s" % (FLAGS.output_dir, model_name, model_output_dir = "%s/%s/%s/%s/%s/%s/%s" % (FLAGS.output_dir, os.environ["PROJECT_NAME"],
"build", model_name,
model_path_digest, target_soc, model_path_digest, target_soc,
target_abi) target_abi)
model_output_dirs.append(model_output_dir) model_output_dirs.append(model_output_dir)
...@@ -334,6 +339,8 @@ def main(unused_args): ...@@ -334,6 +339,8 @@ def main(unused_args):
build_run_throughput_test(target_soc, FLAGS.run_seconds, build_run_throughput_test(target_soc, FLAGS.run_seconds,
merged_lib_file, FLAGS.output_dir) merged_lib_file, FLAGS.output_dir)
packaging_lib_file(FLAGS.output_dir)
if __name__ == "__main__": if __name__ == "__main__":
FLAGS, unparsed = parse_args() FLAGS, unparsed = parse_args()
......
...@@ -22,18 +22,18 @@ MODEL_DATA_DIR=${LIBMACE_BUILD_DIR}/data ...@@ -22,18 +22,18 @@ MODEL_DATA_DIR=${LIBMACE_BUILD_DIR}/data
if [ ! -d "${MODEL_HEADER_DIR}" ]; then if [ ! -d "${MODEL_HEADER_DIR}" ]; then
mkdir -p ${MODEL_HEADER_DIR} mkdir -p ${MODEL_HEADER_DIR}
fi fi
cp -rf ${MACE_SOURCE_DIR}/mace/public/*.h ${LIBMACE_BUILD_DIR}/include/mace/public/
if [ ! -d "${LIBMACE_BUILD_DIR}/${TARGET_ABI}" ]; then if [ ! -d "${LIBMACE_BUILD_DIR}/${TARGET_ABI}" ]; then
mkdir -p ${LIBMACE_BUILD_DIR}/${TARGET_ABI} mkdir -p ${LIBMACE_BUILD_DIR}/${TARGET_ABI}
fi fi
if [ ! -d "${LIBMACE_BUILD_DIR}/hexagon" ]; then
mkdir -p ${LIBMACE_BUILD_DIR}/hexagon
fi
if [ ! -d "${MODEL_DATA_DIR}" ]; then if [ ! -d "${MODEL_DATA_DIR}" ]; then
mkdir -p ${MODEL_DATA_DIR} mkdir -p ${MODEL_DATA_DIR}
fi fi
cp -rf ${MACE_SOURCE_DIR}/mace/public/*.h ${LIBMACE_BUILD_DIR}/include/mace/public/ if [ x"${TARGET_ABI}" = x"armeabi-v7a" ]; then
cp ${MACE_SOURCE_DIR}/mace/core/runtime/hexagon/libhexagon_controller.so ${LIBMACE_BUILD_DIR}/hexagon/ cp ${MACE_SOURCE_DIR}/mace/core/runtime/hexagon/libhexagon_controller.so ${LIBMACE_BUILD_DIR}/${TARGET_ABI}/
fi
LIBMACE_TEMP_DIR=`mktemp -d -t libmace.XXXX` LIBMACE_TEMP_DIR=`mktemp -d -t libmace.XXXX`
......
#!/bin/bash
Usage() {
echo "Usage: bash tools/packaging_lib.sh libmace_output_dir"
}
if [ $# -lt 1 ]; then
Usage
exit 1
fi
CURRENT_DIR=`dirname $0`
source ${CURRENT_DIR}/env.sh
LIBMACE_BUILD_DIR=$1
pushd $LIBMACE_BUILD_DIR/$PROJECT_NAME
ls | grep -v build | xargs tar cvzf libmace_${PROJECT_NAME}.tar.gz
popd
echo "Packaging done!"
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册