|
|
|
@@ -1,4 +1,18 @@ |
|
|
|
#!/bin/bash |
|
|
|
# Copyright 2019 Huawei Technologies Co., Ltd |
|
|
|
# |
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
# you may not use this file except in compliance with the License. |
|
|
|
# You may obtain a copy of the License at |
|
|
|
# |
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0 |
|
|
|
# |
|
|
|
# Unless required by applicable law or agreed to in writing, software |
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS, |
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
|
|
# See the License for the specific language governing permissions and |
|
|
|
# limitations under the License. |
|
|
|
# ============================================================================ |
|
|
|
|
|
|
|
function Run_Converter() { |
|
|
|
cd ${x86_path} || exit 1 |
|
|
|
@@ -40,14 +54,15 @@ function Run_x86() { |
|
|
|
continue |
|
|
|
fi |
|
|
|
echo ${model_name} >> "${run_x86_log_file}" |
|
|
|
${CODEGEN_PATH}/codegen --codePath=${build_path} --modelPath=${ms_models_path}/${model_name}.ms |
|
|
|
${CODEGEN_PATH}/codegen --codePath=${build_path} --modelPath=${ms_models_path}/${model_name}.ms >> ${run_x86_log_file} |
|
|
|
# 1. build benchmark |
|
|
|
mkdir -p ${build_path}/${model_name}/build && cd ${build_path}/${model_name}/build || exit 1 |
|
|
|
cmake -DPKG_PATH=${x86_path}/mindspore-lite-${version}-inference-linux-x64 ${build_path}/${model_name} |
|
|
|
make |
|
|
|
cmake -DPKG_PATH=${x86_path}/mindspore-lite-${version}-inference-linux-x64 ${build_path}/${model_name} >> ${run_x86_log_file} |
|
|
|
make >> ${run_x86_log_file} |
|
|
|
# 2. run benchmark |
|
|
|
echo "net file: ${build_path}/${model_name}/src/net.bin" |
|
|
|
./benchmark ${models_path}/input_output/input/${model_name}.ms.bin ${build_path}/${model_name}/src/net.bin 1 ${models_path}/input_output/output/${model_name}.ms.out |
|
|
|
echo "net file: ${build_path}/${model_name}/src/net.bin" >> ${run_x86_log_file} |
|
|
|
echo "./benchmark ${models_path}/input_output/input/${model_name}.ms.bin ${build_path}/${model_name}/src/net.bin 1 ${models_path}/input_output/output/${model_name}.ms.out" >> ${run_x86_log_file} |
|
|
|
./benchmark ${models_path}/input_output/input/${model_name}.ms.bin ${build_path}/${model_name}/src/net.bin 1 ${models_path}/input_output/output/${model_name}.ms.out >> ${run_x86_log_file} |
|
|
|
if [ $? = 0 ]; then |
|
|
|
run_result='x86: '${model_name}' pass'; echo ${run_result} >> ${run_benchmark_result_file} |
|
|
|
else |
|
|
|
|