From 0c55356415d30eae621e4aacf1a6505fa0aac505 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Thu, 1 Aug 2024 16:24:05 +0200 Subject: [PATCH 1/3] for OSBA, only measure complexity for HOA3 modes --- ci/complexity_measurements/getWmops.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ci/complexity_measurements/getWmops.sh b/ci/complexity_measurements/getWmops.sh index a3d4710f2c..c58fce6b04 100755 --- a/ci/complexity_measurements/getWmops.sh +++ b/ci/complexity_measurements/getWmops.sh @@ -55,8 +55,15 @@ wmopsFilenameFlc=${destDir}/wmops/logs/${wmopsFilenameFlcLast} ret_val=0 +mode_arg="" +# for OSBA, there are just too many modes... -> only select HOA3 ones +if [ "$ivas_format" == "OSBA" ]; then + osba_hoa3_modes=$(./scripts/runIvasCodec.py -C OSBA -l | grep "HOA3") + mode_arg="-m $osba_hoa3_modes" +fi + # instrument and build -./scripts/IvasBuildAndRunChecks.py -p $config_file --checks COMPLEXITY --create_complexity_tables ${wmopsFilenameFlc} -C $ivas_format -f ${ep} --oc $output_format +./scripts/IvasBuildAndRunChecks.py -p $config_file --checks COMPLEXITY --create_complexity_tables ${wmopsFilenameFlc} -C $ivas_format $mode_arg -f ${ep} --oc $output_format ret_val=$? # get the info on worst-case operating point: WMOPS number, enc-operating mode, dec-operating mode -- GitLab From cfd3b03a3e87aa84ee814c7a96fb7d1314874a28 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Mon, 5 Aug 2024 10:56:30 +0200 Subject: [PATCH 2/3] remove job from list that is no longer there --- ci/setup_pages.py | 1 - 1 file changed, 1 deletion(-) diff --git a/ci/setup_pages.py b/ci/setup_pages.py index 1ae20c1043..e810047c90 100755 --- a/ci/setup_pages.py +++ b/ci/setup_pages.py @@ -21,7 +21,6 @@ JOBS_FLOAT_REPO = { # current ones "complexity-stereo-in-ext-out": "Stereo in, EXT out", "complexity-ism-in-binaural_room_reverb-out": "ISM in, BINAURAL_ROOM_REVERB out", - "complexity-ism-in-binaural-out": "ISM in, BINAURAL out", "complexity-ism-in-ext-out": "ISM in, EXT out", "complexity-sba-hoa3-in-ext-out": "HOA3 in, EXT out", "complexity-sba-hoa3-in-binaural_room_ir-out": "HOA3 in, BINAURAL_ROOM_IR out", -- GitLab From 0beb1e08b6b1223c2ccec98f8c2a941a029b538d Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Mon, 5 Aug 2024 14:49:49 +0200 Subject: [PATCH 3/3] add arguments for prepare_instrumentation for BASOP measurements --- scripts/prepare_instrumentation.sh | 121 ++++++++++++++++++----------- 1 file changed, 74 insertions(+), 47 deletions(-) diff --git a/scripts/prepare_instrumentation.sh b/scripts/prepare_instrumentation.sh index d0fa9e41ff..281b4fba87 100755 --- a/scripts/prepare_instrumentation.sh +++ b/scripts/prepare_instrumentation.sh @@ -33,31 +33,48 @@ function usage { echo echo "Usage:" - echo " prepare_instrumentation.sh [MODE]" + echo " $(basename $0) [OPTIONS]" echo - echo " MODE - full (default) or mem_only" + echo " -m MODE one of [FULL|MEM_ONLY]" + echo " -p PROJECT one of [FLOAT|BASOP]" exit } -wmc_opt="" -if [ $# -eq 1 ]; then - mode=$1 - if [ "$mode" = "full" ]; then - wmc_opt="" - elif [ "$mode" = "mem_only" ]; then - wmc_opt="-s" - else - echo "Invalid input for MODE" + +# default values +MODE="FULL" +PROJECT="FLOAT" + +while getopts "m:p:h" OPTIONS; do + case ${OPTIONS} in + m) + MODE=${OPTARG^^} + if [ "$MODE" != "FULL" && "$MODE" != "MEM_ONLY" ]; then + usage + fi + ;; + p) + PROJECT=${OPTARG^^} + if [ "$PROJECT" != "FLOAT" && "$PROJECT" != "BASOP" ]; then + usage + fi + ;; + h | *) usage - exit 1 - fi -elif [ $# -ge 2 ]; then - usage - exit 1 + ;; + esac +done +shift $((OPTIND-1)) + + +wmc_opt="" +if [ "$MODE" = "MEM_ONLY" ]; then + wmc_opt="-s" fi + system=`uname -s` -if [[ ($system == "Linux") && (`uname -a` =~ (microsoft|Microsoft|wsl|WSL) ) ]]; then +if [[ ($system = "Linux") && (`uname -a` =~ (microsoft|Microsoft|wsl|WSL) ) ]]; then system="Linux" fi @@ -98,32 +115,35 @@ cp -R ../Workspace_msvc $targetdir rm -f $ifdef_list touch $ifdef_list -# Add LC3plus feature defines to options.h so that they are stripped correctly -# Generate list of active defines in LC3plus defines.h -lc3plus_defines=$( - gcc -E -dM $targetdir/lib_lc3plus/defines.h -I $targetdir/lib_com -I $targetdir/lib_debug | - sed '/^#define [[:alnum:]][[:alnum:]_]\+[[:space:]]*$/! d' | - sed '/#define DEFINES_H/ d' -) - -# Filter defines that come from outside of the header lib_lc3plus/defines.h -lc3plus_defines_filtered="" -while IFS=' \n' read -r line; -do - line=`echo $line | tr -d '\n'` - if grep -wqF "$line" "$targetdir/lib_lc3plus/defines.h"; then - lc3plus_defines_filtered+=$line$'\n' - fi -done <<< $lc3plus_defines - -# Append LC3plus defines to options.h -echo " -/* LC3plus switches */ -#ifndef OPTIONS_H_LC3_DEFINES -#define OPTIONS_H_LC3_DEFINES -$lc3plus_defines_filtered -#endif /* OPTIONS_H_LC3_DEFINES */ -" >>$targetdir/lib_com/options.h +# LC3plus-related stuff -> only in float code +if [ "$PROJECT" = "FLOAT" ]; then + # Add LC3plus feature defines to options.h so that they are stripped correctly + # Generate list of active defines in LC3plus defines.h + lc3plus_defines=$( + gcc -E -dM $targetdir/lib_lc3plus/defines.h -I $targetdir/lib_com -I $targetdir/lib_debug | + sed '/^#define [[:alnum:]][[:alnum:]_]\+[[:space:]]*$/! d' | + sed '/#define DEFINES_H/ d' + ) + + # Filter defines that come from outside of the header lib_lc3plus/defines.h + lc3plus_defines_filtered="" + while IFS=' \n' read -r line; + do + line=`echo $line | tr -d '\n'` + if grep -wqF "$line" "$targetdir/lib_lc3plus/defines.h"; then + lc3plus_defines_filtered+=$line$'\n' + fi + done <<< $lc3plus_defines + + # Append LC3plus defines to options.h + echo " + /* LC3plus switches */ + #ifndef OPTIONS_H_LC3_DEFINES + #define OPTIONS_H_LC3_DEFINES + $lc3plus_defines_filtered + #endif /* OPTIONS_H_LC3_DEFINES */ + " >>$targetdir/lib_com/options.h +fi # get switches from options.h and append it to $ifdef_list parse_options_opt="" @@ -147,8 +167,10 @@ if coan_exists; then coan source --replace --no-transients -E -K --file $ifdef_list $targetdir/lib_{com,dec,enc,isar,rend,util,debug}/!(wmc_auto*).[hc] coan source --replace --no-transients -E -K --file $ifdef_list $targetdir/apps/*.[hc] - coan source --replace --no-transients -E -K --file $ifdef_list $targetdir/lib_lc3plus/!(wmc_auto*).[hc] - coan source --replace --no-transients -E -K --file $ifdef_list $targetdir/lib_lc3plus/fft/!(wmc_auto*).[hc] + if [ "$PROJECT" = "FLOAT" ]; then + coan source --replace --no-transients -E -K --file $ifdef_list $targetdir/lib_lc3plus/!(wmc_auto*).[hc] + coan source --replace --no-transients -E -K --file $ifdef_list $targetdir/lib_lc3plus/fft/!(wmc_auto*).[hc] + fi else ./strip_defines_cppp.sh $targetdir $ifdef_list fi @@ -160,8 +182,13 @@ find $targetdir -name "*.[ch]" -exec sed -i.bak -e "s/\(0x[0-9a-fA-F]*\)UL/\(\(u # run wmc_tool "tools/$system/wmc_tool" $wmc_opt -m "$targetdir/apps/encoder.c" "$targetdir/lib_enc/*.c" "$targetdir/lib_com/*.c" >> /dev/null "tools/$system/wmc_tool" $wmc_opt -m "$targetdir/apps/decoder.c" "$targetdir/lib_dec/*.c" "$targetdir/lib_rend/*.c" >> /dev/null -"tools/$system/wmc_tool" $wmc_opt -m "$targetdir/apps/renderer.c" "$targetdir/lib_rend/*.c" "$targetdir/lib_lc3plus/*.c" "$targetdir/lib_lc3plus/fft/*.c" >> /dev/null -"tools/$system/wmc_tool" $wmc_opt -m "$targetdir/apps/isar_post_rend.c" "$targetdir/lib_isar/*.c" "$targetdir/lib_lc3plus/*.c" "$targetdir/lib_lc3plus/fft/*.c" >> /dev/null +# ISAR post-renderer and lc3plus sources only need to be instrumented in float code +if [ "$PROJECT" = "FLOAT" ]; then + "tools/$system/wmc_tool" $wmc_opt -m "$targetdir/apps/renderer.c" "$targetdir/lib_rend/*.c" "$targetdir/lib_lc3plus/*.c" "$targetdir/lib_lc3plus/fft/*.c" >> /dev/null + "tools/$system/wmc_tool" $wmc_opt -m "$targetdir/apps/isar_post_rend.c" "$targetdir/lib_isar/*.c" "$targetdir/lib_lc3plus/*.c" "$targetdir/lib_lc3plus/fft/*.c" >> /dev/null +else + "tools/$system/wmc_tool" $wmc_opt -m "$targetdir/apps/renderer.c" "$targetdir/lib_rend/*.c" >> /dev/null +fi # automatically enable #define WMOPS in options.h sed -i.bak -e "s/\/\*[[:space:]]*\(#define[[:space:]]*WMOPS\)[[:space:]]*\*\//\1/g" $targetdir/lib_com/options.h -- GitLab