diff --git a/main-basop.yml b/main-basop.yml index 0f4a95eaaa79956c70e69fd42d8317a299ab0f27..513ec2d302841a31dc2f1bf025251223f853ffea 100644 --- a/main-basop.yml +++ b/main-basop.yml @@ -121,6 +121,14 @@ variables: - 'test-long-self-test' - 'check-regressions-long' - 'ivas-conformance-linux' + OPTIMIZATION_LEVEL: + description: "Set level of optimization for the build (only of BASOP code, float always uses -O0). Default is 0 (no opt)" + value: "0" + options: + - "0" + - "1" + - "2" + - "3" # This sets when pipelines are created. Jobs have more specific rules to restrict them. workflow: @@ -363,7 +371,21 @@ workflow: - if [ "$DELTA_ODG" = "true" ]; then comp_args="${comp_args} --odg_bin"; MEASURES_FOR_REPORT="$MEASURES_FOR_REPORT DELTA_ODG"; fi - if [ "$SPLIT_COMPARISON" = "true" ]; then comp_args="${comp_args} --split-comparison"; fi - - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/build-and-create-float-ref-outputs.sh + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/build-binaries.sh float-ref + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/build-binaries.sh dut + - python3 tests/create_short_testvectors.py + + - enc_stats_arg="" + - | + if [ "$ENCODER_TEST" = "true" ]; then + enc_stats_arg="--enc_stats" + fi + - enc_dmx_arg="" + - | + if [ "$COMPARE_DMX" = "true" ]; then + enc_dmx_arg="--compare_enc_dmx" + fi + - python3 -m pytest $TEST_SUITE --update_ref 1 $enc_stats_arg $enc_dmx_arg --create_ref -n auto --ref_encoder_path $REF_ENCODER_PATH --ref_decoder_path $REF_DECODER_PATH --dut_encoder_path $DUT_ENCODER_PATH --dut_decoder_path $DUT_DECODER_PATH || true # DMX comparison only in manual job with no other metrics - if [ "$COMPARE_DMX" = "true" ]; then @@ -777,9 +799,9 @@ workflow: # build merge target branch and correpsonding float reference - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/build-binaries.sh float-ref - - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/build-binaries.sh merge-target + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/build-binaries.sh merge-target $OPTIMIZATION_LEVEL # build to-be-merged branch and corresponding float ref branch - - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/build-binaries.sh dut + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/build-binaries.sh dut $OPTIMIZATION_LEVEL - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/build-binaries.sh float-ref-merge-source # set pytest args for ref creation @@ -886,7 +908,7 @@ workflow: - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/apply-testv-scaling.sh - fi - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/build-binaries.sh float-ref - - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/build-binaries.sh dut + - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/build-binaries.sh dut $OPTIMIZATION_LEVEL - comp_args="--mld --ssnr --odg --mld-playback-level $MLD_PLAYBACK_LEVEL" diff --git a/snippets/basop/build-and-create-float-ref-outputs.sh b/snippets/basop/build-and-create-float-ref-outputs.sh deleted file mode 100644 index b916dffffae86b46dbefc00f755a4e14914ce40d..0000000000000000000000000000000000000000 --- a/snippets/basop/build-and-create-float-ref-outputs.sh +++ /dev/null @@ -1,28 +0,0 @@ -#! /bin/bash - -set -euxo pipefail - -cd "${CI_PROJECT_DIR}" - -bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/build-binaries.sh float-ref - -bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/build-binaries.sh dut - -### prepare pytest -# create short test vectors -python3 tests/create_short_testvectors.py - -# create references -exit_code=0 - -enc_stats_arg="" -if [ "$ENCODER_TEST" = "true" ]; then - enc_stats_arg="--enc_stats" -fi - -enc_dmx_arg="" -if [ "$COMPARE_DMX" = "true" ]; then - enc_dmx_arg="--compare_enc_dmx" -fi - -python3 -m pytest $TEST_SUITE --update_ref 1 $enc_stats_arg $enc_dmx_arg --create_ref -n auto --ref_encoder_path $REF_ENCODER_PATH --ref_decoder_path $REF_DECODER_PATH --dut_encoder_path $DUT_ENCODER_PATH --dut_decoder_path $DUT_DECODER_PATH || exit_code=$? diff --git a/snippets/basop/build-binaries.sh b/snippets/basop/build-binaries.sh index 64ecc54e75f7bfc19095210ca0a354cf622d30fa..a5075974a5bc2e45233576db13dd5b0d67a8b57e 100755 --- a/snippets/basop/build-binaries.sh +++ b/snippets/basop/build-binaries.sh @@ -1,8 +1,20 @@ #! /bin/bash +# helper script for building various typical configurations +# Usage: build-binaries.sh mode(float-ref|float-ref-merge-source|merge-target|dut) optim_level(0|1|2|3) + set -euxo pipefail mode="${1:-}" +optim_level="${2:-0}" + +case "$optim_level" in +0 | 1 | 2 | 3) ;; +*) + echo "Error: invalid optim_level: $optim_level (allowed: 0,1,2,3)" + exit 2 + ;; +esac case "$mode" in float-ref) @@ -77,7 +89,7 @@ git checkout "$ref_to_check_out" bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/basop/activate-debug-mode-info-if-set.sh make clean -make -j "$(nproc)" 2>&1 >$make_log_file +OPTIM=$optim_level make -j "$(nproc)" 2>&1 >$make_log_file # avoid errors in mv when renaming to same file mv IVAS_cod "${CI_PROJECT_DIR}/${ivas_cod_filename}"