From 566c2a4e10648e391e0b3a651802b5a2f537512e Mon Sep 17 00:00:00 2001 From: Michael Platings Date: Wed, 11 Sep 2024 09:56:05 +0100 Subject: [PATCH] Run GCC tests with fixed random seed A previous test run found a result that was 0.000001907 off from the expected value. Try re-running the tests with the same value to see if the error can be reproduced. ...and it can! See if it can be reproduced (a) with other compilers and (b) when only running that particular test. --- scripts/ci.sh | 45 +++++---------------------------------------- 1 file changed, 5 insertions(+), 40 deletions(-) diff --git a/scripts/ci.sh b/scripts/ci.sh index e9b12ec71..253e7ea3f 100755 --- a/scripts/ci.sh +++ b/scripts/ci.sh @@ -34,7 +34,6 @@ doxygen # Build cmake -S . -B build -G Ninja \ -DCMAKE_COMPILE_WARNING_AS_ERROR=ON \ - -DCMAKE_CXX_CLANG_TIDY=clang-tidy \ -DCMAKE_CXX_FLAGS="--target=aarch64-linux-gnu --coverage" \ -DCMAKE_EXE_LINKER_FLAGS="--rtlib=compiler-rt -static -fuse-ld=lld" \ -DKLEIDICV_LIMIT_SME2_TO_SELECTED_ALGORITHMS=OFF \ @@ -53,17 +52,15 @@ CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ cmake -S . -B build/gcc -G Ni ninja -C build/gcc # Run tests -LONG_VECTOR_TESTS="GRAY2.*:RGB*:Yuv*:Rgb*:Resize*" TESTRESULT=0 -qemu-aarch64 build/test/framework/kleidicv-framework-test --gtest_output=xml:build/test-results/ || TESTRESULT=1 -qemu-aarch64 -cpu cortex-a35 build/test/api/kleidicv-api-test --gtest_output=xml:build/test-results/clang-neon/ || TESTRESULT=1 +qemu-aarch64 -cpu cortex-a35 build/test/api/kleidicv-api-test --gtest_output=xml:build/test-results/clang-neon/ --gtest_filter=Thread.scale_f32/10 --seed=208023573 || TESTRESULT=1 qemu-aarch64 -cpu max,sve128=on,sme=off \ - build/test/api/kleidicv-api-test --gtest_output=xml:build/test-results/clang-sve128/ --vector-length=16 || TESTRESULT=1 + build/test/api/kleidicv-api-test --gtest_output=xml:build/test-results/clang-sve128/ --vector-length=16 --gtest_filter=Thread.scale_f32/10 --seed=208023573 || TESTRESULT=1 qemu-aarch64 -cpu max,sve2048=on,sve-default-vector-length=256,sme=off \ - build/test/api/kleidicv-api-test --gtest_filter="${LONG_VECTOR_TESTS}" --gtest_output=xml:build/test-results/clang-sve2048/ --vector-length=256 || TESTRESULT=1 + build/test/api/kleidicv-api-test --gtest_output=xml:build/test-results/clang-sve2048/ --vector-length=256 --gtest_filter=Thread.scale_f32/10 --seed=208023573 || TESTRESULT=1 qemu-aarch64 -cpu max,sve128=on,sme512=on \ - build/test/api/kleidicv-api-test --gtest_output=xml:build/test-results/clang-sme/ --vector-length=64 || TESTRESULT=1 -qemu-aarch64 -cpu cortex-a35 build/gcc/test/api/kleidicv-api-test --gtest_output=xml:build/test-results/gcc-neon/ || TESTRESULT=1 + build/test/api/kleidicv-api-test --gtest_output=xml:build/test-results/clang-sme/ --vector-length=64 --gtest_filter=Thread.scale_f32/10 --seed=208023573 || TESTRESULT=1 +qemu-aarch64 -cpu cortex-a35 build/gcc/test/api/kleidicv-api-test --gtest_output=xml:build/test-results/gcc-neon/ --gtest_filter=Thread.scale_f32/10 --seed=208023573 || TESTRESULT=1 scripts/prefix_testsuite_names.py build/test-results/clang-neon/kleidicv-api-test.xml "clang-neon." scripts/prefix_testsuite_names.py build/test-results/clang-sve128/kleidicv-api-test.xml "clang-sve128." @@ -74,36 +71,4 @@ scripts/prefix_testsuite_names.py build/test-results/gcc-neon/kleidicv-api-test. # Generate test coverage report LLVM_COV=llvm-cov scripts/generate_coverage_report.py -# Sanitizers don't work when run through qemu so must be run natively. -if [[ $(dpkg --print-architecture) = arm64 ]]; then - # Clang address & undefined behaviour sanitizers - cmake -S . -B build/sanitize -G Ninja \ - -DCMAKE_BUILD_TYPE=Debug \ - -DCMAKE_COMPILE_WARNING_AS_ERROR=ON \ - -DKLEIDICV_ENABLE_SME2=OFF \ - -DCMAKE_CXX_FLAGS="-fsanitize=address,undefined -fno-sanitize-recover=all -Wno-pass-failed" - ninja -C build/sanitize kleidicv-api-test - build/sanitize/test/api/kleidicv-api-test -fi - -# Build benchmarks, just to prevent bitrot. -cmake -S . -B build/build-benchmark -G Ninja \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_COMPILE_WARNING_AS_ERROR=ON \ - -DCMAKE_CROSSCOMPILING_EMULATOR=qemu-aarch64 \ - -DCMAKE_CXX_COMPILER_TARGET=aarch64-linux-gnu \ - -DCMAKE_EXE_LINKER_FLAGS="--rtlib=compiler-rt -static -fuse-ld=lld" \ - -DCMAKE_SYSTEM_NAME=Linux \ - -DCMAKE_SYSTEM_PROCESSOR=aarch64 \ - -DKLEIDICV_BENCHMARK=ON \ - -DKLEIDICV_LIMIT_SME2_TO_SELECTED_ALGORITHMS=OFF \ - -DKLEIDICV_LIMIT_SVE2_TO_SELECTED_ALGORITHMS=OFF -ninja -C build/build-benchmark kleidicv-benchmark - -# TODO: Cross-build OpenCV -if [[ $(dpkg --print-architecture) = arm64 ]]; then - # Check OpenCV-KleidiCV integration - scripts/ci-opencv.sh -fi - exit $TESTRESULT -- GitLab