1 Star 0 Fork 0

HuWen/run_spec2006

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
check_results.sh 8.42 KB
一键复制 编辑 原始数据 按行查看 历史
HuWen 提交于 2022-08-26 16:52 . init with run_spec2017
#!/bin/bash
# check result of benchmark testing
# check_result.sh benchmark_name [test|train|refrate|refspeed]
benchmark=$1
function check_err {
if [ -s "$1" ]; then
echo "benchmark $benchmark testing failed : $1"
return 1
fi
return 0
}
# check_s benchmark test/train/refspeed/refrate s_file_root_name [version]
# default from out/
function check_s {
file1="$CPU/$1/data/$2/output/$3.s"
if [ ! -z $4 ]; then
file2="out/$3.$ARCH.$4.s"
else
file2="out/$3.$ARCH.s"
fi
check_diff $file1 $file2 $2
return $?
}
# check_s benchmark test/train/refspeed/refrate out_file_root_name [version]
# default from out/
function check_out {
file1="$CPU/$1/data/$2/output/$3.out"
if [ ! -z $4 ]; then
file2="out/$3.$ARCH.$4.out"
else
file2="out/$3.$ARCH.out"
fi
check_diff $file1 $file2 $2
return $?
}
# check_diff expected my_output
function check_diff {
diff -uwb $1 $2 > $2.diff
if [ -s "$2.diff" ]; then
echo "benchmark $benchmark check $1 $2 failed: $2.diff"
return 1
fi
return 0
}
# check_diff expected my_output
function check_diff_binary {
cmp $1 $2 > $2.diff
if [ -s "$2.diff" ]; then
echo "benchmark $benchmark check $1 $2 failed: $2.diff"
return 1
fi
return 0
}
#result=`diff $SPEC/ `
CPU=$SPEC/benchspec/CPU
function check_test {
result=""
case $benchmark in
600.perlbench_s )
#for file in makerand test
#do
#done
file=makerand
check_err $file.$ARCH.err
result+=$?
check_out 500.perlbench_r test $file
result+=$?
file=test
check_err $file.$ARCH.err
result+=$?
# TODO: mark 2 cases as ok, they failed the same way under x86arm
sed -e "s/FAILED at test 8/ok/" -e "s/FAILED at test 33/ok/" -e "s/^.op.filetest.t$/All tests successful./" -e "/^.op.stat.t$/d" out/$file.$ARCH.out > out/$file.$ARCH.1.out
check_out 500.perlbench_r test $file 1
result+=$?
;;
602.gcc_s )
sed "/warning:/d" out/t1.opts-O3_-finline-limit_50000.$ARCH.err > out/t1.opts-O3_-finline-limit_50000.$ARCH.1.err
check_err out/t1.opts-O3_-finline-limit_50000.$ARCH.1.err
result+=$?
check_s 502.gcc_r test t1.opts-O3_-finline-limit_50000
result+=$?
;;
605.mcf_s )
check_err out/tst_inp.$ARCH.err
result+=$?
cp out/tst_inp.$ARCH.out out/inp.$ARCH.1.out
check_out 505.mcf_r test inp 1
result+=$?
;;
625.x264_s )
# compare with x85arm gcc results
result_x86arm=$SPEC/tests/625.x264_s/TST_01_x86arm
output=out/TST_01_$ARCH
for file in BuckBunny_New.264 frame_0.yuv frame_100.yuv frame_150.yuv frame_155.yuv frame_50.yuv run_000-156_x264.err run_000-156_x264.out
do
check_diff_binary $result_x86arm/$file $output/$file
result+=$?
done
;;
657.xz_s )
for v in 4-0 4-1 4-2 4-3e 4-4 4-4e 1-0 1-1 1-2 1-3e 1-4 1-4e
do
file=cpu2006docs.tar-$v
sed "/^Compressed/d" out/$file.$ARCH.err > out/$file.$ARCH.1.err
check_err out/$file.$ARCH.1.err
result+=$?
sed "s/\/usr.*input\///" out/$file.$ARCH.out > out/$file.$ARCH.1.out
check_out 557.xz_r test $file 1 # last 1 indicates $ARCH.1.out
result+=$?
done
;;
esac
# check result
final_result=`echo "$result" | sed "s/0//g"`
cases=${#result}
if [ ! -z "$final_result" ]; then
echo "benchmark $benchmark $cases test result checking failed: $result"
exit 1
else
if [ $cases != 0 ]; then
echo "benchmark $benchmark $cases test result checking passed"
else
echo "benchmark $benchmark no test tests"
fi
fi
}
function check_train {
result=""
case $benchmark in
600.perlbench_s )
for file in diffmail.2.550.15.24.23.100 perfect.b.3 scrabbl splitmail.535.13.25.24.1091.1 suns
do
check_err out/$file.$ARCH.err
result+=$?
check_out 500.perlbench_r train $file
result+=$?
done
check_diff $CPU/500.perlbench_r/data/train/output/validate validate
result+=$?
;;
602.gcc_s )
kind=opts-O3_-finline-limit_50000
for file in 200 scilab train01
do
check_err out/$file.$kind.$ARCH.err
result+=$?
check_s 502.gcc_r train $file.$kind
result+=$?
done
;;
605.mcf_s )
check_err out/trn_inp.$ARCH.err
result+=$?
cp out/trn_inp.$ARCH.out out/inp.$ARCH.2.out
check_out 505.mcf_r train inp 2
result+=$?
;;
625.x264_s )
# compare with x85arm gcc results
result_x86arm=$SPEC/tests/625.x264_s/TRN_01_x86arm
output=out/TRN_01_$ARCH
for file in BuckBunny_New.264 frame_0.yuv frame_100.yuv frame_141.yuv frame_50.yuv run_000-142_x264.err run_000-142_x264.out
do
check_diff_binary $result_x86arm/$file $output/$file
result+=$?
done
;;
657.xz_s )
for file in input.combined-40-8 IMG_2560.cr2-40-4
do
sed "/^Compressed/d" out/$file.$ARCH.err > out/$file.$ARCH.1.err
check_err out/$file.$ARCH.1.err
result+=$?
sed "s/\/usr.*input\///" out/$file.$ARCH.out > out/$file.$ARCH.1.out
check_out 557.xz_r train $file 1 # last 1 indicates $ARCH.1.out
result+=$?
done
;;
esac
# check result
final_result=`echo "$result" | sed "s/0//g"`
cases=${#result}
if [ ! -z "$final_result" ]; then
echo "benchmark $benchmark $cases train result checking failed: $result"
exit 1
else
if [ $cases != 0 ]; then
echo "benchmark $benchmark $cases train result checking passed"
else
echo "benchmark $benchmark no train tests"
fi
fi
}
function check_refspeed {
result=""
case $benchmark in
600.perlbench_s )
;;
602.gcc_s )
for kind in opts-O5_-fipa-pta opts-O5_-finline-limit_1000_-fselective-scheduling_-fselective-scheduling2 opts-O5_-finline-limit_24000_-fgcse_-fgcse-las_-fgcse-lm_-fgcse-sm
do
check_err out/gcc-pp.$kind.$ARCH.err
result+=$?
check_s 502.gcc_r refspeed gcc-pp.$kind
result+=$?
done
;;
605.mcf_s )
check_err out/refs_inp.$ARCH.err
result+=$?
cp out/refs_inp.$ARCH.out out/inp.$ARCH.3.out
check_out 505.mcf_r test inp 3
result+=$?
;;
625.x264_s )
# compare with x85arm gcc results
result_x86arm=$SPEC/tests/625.x264_s/REFS_x86arm
output=out/REFS_$ARCH
for file in frame_1100.yuv frame_500.yuv frame_900.yuv refs02_BuckBunny_New.264 run_000-1000_x264_pass1.err run_000-1000_x264_pass2.err run_0500-1250_x264.err x264_stats.log frame_1249.yuv frame_700.yuv refs01_BuckBunny_New.264 refs03_BuckBunny_New.264 run_000-1000_x264_pass1.out run_000-1000_x264_pass2.out run_0500-1250_x264.out x264_stats.log.mbtree
do
echo check_diff_binary $result_x86arm/$file $output/$file
check_diff_binary $result_x86arm/$file $output/$file
result+=$?
done
;;
657.xz_s )
for file in cpu2006docs.tar-6643-4 cld.tar-1400-8
do
sed "/^Compressed/d" out/$file.$ARCH.err > out/$file.$ARCH.1.err
check_err out/$file.$ARCH.1.err
result+=$?
sed "s/\/usr.*input\///" out/$file.$ARCH.out > out/$file.$ARCH.1.out
check_out 557.xz_r refspeed $file 1 # last 1 indicates $ARCH.1.out
result+=$?
done
;;
esac
# check result
final_result=`echo "$result" | sed "s/0//g"`
cases=${#result}
if [ ! -z "$final_result" ]; then
echo "benchmark $benchmark refspeed result checking failed"
exit 1
else
if [ $cases != 0 ]; then
echo "benchmark $benchmark refspeed result checking passed"
else
echo "benchmark $benchmark no refspeed tests"
fi
fi
}
function check_refrate {
result=""
case $benchmark in
600.perlbench_s )
for file in checkspam.2500.5.25.11.150.1.1.1.1 diffmail.4.800.10.17.19.300 splitmail.6400.12.26.16.100.0
do
check_err out/$file.$ARCH.err
result+=$?
check_out 500.perlbench_r refrate $file
result+=$?
done
;;
602.gcc_s )
;;
605.mcf_s )
;;
625.x264_s )
;;
657.xz_s )
;;
esac
# check result
final_result=`echo "$result" | sed "s/0//g"`
cases=${#result}
if [ ! -z "$final_result" ]; then
echo "benchmark $benchmark refrate result checking failed"
exit 1
else
if [ $cases != 0 ]; then
echo "benchmark $benchmark refrate result checking passed"
else
echo "benchmark $benchmark no refrate tests"
fi
fi
}
check_$2
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Shell
1
https://gitee.com/hu-_-wen/run_spec2006.git
git@gitee.com:hu-_-wen/run_spec2006.git
hu-_-wen
run_spec2006
run_spec2006
master

搜索帮助