diff --git a/scripts/benchmark/README.md b/scripts/benchmark/README.md index ddb6dcb0187e5bdb995c959a18e8ea56e410c963..55798ea71f0af156cf04a5cb6bbb989b741f675c 100644 --- a/scripts/benchmark/README.md +++ b/scripts/benchmark/README.md @@ -40,11 +40,12 @@ Then push the test binaries to the phone (replace 9A9A9A9A with your actual devi ``` ADB=adb ANDROID_SERIAL=9A9A9A9A ./push.sh ``` -Now you can run the benchmark set: +Now you can run the benchmark set for a given resolution: ``` -adb -s 9A9A9A9A shell /data/local/tmp/run_benchmarks_FHD.sh >your_phone_benchmarks_FHD.tsv -adb -s 9A9A9A9A shell /data/local/tmp/run_benchmarks_4K.sh >your_phone_benchmarks_4K.tsv +adb -s 9A9A9A9A shell 'RESOLUTION=FHD /data/local/tmp/run_benchmarks.sh' > your_phone_benchmarks_FHD.tsv ``` -To run on another core than BIG (CPU=7), set CPU and THERMAL to the desired value. -To find the correct thermal zone id, it's best to log /sys/devices/virtual/thermal/thermal_zone0/type and see what's dumped. -E.g. it can be BIG for 0, MID for 1 and LITTLE for 2, but it can be different for another phone. +To run on another core, set CPU and THERMAL_ZONE_ID to the desired values. THERMAL_ZONE_ID is important +to set correctly because benchmarks scripts check for changes of the temperature associated with selected CPU. +To find the correct thermal zone id, it's best to cat /sys/devices/virtual/thermal/thermal_zone${id}/type to find +the appropriate thermal zone identifier. E.g. it can be BIG for 0, MID for 1 and LITTLE for 2, +but it can be different for another device. diff --git a/scripts/benchmark/benchmarks.txt b/scripts/benchmark/benchmarks.txt new file mode 100755 index 0000000000000000000000000000000000000000..d40d2dd9c008d784ede509085990aa5d495a28ef --- /dev/null +++ b/scripts/benchmark/benchmarks.txt @@ -0,0 +1,82 @@ +# SPDX-FileCopyrightText: 2024 Arm Limited and/or its affiliates +# +# SPDX-License-Identifier: Apache-2.0 + +GRAY2BGR: opencv_perf_imgproc '*cvtColor8u/*' '($PIXEL_FORMAT, COLOR_GRAY2BGR)' +GRAY2BGRA: opencv_perf_imgproc '*cvtColor8u/*' '($PIXEL_FORMAT, COLOR_GRAY2BGRA)' + +BGR2RGB: opencv_perf_imgproc '*cvtColor8u/*' '($PIXEL_FORMAT, COLOR_BGR2RGB)' +BGRA2RGBA: opencv_perf_imgproc '*cvtColor8u/*' '($PIXEL_FORMAT, COLOR_BGRA2RGBA)' +BGR2RGBA: opencv_perf_imgproc '*cvtColor8u/*' '($PIXEL_FORMAT, COLOR_BGR2RGBA)' +BGR2BGRA: opencv_perf_imgproc '*cvtColor8u/*' '($PIXEL_FORMAT, COLOR_BGR2BGRA)' +RGBA2BGR: opencv_perf_imgproc '*cvtColor8u/*' '($PIXEL_FORMAT, COLOR_RGBA2BGR)' +BGRA2BGR: opencv_perf_imgproc '*cvtColor8u/*' '($PIXEL_FORMAT, COLOR_BGRA2BGR)' + +YUVSP2BGR: opencv_perf_imgproc '*cvtColorYUV420/*' '($PIXEL_FORMAT, COLOR_YUV2BGR_NV12)' +YUVSP2BGRA: opencv_perf_imgproc '*cvtColorYUV420/*' '($PIXEL_FORMAT, COLOR_YUV2BGRA_NV12)' +YUVSP2RGB: opencv_perf_imgproc '*cvtColorYUV420/*' '($PIXEL_FORMAT, COLOR_YUV2RGB_NV12)' +YUVSP2RGBA: opencv_perf_imgproc '*cvtColorYUV420/*' '($PIXEL_FORMAT, COLOR_YUV2RGBA_NV12)' + +RGB2YUV: opencv_perf_imgproc '*cvtColor8u/*' '($PIXEL_FORMAT, COLOR_RGB2YUV)' +BGR2YUV: opencv_perf_imgproc '*cvtColor8u/*' '($PIXEL_FORMAT, COLOR_BGR2YUV)' +RGBA2YUV: opencv_perf_imgproc '*cvtColor8u/*' '($PIXEL_FORMAT, CX_RGBA2YUV)' +BGRA2YUV: opencv_perf_imgproc '*cvtColor8u/*' '($PIXEL_FORMAT, CX_BGRA2YUV)' + +YUV2RGB: opencv_perf_imgproc '*cvtColor8u/*' '($PIXEL_FORMAT, COLOR_YUV2RGB)' +YUV2BGR: opencv_perf_imgproc '*cvtColor8u/*' '($PIXEL_FORMAT, COLOR_YUV2BGR)' + +BinaryThreshold: opencv_perf_imgproc '*ThreshFixture_Threshold.Threshold/*' '($PIXEL_FORMAT, 8UC1, THRESH_BINARY)' + +SepFilter2D_5x5_U8: opencv_perf_imgproc '*KleidiCV_SepFilter2D.SepFilter2D/*' '($PIXEL_FORMAT, 8UC1, 5, BORDER_REPLICATE)' +SepFilter2D_5x5_U16: opencv_perf_imgproc '*KleidiCV_SepFilter2D.SepFilter2D/*' '($PIXEL_FORMAT, 16UC1, 5, BORDER_REPLICATE)' +SepFilter2D_5x5_S16: opencv_perf_imgproc '*KleidiCV_SepFilter2D.SepFilter2D/*' '($PIXEL_FORMAT, 16SC1, 5, BORDER_REPLICATE)' + +GaussianBlur3x3: opencv_perf_imgproc '*gaussianBlur3x3/*' '($PIXEL_FORMAT, 8UC1, BORDER_REPLICATE)' +GaussianBlur5x5: opencv_perf_imgproc '*gaussianBlur5x5/*' '($PIXEL_FORMAT, 8UC1, BORDER_REPLICATE)' +GaussianBlur7x7: opencv_perf_imgproc '*gaussianBlur7x7/*' '($PIXEL_FORMAT, 8UC1, BORDER_REPLICATE)' +GaussianBlur15x15: opencv_perf_imgproc '*gaussianBlur15x15/*' '($PIXEL_FORMAT, 8UC1, BORDER_REPLICATE)' + +GaussianBlur3x3_CustomSigma: opencv_perf_imgproc '*gaussianBlur3x3_CustomSigma/*' '($PIXEL_FORMAT, 8UC1, BORDER_REPLICATE)' +GaussianBlur5x5_CustomSigma: opencv_perf_imgproc '*gaussianBlur5x5_CustomSigma/*' '($PIXEL_FORMAT, 8UC1, BORDER_REPLICATE)' +GaussianBlur7x7_CustomSigma: opencv_perf_imgproc '*gaussianBlur7x7_CustomSigma/*' '($PIXEL_FORMAT, 8UC1, BORDER_REPLICATE)' +GaussianBlur15x15_CustomSigma: opencv_perf_imgproc '*gaussianBlur15x15_CustomSigma/*' '($PIXEL_FORMAT, 8UC1, BORDER_REPLICATE)' + +Sobel_Gx: opencv_perf_imgproc '*Border3x3_sobelFilter.sobelFilter/*' '($PIXEL_FORMAT, 16SC1, (1, 0), BORDER_REPLICATE)' +Sobel_Gy: opencv_perf_imgproc '*Border3x3_sobelFilter.sobelFilter/*' '($PIXEL_FORMAT, 16SC1, (0, 1), BORDER_REPLICATE)' + +Dilate3x3: opencv_perf_imgproc '*Dilate_big.big/*' '($PIXEL_FORMAT, 8UC1, 3)' +Dilate5x5: opencv_perf_imgproc '*Dilate_big.big/*' '($PIXEL_FORMAT, 8UC1, 5)' +Dilate17x17: opencv_perf_imgproc '*Dilate_big.big/*' '($PIXEL_FORMAT, 8UC1, 17)' +Erode3x3: opencv_perf_imgproc '*Erode_big.big/*' '($PIXEL_FORMAT, 8UC1, 3)' +Erode5x5: opencv_perf_imgproc '*Erode_big.big/*' '($PIXEL_FORMAT, 8UC1, 5)' +Erode17x17: opencv_perf_imgproc '*Erode_big.big/*' '($PIXEL_FORMAT, 8UC1, 17)' + +Resize_0.5_8b: opencv_perf_imgproc '*ResizeAreaFast/*' '(8UC1, $PIXEL_FORMAT, 2)' + +Scale: opencv_perf_core '*convertTo/*' '($PIXEL_FORMAT, 8UC1, 8UC1, 1, 1.234, 4.567)' +Scale_float_1.0: opencv_perf_core '*convertTo/*' '($PIXEL_FORMAT, 32FC1, 32FC1, 1, 1, 4.567)' +Scale_float: opencv_perf_core '*convertTo/*' '($PIXEL_FORMAT, 32FC1, 32FC1, 1, 1.234, 4.567)' + +MinMax_S8: opencv_perf_core '*minMaxVals/*' '($PIXEL_FORMAT, 8SC1)' +MinMax_U8: opencv_perf_core '*minMaxVals/*' '($PIXEL_FORMAT, 8UC1)' +MinMax_S16: opencv_perf_core '*minMaxVals/*' '($PIXEL_FORMAT, 16SC1)' +MinMax_U16: opencv_perf_core '*minMaxVals/*' '($PIXEL_FORMAT, 16UC1)' +MinMax_S32: opencv_perf_core '*minMaxVals/*' '($PIXEL_FORMAT, 32SC1)' +MinMax_F32: opencv_perf_core '*minMaxVals/*' '($PIXEL_FORMAT, 32FC1)' + +MinMaxLoc_U8: opencv_perf_core '*minMaxLoc/*' '($PIXEL_FORMAT, 8UC1)' + +FloatToInt: opencv_perf_core '*convertTo/*' '($PIXEL_FORMAT, 32FC1, 8SC1, 1, 1, 0)' +FloatToUint: opencv_perf_core '*convertTo/*' '($PIXEL_FORMAT, 32FC1, 8UC1, 1, 1, 0)' +IntToFloat: opencv_perf_core '*convertTo/*' '($PIXEL_FORMAT, 8SC1, 32FC1, 1, 1, 0)' +UintToFloat: opencv_perf_core '*convertTo/*' '($PIXEL_FORMAT, 8UC1, 32FC1, 1, 1, 0)' + +CompareGt: opencv_perf_core '*compare/*' '($PIXEL_FORMAT, 8UC1, CMP_GT)' + +InRange_U8: opencv_perf_core '*inRangeScalar/*' '($PIXEL_FORMAT, 8UC1, 1, 2)' +InRange_F32: opencv_perf_core '*inRangeScalar/*' '($PIXEL_FORMAT, 32FC1, 1, 2)' + +Remap_S16_U8: opencv_perf_imgproc '*Remap/*' '($PIXEL_FORMAT, 8UC1, 16SC2, INTER_NEAREST, BORDER_REPLICATE)' +Remap_S16Point5_U8: opencv_perf_imgproc '*Remap/*' '($PIXEL_FORMAT, 8UC1, 16SC2, INTER_LINEAR, BORDER_REPLICATE)' + +BlurAndDownsample: opencv_perf_imgproc '*pyrDown/*' '($PIXEL_FORMAT, 8UC1)' diff --git a/scripts/benchmark/benchmarks_4K.txt b/scripts/benchmark/benchmarks_4K.txt new file mode 100644 index 0000000000000000000000000000000000000000..79fd9a3cb081d1f4d64c9b23643e8f27b8556c06 --- /dev/null +++ b/scripts/benchmark/benchmarks_4K.txt @@ -0,0 +1,9 @@ +# SPDX-FileCopyrightText: 2024 Arm Limited and/or its affiliates +# +# SPDX-License-Identifier: Apache-2.0 + +Resize2x2_8b: opencv_perf_imgproc '*resizeUpLinearNonExact/*' '(8UC1, (1920x1080, 3840x2160))' +Resize2x2_float: opencv_perf_imgproc '*resizeUpLinearNonExact/*' '(32FC1, (1920x1080, 3840x2160))' +Resize4x4_8b: opencv_perf_imgproc '*resizeUpLinearNonExact/*' '(8UC1, (960x540, 3840x2160))' +Resize4x4_float: opencv_perf_imgproc '*resizeUpLinearNonExact/*' '(32FC1, (960x540, 3840x2160))' +Resize8x8_float: opencv_perf_imgproc '*resizeUpLinearNonExact/*' '(32FC1, (480x270, 3840x2160))' diff --git a/scripts/benchmark/benchmarks_FHD.txt b/scripts/benchmark/benchmarks_FHD.txt new file mode 100644 index 0000000000000000000000000000000000000000..565bc5af16f2f9308b73c147a3609facb474bd47 --- /dev/null +++ b/scripts/benchmark/benchmarks_FHD.txt @@ -0,0 +1,9 @@ +# SPDX-FileCopyrightText: 2024 Arm Limited and/or its affiliates +# +# SPDX-License-Identifier: Apache-2.0 + +Resize2x2_8b: opencv_perf_imgproc '*resizeUpLinearNonExact/*' '(8UC1, (960x540, 1920x1080))' +Resize2x2_float: opencv_perf_imgproc '*resizeUpLinearNonExact/*' '(32FC1, (960x540, 1920x1080))' +Resize4x4_8b: opencv_perf_imgproc '*resizeUpLinearNonExact/*' '(8UC1, (480x270, 1920x1080))' +Resize4x4_float: opencv_perf_imgproc '*resizeUpLinearNonExact/*' '(32FC1, (480x270, 1920x1080))' +Resize8x8_float: opencv_perf_imgproc '*resizeUpLinearNonExact/*' '(32FC1, (240x135, 1920x1080))' diff --git a/scripts/benchmark/perf_test_op.sh b/scripts/benchmark/perf_test_op.sh index 2ac97e9d588fbceecfd6cb769456b531ce6b96e3..598348f09361126392113c5a78c87d0f02bf14b7 100755 --- a/scripts/benchmark/perf_test_op.sh +++ b/scripts/benchmark/perf_test_op.sh @@ -7,18 +7,18 @@ set -eu CUSTOM_BUILD_SUFFIX=$1 -CPU_NUMBER=$2 +CPU=$2 THERMAL_ZONE_ID=$3 DISP_NAME=$4 PERF_TEST_BINARY_BASENAME=$5 GTEST_FILTER=$6 GTEST_PARAM_FILTER=$7 -DEV_DIR=/data/local/tmp +: "${DEV_DIR:=/data/local/tmp}" -CPU_MASK=$(echo "obase=16;2^${CPU_NUMBER}" | bc) +CPU_MASK=$(echo "obase=16;2^${CPU}" | bc) -FREQ_GOVERNOR_FILE="/sys/devices/system/cpu/cpu${CPU_NUMBER}/cpufreq/scaling_governor" +FREQ_GOVERNOR_FILE="/sys/devices/system/cpu/cpu${CPU}/cpufreq/scaling_governor" PREV_FREQ_GOVERNOR=$(cat "${FREQ_GOVERNOR_FILE}") echo performance > "${FREQ_GOVERNOR_FILE}" @@ -31,13 +31,15 @@ START_CDEV_TRANSITION_COUNT=$(cat "${CDEV_TRANSITION_COUNT_FILE}") THERMAL_ZONE_TEMPERATURE_FILE="${THERMAL_ZONE_DIR}/temp" wait_for_cooldown() { + # shellcheck disable=SC3043 + # Many shells support 'local', therefore this warning is ignored. local cur_tmp cur_tmp=$(cat "${THERMAL_ZONE_TEMPERATURE_FILE}") - if [[ "${cur_tmp}" > 40000 ]]; then + if [ "${cur_tmp}" -gt 40000 ]; then >&2 echo "Too hot (${cur_tmp})! Cooling..." fi - while [[ $(cat "${THERMAL_ZONE_TEMPERATURE_FILE}") > 40000 ]]; do + while [ "$(cat "${THERMAL_ZONE_TEMPERATURE_FILE}")" -gt 40000 ]; do sleep 0.2 done } @@ -46,7 +48,7 @@ FNAME=$$ run_test() { wait_for_cooldown - >&2 taskset ${CPU_MASK} \ + >&2 taskset "${CPU_MASK}" \ "${DEV_DIR}/${PERF_TEST_BINARY_BASENAME}_$1" \ --perf_min_samples=100 \ --gtest_output=json:"${DEV_DIR}/${FNAME}_$1" \ @@ -56,13 +58,13 @@ run_test() { run_test vanilla run_test kleidicv -if [[ -f "${DEV_DIR}/${PERF_TEST_BINARY_BASENAME}_kleidicv_${CUSTOM_BUILD_SUFFIX}" ]]; then +if [ -f "${DEV_DIR}/${PERF_TEST_BINARY_BASENAME}_kleidicv_${CUSTOM_BUILD_SUFFIX}" ]; then run_test "kleidicv_${CUSTOM_BUILD_SUFFIX}" fi echo "${PREV_FREQ_GOVERNOR}" > "${FREQ_GOVERNOR_FILE}" -if [[ "${START_CDEV_TRANSITION_COUNT}" != $(cat "${CDEV_TRANSITION_COUNT_FILE}") ]]; then +if [ "${START_CDEV_TRANSITION_COUNT}" != "$(cat "${CDEV_TRANSITION_COUNT_FILE}")" ]; then >&2 echo "BENCHMARK ERROR: CPU throttling happened, exiting..." exit 1 fi @@ -87,13 +89,13 @@ get_gstddev() { RES="${DISP_NAME}" collect_run_results() { - RES+="\t$(get_mean "${DEV_DIR}/${FNAME}_${1}")\t$(get_gstddev "${DEV_DIR}/${FNAME}_$1")" + RES="${RES}\t$(get_mean "${DEV_DIR}/${FNAME}_${1}")\t$(get_gstddev "${DEV_DIR}/${FNAME}_$1")" rm "${DEV_DIR}/${FNAME}_$1" } collect_run_results vanilla collect_run_results kleidicv -if [[ -f "${DEV_DIR}/${FNAME}_kleidicv_${CUSTOM_BUILD_SUFFIX}" ]]; then +if [ -f "${DEV_DIR}/${FNAME}_kleidicv_${CUSTOM_BUILD_SUFFIX}" ]; then collect_run_results "kleidicv_${CUSTOM_BUILD_SUFFIX}" fi diff --git a/scripts/benchmark/push.sh b/scripts/benchmark/push.sh index a905c56d9b582df243a2e62e7f6960ba17825d91..7043da31b55e1c204d39e27d5d58bd3f35cf1755 100755 --- a/scripts/benchmark/push.sh +++ b/scripts/benchmark/push.sh @@ -23,20 +23,18 @@ BENCHMARK_SCRIPT_PATH="$(realpath "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) BUILD_ROOT_PATH="${BUILD_ROOT_PATH:-"${BENCHMARK_SCRIPT_PATH}/../../build"}" CUSTOM_BUILD_SUFFIX="${CUSTOM_BUILD_SUFFIX:-custom}" -DEV_DIR=/data/local/tmp +: "${DEV_DIR:=/data/local/tmp}" -"${ADB}" push "${BUILD_ROOT_PATH}"/opencv-vanilla/bin/opencv_perf_core ${DEV_DIR}/opencv_perf_core_vanilla -"${ADB}" push "${BUILD_ROOT_PATH}"/opencv-vanilla/bin/opencv_perf_imgproc ${DEV_DIR}/opencv_perf_imgproc_vanilla +"${ADB}" push "${BUILD_ROOT_PATH}"/opencv-vanilla/bin/opencv_perf_core "${DEV_DIR}"/opencv_perf_core_vanilla +"${ADB}" push "${BUILD_ROOT_PATH}"/opencv-vanilla/bin/opencv_perf_imgproc "${DEV_DIR}"/opencv_perf_imgproc_vanilla -"${ADB}" push "${BUILD_ROOT_PATH}"/opencv-kleidicv/bin/opencv_perf_core ${DEV_DIR}/opencv_perf_core_kleidicv -"${ADB}" push "${BUILD_ROOT_PATH}"/opencv-kleidicv/bin/opencv_perf_imgproc ${DEV_DIR}/opencv_perf_imgproc_kleidicv +"${ADB}" push "${BUILD_ROOT_PATH}"/opencv-kleidicv/bin/opencv_perf_core "${DEV_DIR}"/opencv_perf_core_kleidicv +"${ADB}" push "${BUILD_ROOT_PATH}"/opencv-kleidicv/bin/opencv_perf_imgproc "${DEV_DIR}"/opencv_perf_imgproc_kleidicv -if [[ -f "${BUILD_ROOT_PATH}"/opencv-kleidicv-${CUSTOM_BUILD_SUFFIX}/bin/opencv_perf_core ]] && \ - [[ -f "${BUILD_ROOT_PATH}"/opencv-kleidicv-${CUSTOM_BUILD_SUFFIX}/bin/opencv_perf_imgproc ]]; then - "${ADB}" push "${BUILD_ROOT_PATH}"/opencv-kleidicv-${CUSTOM_BUILD_SUFFIX}/bin/opencv_perf_core ${DEV_DIR}/opencv_perf_core_kleidicv_${CUSTOM_BUILD_SUFFIX} - "${ADB}" push "${BUILD_ROOT_PATH}"/opencv-kleidicv-${CUSTOM_BUILD_SUFFIX}/bin/opencv_perf_imgproc ${DEV_DIR}/opencv_perf_imgproc_kleidicv_${CUSTOM_BUILD_SUFFIX} +if [[ -f "${BUILD_ROOT_PATH}"/opencv-kleidicv-"${CUSTOM_BUILD_SUFFIX}"/bin/opencv_perf_core ]] && \ + [[ -f "${BUILD_ROOT_PATH}"/opencv-kleidicv-"${CUSTOM_BUILD_SUFFIX}"/bin/opencv_perf_imgproc ]]; then + "${ADB}" push "${BUILD_ROOT_PATH}"/opencv-kleidicv-"${CUSTOM_BUILD_SUFFIX}"/bin/opencv_perf_core "${DEV_DIR}"/opencv_perf_core_kleidicv_"${CUSTOM_BUILD_SUFFIX}" + "${ADB}" push "${BUILD_ROOT_PATH}"/opencv-kleidicv-"${CUSTOM_BUILD_SUFFIX}"/bin/opencv_perf_imgproc "${DEV_DIR}"/opencv_perf_imgproc_kleidicv_"${CUSTOM_BUILD_SUFFIX}" fi -"${ADB}" push "${BENCHMARK_SCRIPT_PATH}"/perf_test_op.sh ${DEV_DIR}/ -"${ADB}" push "${BENCHMARK_SCRIPT_PATH}"/run_benchmarks_FHD.sh ${DEV_DIR}/ -"${ADB}" push "${BENCHMARK_SCRIPT_PATH}"/run_benchmarks_4K.sh ${DEV_DIR}/ +"${ADB}" push "${BENCHMARK_SCRIPT_PATH}"/perf_test_op.sh "${BENCHMARK_SCRIPT_PATH}"/run_benchmarks.sh "${BENCHMARK_SCRIPT_PATH}"/benchmarks*.txt "${DEV_DIR}"/ diff --git a/scripts/benchmark/run_benchmarks.sh b/scripts/benchmark/run_benchmarks.sh new file mode 100755 index 0000000000000000000000000000000000000000..c5d402ed2af2aed18cc1907004ce04629dedc22b --- /dev/null +++ b/scripts/benchmark/run_benchmarks.sh @@ -0,0 +1,149 @@ +#!/bin/sh + +# SPDX-FileCopyrightText: 2024 Arm Limited and/or its affiliates +# +# SPDX-License-Identifier: Apache-2.0 + +set -eu + +# ------------------------------------------------------------------------------ +# Runs benchmarks described in benchmark specification file(s). +# +# Benchmark specification should follow this pattern: +# : '' '' +# +# The number of spaces is meaningless in the pattern above. Empty lines and +# lines starting with '#' are ignored. +# +# The special word $PIXEL_FORMAT is replaced automatically with an appropriate MxN value +# depending on what RESOLUTION is set to. RESOLUTION defaults to 4K UHD. +# +# By default both the common 'benchmarks.txt' and resolution-specific 'benchmarks<_RES>.txt' +# are run, if exist. +# +# Environment: +# DEV_DIR: Directory on the devicewhere all relevant files are stored. +# Defaults to '/data/local/tmp'. +# CPU: Identifier of the core to run benchmarks on. +# Defaults to '4', which is most often a mid core. +# CUSTOM_BUILD_SUFFIX: Build name suffix for the extra build. +# Defaults to 'custom'. +# RESOLUTION: Sets the resolution to bechmark. See select_resolution() below for +# supported formats. Defaults to 4K. +# THERMAL_ZONE_ID: Identifier of the thermal zone to watch for changes. +# Defaults to '1', which is most often the zone associated with mid cores. +# ------------------------------------------------------------------------------ + +: "${DEV_DIR:=/data/local/tmp}" +: "${CPU:=4}" +: "${CUSTOM_BUILD_SUFFIX:=custom}" +: "${THERMAL_ZONE_ID:=1}" + +# ------------------------------------------------------------------------------ + +# Pixel format in MxN. +PIXEL_FORMAT= +# The number of benchmarks. +NUM_BENCHMARKS=0 +# The current benchmark which is being run. +CURRENT_BENCHMARK=0 + +# ------------------------------------------------------------------------------ + +# Prints a warning message. +# Arguments: +# 1: Message to print. +warn() { + >&2 echo "WARNING: $1" +} + +# Selects which resolution to use. +# Arguments: none +select_resolution() { + if [ -z "${RESOLUTION:-}" ]; then + warn "Resolution is not specified, falling back to 4K UHD." + RESOLUTION="4K" + fi + + case "${RESOLUTION:-}" in + FHD | 1080p) + PIXEL_FORMAT="1920x1080" + ;; + UHD | 4K | 2160p) + PIXEL_FORMAT="3840x2160" + ;; + *) + warn "Resolution is not recognized, falling back to 4K UHD." + RESOLUTION="4K" + PIXEL_FORMAT="3840x2160" + ;; + esac +} + +# Calls a user-supplied function for every benchmark. +# Arguments: +# 1: Path to a benchmark specification. +# 2: Function to call for a benchmark. +foreach_benchmark() { + [ ! -f "${1}" ] && return + + while IFS= read -r line; do + # Skip empty lines + [ -z "${line}" ] && continue + # Skip lines starting with '#' + [ -z "${line%\#*}" ] && continue + + "${2}" "${line}" + done < "${1}" +} + +# Counts the number of benchmarks. +# All arguments are ignored. +count_benchmark() { + NUM_BENCHMARKS=$((NUM_BENCHMARKS+1)) +} + +# Runs a given benchmark. +# Arguments: +# 1: Benchmark specification to run. +run_benchmark() { + # shellcheck disable=SC3043 + # Many shells support 'local', therefore this warning is ignored. + local spec="$1" + + # Replace multiple spaces with one. + spec="$(echo "${spec}" | tr -s ' ')" + + # Resolve $PIXEL_FORMAT + # shellcheck disable=SC3060 + # Targeted shell support string replacement. + spec="${spec//\$PIXEL_FORMAT/${PIXEL_FORMAT}}" + + # Be informative to user. + CURRENT_BENCHMARK=$((CURRENT_BENCHMARK+1)) + >&2 echo RUNNING ["${CURRENT_BENCHMARK}"/"${NUM_BENCHMARKS}"]: "${spec}" + + # shellcheck disable=SC3043 + # Many shells support 'local', therefore this warning is ignored. + local -r disp_name="${spec%%:*}" + + # shellcheck disable=SC2086 + # Word splitting at the end is required here to produce PERF_TEST_BINARY_BASENAME, GTEST_FILTER and GTEST_PARAM_FILTER. + eval "${DEV_DIR}"/perf_test_op.sh "${CUSTOM_BUILD_SUFFIX}" "${CPU}" "${THERMAL_ZONE_ID}" "${disp_name}" ${spec#*:} + >&2 echo +} + +# ------------------------------------------------------------------------------ + +select_resolution + +foreach_benchmark "${DEV_DIR}"/benchmarks.txt count_benchmark +foreach_benchmark "${DEV_DIR}"/benchmarks_"${RESOLUTION}".txt count_benchmark + +# Print tsv header overwriting any existing files. +printf "Operation\tOpenCV\tstd\tKleidiCV\tstd\tKleidiCV_%s\tstd\n" "${CUSTOM_BUILD_SUFFIX}" + +foreach_benchmark "${DEV_DIR}"/benchmarks.txt run_benchmark +foreach_benchmark "${DEV_DIR}"/benchmarks_"${RESOLUTION}".txt run_benchmark + +# ------------------------------------------------------------------------------ diff --git a/scripts/benchmark/run_benchmarks_4K.sh b/scripts/benchmark/run_benchmarks_4K.sh deleted file mode 100755 index 3621944f3a9d530fee65113673459d48f52fadba..0000000000000000000000000000000000000000 --- a/scripts/benchmark/run_benchmarks_4K.sh +++ /dev/null @@ -1,107 +0,0 @@ -#!/bin/sh - -# SPDX-FileCopyrightText: 2024 Arm Limited and/or its affiliates -# -# SPDX-License-Identifier: Apache-2.0 - -set -eu - -DEV_DIR=/data/local/tmp -CPU=7 -THERMAL=0 -CUSTOM_BUILD_SUFFIX="${CUSTOM_BUILD_SUFFIX:-custom}" - -echo "Operation\tOpenCV\tstd\tKleidiCV\tstd\tKleidiCV_$CUSTOM_BUILD_SUFFIX\tstd" - -benchmarks=( - "GRAY2BGR: opencv_perf_imgproc '*cvtColor8u/*' '(3840x2160, COLOR_GRAY2BGR)'" - "GRAY2BGRA: opencv_perf_imgproc '*cvtColor8u/*' '(3840x2160, COLOR_GRAY2BGRA)'" - - "BGR2RGB: opencv_perf_imgproc '*cvtColor8u/*' '(3840x2160, COLOR_BGR2RGB)'" - "BGRA2RGBA: opencv_perf_imgproc '*cvtColor8u/*' '(3840x2160, COLOR_BGRA2RGBA)'" - "BGR2RGBA: opencv_perf_imgproc '*cvtColor8u/*' '(3840x2160, COLOR_BGR2RGBA)'" - "BGR2BGRA: opencv_perf_imgproc '*cvtColor8u/*' '(3840x2160, COLOR_BGR2BGRA)'" - "RGBA2BGR: opencv_perf_imgproc '*cvtColor8u/*' '(3840x2160, COLOR_RGBA2BGR)'" - "BGRA2BGR: opencv_perf_imgproc '*cvtColor8u/*' '(3840x2160, COLOR_BGRA2BGR)'" - - "YUVSP2BGR: opencv_perf_imgproc '*cvtColorYUV420/*' '(3840x2160, COLOR_YUV2BGR_NV12)'" - "YUVSP2BGRA: opencv_perf_imgproc '*cvtColorYUV420/*' '(3840x2160, COLOR_YUV2BGRA_NV12)'" - "YUVSP2RGB: opencv_perf_imgproc '*cvtColorYUV420/*' '(3840x2160, COLOR_YUV2RGB_NV12)'" - "YUVSP2RGBA: opencv_perf_imgproc '*cvtColorYUV420/*' '(3840x2160, COLOR_YUV2RGBA_NV12)'" - - "RGB2YUV: opencv_perf_imgproc '*cvtColor8u/*' '(3840x2160, COLOR_RGB2YUV)'" - "BGR2YUV: opencv_perf_imgproc '*cvtColor8u/*' '(3840x2160, COLOR_BGR2YUV)'" - "RGBA2YUV: opencv_perf_imgproc '*cvtColor8u/*' '(3840x2160, CX_RGBA2YUV)'" - "BGRA2YUV: opencv_perf_imgproc '*cvtColor8u/*' '(3840x2160, CX_BGRA2YUV)'" - - "YUV2RGB: opencv_perf_imgproc '*cvtColor8u/*' '(3840x2160, COLOR_YUV2RGB)'" - "YUV2BGR: opencv_perf_imgproc '*cvtColor8u/*' '(3840x2160, COLOR_YUV2BGR)'" - - "BinaryThreshold: opencv_perf_imgproc '*ThreshFixture_Threshold.Threshold/*' '(3840x2160, 8UC1, THRESH_BINARY)'" - - "SepFilter2D_5x5_U8: opencv_perf_imgproc '*KleidiCV_SepFilter2D.SepFilter2D/*' '(3840x2160, 8UC1, 5, BORDER_REPLICATE)'" - "SepFilter2D_5x5_U16: opencv_perf_imgproc '*KleidiCV_SepFilter2D.SepFilter2D/*' '(3840x2160, 16UC1, 5, BORDER_REPLICATE)'" - "SepFilter2D_5x5_S16: opencv_perf_imgproc '*KleidiCV_SepFilter2D.SepFilter2D/*' '(3840x2160, 16SC1, 5, BORDER_REPLICATE)'" - - "GaussianBlur3x3: opencv_perf_imgproc '*gaussianBlur3x3/*' '(3840x2160, 8UC1, BORDER_REPLICATE)'" - "GaussianBlur5x5: opencv_perf_imgproc '*gaussianBlur5x5/*' '(3840x2160, 8UC1, BORDER_REPLICATE)'" - "GaussianBlur7x7: opencv_perf_imgproc '*gaussianBlur7x7/*' '(3840x2160, 8UC1, BORDER_REPLICATE)'" - "GaussianBlur15x15: opencv_perf_imgproc '*gaussianBlur15x15/*' '(3840x2160, 8UC1, BORDER_REPLICATE)'" - - "GaussianBlur3x3_CustomSigma: opencv_perf_imgproc '*gaussianBlur3x3_CustomSigma/*' '(3840x2160, 8UC1, BORDER_REPLICATE)'" - "GaussianBlur5x5_CustomSigma: opencv_perf_imgproc '*gaussianBlur5x5_CustomSigma/*' '(3840x2160, 8UC1, BORDER_REPLICATE)'" - "GaussianBlur7x7_CustomSigma: opencv_perf_imgproc '*gaussianBlur7x7_CustomSigma/*' '(3840x2160, 8UC1, BORDER_REPLICATE)'" - "GaussianBlur15x15_CustomSigma: opencv_perf_imgproc '*gaussianBlur15x15_CustomSigma/*' '(3840x2160, 8UC1, BORDER_REPLICATE)'" - - "Sobel_Gx: opencv_perf_imgproc '*Border3x3_sobelFilter.sobelFilter/*' '(3840x2160, 16SC1, (1, 0), BORDER_REPLICATE)'" - "Sobel_Gy: opencv_perf_imgproc '*Border3x3_sobelFilter.sobelFilter/*' '(3840x2160, 16SC1, (0, 1), BORDER_REPLICATE)'" - - "Dilate3x3: opencv_perf_imgproc '*Dilate_big.big/*' '(3840x2160, 8UC1, 3)'" - "Dilate5x5: opencv_perf_imgproc '*Dilate_big.big/*' '(3840x2160, 8UC1, 5)'" - "Dilate17x17: opencv_perf_imgproc '*Dilate_big.big/*' '(3840x2160, 8UC1, 17)'" - "Erode3x3: opencv_perf_imgproc '*Erode_big.big/*' '(3840x2160, 8UC1, 3)'" - "Erode5x5: opencv_perf_imgproc '*Erode_big.big/*' '(3840x2160, 8UC1, 5)'" - "Erode17x17: opencv_perf_imgproc '*Erode_big.big/*' '(3840x2160, 8UC1, 17)'" - - "Resize_0.5_8b: opencv_perf_imgproc '*ResizeAreaFast/*' '(8UC1, 3840x2160, 2)'" - "Resize2x2_8b: opencv_perf_imgproc '*resizeUpLinearNonExact/*' '(8UC1, (1920x1080, 3840x2160))'" - "Resize2x2_float: opencv_perf_imgproc '*resizeUpLinearNonExact/*' '(32FC1, (1920x1080, 3840x2160))'" - "Resize4x4_8b: opencv_perf_imgproc '*resizeUpLinearNonExact/*' '(8UC1, (960x540, 3840x2160))'" - "Resize4x4_float: opencv_perf_imgproc '*resizeUpLinearNonExact/*' '(32FC1, (960x540, 3840x2160))'" - "Resize8x8_float: opencv_perf_imgproc '*resizeUpLinearNonExact/*' '(32FC1, (480x270, 3840x2160))'" - - "Scale: opencv_perf_core '*convertTo/*' '(3840x2160, 8UC1, 8UC1, 1, 1.234, 4.567)'" - "Scale_float_1.0: opencv_perf_core '*convertTo/*' '(3840x2160, 32FC1, 32FC1, 1, 1, 4.567)'" - "Scale_float: opencv_perf_core '*convertTo/*' '(3840x2160, 32FC1, 32FC1, 1, 1.234, 4.567)'" - - "MinMax_S8: opencv_perf_core '*minMaxVals/*' '(3840x2160, 8SC1)'" - "MinMax_U8: opencv_perf_core '*minMaxVals/*' '(3840x2160, 8UC1)'" - "MinMax_S16: opencv_perf_core '*minMaxVals/*' '(3840x2160, 16SC1)'" - "MinMax_U16: opencv_perf_core '*minMaxVals/*' '(3840x2160, 16UC1)'" - "MinMax_S32: opencv_perf_core '*minMaxVals/*' '(3840x2160, 32SC1)'" - "MinMax_F32: opencv_perf_core '*minMaxVals/*' '(3840x2160, 32FC1)'" - - "MinMaxLoc_U8: opencv_perf_core '*minMaxLoc/*' '(3840x2160, 8UC1)'" - - "FloatToInt: opencv_perf_core '*convertTo/*' '(3840x2160, 32FC1, 8SC1, 1, 1, 0)'" - "FloatToUint: opencv_perf_core '*convertTo/*' '(3840x2160, 32FC1, 8UC1, 1, 1, 0)'" - "IntToFloat: opencv_perf_core '*convertTo/*' '(3840x2160, 8SC1, 32FC1, 1, 1, 0)'" - "UintToFloat: opencv_perf_core '*convertTo/*' '(3840x2160, 8UC1, 32FC1, 1, 1, 0)'" - - "CompareGt: opencv_perf_core '*compare/*' '(3840x2160, 8UC1, CMP_GT)'" - - "InRange_U8: opencv_perf_core '*inRangeScalar/*' '(3840x2160, 8UC1, 1, 2)'" - "InRange_F32: opencv_perf_core '*inRangeScalar/*' '(3840x2160, 32FC1, 1, 2)'" - - "Remap_S16_U8: opencv_perf_imgproc '*Remap/*' '(3840x2160, 8UC1, 16SC2, INTER_NEAREST, BORDER_REPLICATE)'" - "Remap_S16Point5_U8: opencv_perf_imgproc '*Remap/*' '(3840x2160, 8UC1, 16SC2, INTER_LINEAR, BORDER_REPLICATE)'" - - "BlurAndDownsample: opencv_perf_imgproc '*pyrDown/*' '(3840x2160, 8UC1)'" -) - -for idx in "${!benchmarks[@]}"; do - benchmark="${benchmarks[$idx]}" - >&2 echo - >&2 echo "RUNNING [$((${idx} + 1))/${#benchmarks[@]}]:" ${benchmark%%:*} ${benchmark#*:} - eval "${DEV_DIR}/perf_test_op.sh" "${CUSTOM_BUILD_SUFFIX}" "${CPU}" "${THERMAL}" ${benchmark%%:*} ${benchmark#*:} -done diff --git a/scripts/benchmark/run_benchmarks_FHD.sh b/scripts/benchmark/run_benchmarks_FHD.sh deleted file mode 100755 index 1045bf6721db8f4bbd34e01d986be3c983138a33..0000000000000000000000000000000000000000 --- a/scripts/benchmark/run_benchmarks_FHD.sh +++ /dev/null @@ -1,107 +0,0 @@ -#!/bin/sh - -# SPDX-FileCopyrightText: 2024 Arm Limited and/or its affiliates -# -# SPDX-License-Identifier: Apache-2.0 - -set -eu - -DEV_DIR=/data/local/tmp -CPU=7 -THERMAL=0 -CUSTOM_BUILD_SUFFIX="${CUSTOM_BUILD_SUFFIX:-custom}" - -echo "Operation\tOpenCV\tstd\tKleidiCV\tstd\tKleidiCV_$CUSTOM_BUILD_SUFFIX\tstd" - -benchmarks=( - "GRAY2BGR: opencv_perf_imgproc '*cvtColor8u/*' '(1920x1080, COLOR_GRAY2BGR)'" - "GRAY2BGRA: opencv_perf_imgproc '*cvtColor8u/*' '(1920x1080, COLOR_GRAY2BGRA)'" - - "BGR2RGB: opencv_perf_imgproc '*cvtColor8u/*' '(1920x1080, COLOR_BGR2RGB)'" - "BGRA2RGBA: opencv_perf_imgproc '*cvtColor8u/*' '(1920x1080, COLOR_BGRA2RGBA)'" - "BGR2RGBA: opencv_perf_imgproc '*cvtColor8u/*' '(1920x1080, COLOR_BGR2RGBA)'" - "BGR2BGRA: opencv_perf_imgproc '*cvtColor8u/*' '(1920x1080, COLOR_BGR2BGRA)'" - "RGBA2BGR: opencv_perf_imgproc '*cvtColor8u/*' '(1920x1080, COLOR_RGBA2BGR)'" - "BGRA2BGR: opencv_perf_imgproc '*cvtColor8u/*' '(1920x1080, COLOR_BGRA2BGR)'" - - "YUVSP2BGR: opencv_perf_imgproc '*cvtColorYUV420/*' '(1920x1080, COLOR_YUV2BGR_NV12)'" - "YUVSP2BGRA: opencv_perf_imgproc '*cvtColorYUV420/*' '(1920x1080, COLOR_YUV2BGRA_NV12)'" - "YUVSP2RGB: opencv_perf_imgproc '*cvtColorYUV420/*' '(1920x1080, COLOR_YUV2RGB_NV12)'" - "YUVSP2RGBA: opencv_perf_imgproc '*cvtColorYUV420/*' '(1920x1080, COLOR_YUV2RGBA_NV12)'" - - "RGB2YUV: opencv_perf_imgproc '*cvtColor8u/*' '(1920x1080, COLOR_RGB2YUV)'" - "BGR2YUV: opencv_perf_imgproc '*cvtColor8u/*' '(1920x1080, COLOR_BGR2YUV)'" - "RGBA2YUV: opencv_perf_imgproc '*cvtColor8u/*' '(1920x1080, CX_RGBA2YUV)'" - "BGRA2YUV: opencv_perf_imgproc '*cvtColor8u/*' '(1920x1080, CX_BGRA2YUV)'" - - "YUV2RGB: opencv_perf_imgproc '*cvtColor8u/*' '(1920x1080, COLOR_YUV2RGB)'" - "YUV2BGR: opencv_perf_imgproc '*cvtColor8u/*' '(1920x1080, COLOR_YUV2BGR)'" - - "BinaryThreshold: opencv_perf_imgproc '*ThreshFixture_Threshold.Threshold/*' '(1920x1080, 8UC1, THRESH_BINARY)'" - - "SepFilter2D_5x5_U8: opencv_perf_imgproc '*KleidiCV_SepFilter2D.SepFilter2D/*' '(1920x1080, 8UC1, 5, BORDER_REPLICATE)'" - "SepFilter2D_5x5_U16: opencv_perf_imgproc '*KleidiCV_SepFilter2D.SepFilter2D/*' '(1920x1080, 16UC1, 5, BORDER_REPLICATE)'" - "SepFilter2D_5x5_S16: opencv_perf_imgproc '*KleidiCV_SepFilter2D.SepFilter2D/*' '(1920x1080, 16SC1, 5, BORDER_REPLICATE)'" - - "GaussianBlur3x3: opencv_perf_imgproc '*gaussianBlur3x3/*' '(1920x1080, 8UC1, BORDER_REPLICATE)'" - "GaussianBlur5x5: opencv_perf_imgproc '*gaussianBlur5x5/*' '(1920x1080, 8UC1, BORDER_REPLICATE)'" - "GaussianBlur7x7: opencv_perf_imgproc '*gaussianBlur7x7/*' '(1920x1080, 8UC1, BORDER_REPLICATE)'" - "GaussianBlur15x15: opencv_perf_imgproc '*gaussianBlur15x15/*' '(1920x1080, 8UC1, BORDER_REPLICATE)'" - - "GaussianBlur3x3_CustomSigma: opencv_perf_imgproc '*gaussianBlur3x3_CustomSigma/*' '(1920x1080, 8UC1, BORDER_REPLICATE)'" - "GaussianBlur5x5_CustomSigma: opencv_perf_imgproc '*gaussianBlur5x5_CustomSigma/*' '(1920x1080, 8UC1, BORDER_REPLICATE)'" - "GaussianBlur7x7_CustomSigma: opencv_perf_imgproc '*gaussianBlur7x7_CustomSigma/*' '(1920x1080, 8UC1, BORDER_REPLICATE)'" - "GaussianBlur15x15_CustomSigma: opencv_perf_imgproc '*gaussianBlur15x15_CustomSigma/*' '(1920x1080, 8UC1, BORDER_REPLICATE)'" - - "Sobel_Gx: opencv_perf_imgproc '*Border3x3_sobelFilter.sobelFilter/*' '(1920x1080, 16SC1, (1, 0), BORDER_REPLICATE)'" - "Sobel_Gy: opencv_perf_imgproc '*Border3x3_sobelFilter.sobelFilter/*' '(1920x1080, 16SC1, (0, 1), BORDER_REPLICATE)'" - - "Dilate3x3: opencv_perf_imgproc '*Dilate_big.big/*' '(1920x1080, 8UC1, 3)'" - "Dilate5x5: opencv_perf_imgproc '*Dilate_big.big/*' '(1920x1080, 8UC1, 5)'" - "Dilate17x17: opencv_perf_imgproc '*Dilate_big.big/*' '(1920x1080, 8UC1, 17)'" - "Erode3x3: opencv_perf_imgproc '*Erode_big.big/*' '(1920x1080, 8UC1, 3)'" - "Erode5x5: opencv_perf_imgproc '*Erode_big.big/*' '(1920x1080, 8UC1, 5)'" - "Erode17x17: opencv_perf_imgproc '*Erode_big.big/*' '(1920x1080, 8UC1, 17)'" - - "Resize_0.5_8b: opencv_perf_imgproc '*ResizeAreaFast/*' '(8UC1, 1920x1080, 2)'" - "Resize2x2_8b: opencv_perf_imgproc '*resizeUpLinearNonExact/*' '(8UC1, (960x540, 1920x1080))'" - "Resize2x2_float: opencv_perf_imgproc '*resizeUpLinearNonExact/*' '(32FC1, (960x540, 1920x1080))'" - "Resize4x4_8b: opencv_perf_imgproc '*resizeUpLinearNonExact/*' '(8UC1, (480x270, 1920x1080))'" - "Resize4x4_float: opencv_perf_imgproc '*resizeUpLinearNonExact/*' '(32FC1, (480x270, 1920x1080))'" - "Resize8x8_float: opencv_perf_imgproc '*resizeUpLinearNonExact/*' '(32FC1, (240x135, 1920x1080))'" - - "Scale: opencv_perf_core '*convertTo/*' '(1920x1080, 8UC1, 8UC1, 1, 1.234, 4.567)'" - "Scale_float_1.0: opencv_perf_core '*convertTo/*' '(1920x1080, 32FC1, 32FC1, 1, 1, 4.567)'" - "Scale_float: opencv_perf_core '*convertTo/*' '(1920x1080, 32FC1, 32FC1, 1, 1.234, 4.567)'" - - "MinMax_S8: opencv_perf_core '*minMaxVals/*' '(1920x1080, 8SC1)'" - "MinMax_U8: opencv_perf_core '*minMaxVals/*' '(1920x1080, 8UC1)'" - "MinMax_S16: opencv_perf_core '*minMaxVals/*' '(1920x1080, 16SC1)'" - "MinMax_U16: opencv_perf_core '*minMaxVals/*' '(1920x1080, 16UC1)'" - "MinMax_S32: opencv_perf_core '*minMaxVals/*' '(1920x1080, 32SC1)'" - "MinMax_F32: opencv_perf_core '*minMaxVals/*' '(1920x1080, 32FC1)'" - - "MinMaxLoc_U8: opencv_perf_core '*minMaxLoc/*' '(1920x1080, 8UC1)'" - - "FloatToInt: opencv_perf_core '*convertTo/*' '(1920x1080, 32FC1, 8SC1, 1, 1, 0)'" - "FloatToUint: opencv_perf_core '*convertTo/*' '(1920x1080, 32FC1, 8UC1, 1, 1, 0)'" - "IntToFloat: opencv_perf_core '*convertTo/*' '(1920x1080, 8SC1, 32FC1, 1, 1, 0)'" - "UintToFloat: opencv_perf_core '*convertTo/*' '(1920x1080, 8UC1, 32FC1, 1, 1, 0)'" - - "CompareGt: opencv_perf_core '*compare/*' '(1920x1080, 8UC1, CMP_GT)'" - - "InRange_U8: opencv_perf_core '*inRangeScalar/*' '(1920x1080, 8UC1, 1, 2)'" - "InRange_F32: opencv_perf_core '*inRangeScalar/*' '(1920x1080, 32FC1, 1, 2)'" - - "Remap_S16_U8: opencv_perf_imgproc '*Remap/*' '(1920x1080, 8UC1, 16SC2, INTER_NEAREST, BORDER_REPLICATE)'" - "Remap_S16Point5_U8: opencv_perf_imgproc '*Remap/*' '(1920x1080, 8UC1, 16SC2, INTER_LINEAR, BORDER_REPLICATE)'" - - "BlurAndDownsample: opencv_perf_imgproc '*pyrDown/*' '(1920x1080, 8UC1)'" -) - -for idx in "${!benchmarks[@]}"; do - benchmark="${benchmarks[$idx]}" - >&2 echo - >&2 echo "RUNNING [$((${idx} + 1))/${#benchmarks[@]}]:" ${benchmark%%:*} ${benchmark#*:} - eval "${DEV_DIR}/perf_test_op.sh" "${CUSTOM_BUILD_SUFFIX}" "${CPU}" "${THERMAL}" ${benchmark%%:*} ${benchmark#*:} -done diff --git a/scripts/ci.sh b/scripts/ci.sh index e9b12ec7134e6c963751b4db01b0400b1a2ad56d..00b38771013509ff24d5467f31ddaac4a8b8e47a 100755 --- a/scripts/ci.sh +++ b/scripts/ci.sh @@ -23,7 +23,9 @@ CHECK_ONLY=ON VERBOSE=ON scripts/format.sh scripts/cpplint.sh # Check format of shell scripts -shellcheck scripts/*.sh +# shellcheck disable=SC2046 +# Word splitting is essential here. +shellcheck $(find scripts -name '*.sh' | tr '\n' ' ') # Check license headers reuse lint