From 57c931dfb251f1a4b97405bb7578f75f2cc73e37 Mon Sep 17 00:00:00 2001 From: ckormanyos Date: Sat, 26 Oct 2024 11:36:57 +0200 Subject: [PATCH 1/2] Add benchmark boost crypt hasher --- .../workflows/real-time-cpp-benchmarks.yml | 8 +- ref_app/ref_app.vcxproj | 1 + ref_app/ref_app.vcxproj.filters | 3 + ref_app/src/app/benchmark/app_benchmark.cpp | 4 + ref_app/src/app/benchmark/app_benchmark.h | 4 + .../app_benchmark_boost_crypt_hasher.cpp | 117 ++++++++++++++++++ ref_app/src/mcal/mcal_gpt_arm_sys_tick.h | 19 +-- ref_app/target/app/make/app_files.gmk | 1 + ref_app/target/build/test_app_benchmarks.sh | 9 +- .../build/test_app_benchmarks_stm32f446.sh | 7 +- 10 files changed, 161 insertions(+), 12 deletions(-) create mode 100644 ref_app/src/app/benchmark/app_benchmark_boost_crypt_hasher.cpp diff --git a/.github/workflows/real-time-cpp-benchmarks.yml b/.github/workflows/real-time-cpp-benchmarks.yml index 550baa306..9174a9be2 100644 --- a/.github/workflows/real-time-cpp-benchmarks.yml +++ b/.github/workflows/real-time-cpp-benchmarks.yml @@ -41,6 +41,9 @@ jobs: - name: clone-cppalliance-decimal run: | git clone -b develop --depth 1 https://github.com/cppalliance/decimal.git ../cppalliance-decimal-root + - name: clone-cppalliance-crypt + run: | + git clone -b develop --depth 1 https://github.com/cppalliance/crypt.git ../cppalliance-crypt-root working-directory: ./ - name: benchmark_gcc-clang run: ./target/build/test_app_benchmarks.sh ${{ matrix.compiler }} ${{ matrix.standard }} @@ -104,7 +107,7 @@ jobs: strategy: fail-fast: false matrix: - standard: [ c++14, c++17, c++2a ] + standard: [ c++14, c++20 ] steps: - uses: actions/checkout@v4 with: @@ -125,6 +128,9 @@ jobs: - name: clone-cppalliance-decimal run: | git clone -b develop --depth 1 https://github.com/cppalliance/decimal.git ../cppalliance-decimal-root + - name: clone-cppalliance-crypt + run: | + git clone -b develop --depth 1 https://github.com/cppalliance/crypt.git ../cppalliance-crypt-root working-directory: ./ - name: benchmark_builds-stm32f446 run: ./target/build/test_app_benchmarks_stm32f446.sh ${{ matrix.standard }} diff --git a/ref_app/ref_app.vcxproj b/ref_app/ref_app.vcxproj index f5b28d4e6..65c006156 100644 --- a/ref_app/ref_app.vcxproj +++ b/ref_app/ref_app.vcxproj @@ -189,6 +189,7 @@ + diff --git a/ref_app/ref_app.vcxproj.filters b/ref_app/ref_app.vcxproj.filters index eae30f69f..92b8007ba 100644 --- a/ref_app/ref_app.vcxproj.filters +++ b/ref_app/ref_app.vcxproj.filters @@ -1153,6 +1153,9 @@ src\mcal\rpi_pico2_rp2350 + + src\app\benchmark + diff --git a/ref_app/src/app/benchmark/app_benchmark.cpp b/ref_app/src/app/benchmark/app_benchmark.cpp index 46aeea1e5..eca2ebc2f 100644 --- a/ref_app/src/app/benchmark/app_benchmark.cpp +++ b/ref_app/src/app/benchmark/app_benchmark.cpp @@ -120,6 +120,10 @@ auto app::benchmark::task_func() -> void const bool result_is_ok = app::benchmark::run_non_std_decimal(); + #elif (defined(APP_BENCHMARK_TYPE) && (APP_BENCHMARK_TYPE == APP_BENCHMARK_TYPE_BOOST_CRYPT_HASHER)) + + const bool result_is_ok = app::benchmark::run_non_boost_crypt_hasher(); + #endif // Set the benchmark port pin level to low. diff --git a/ref_app/src/app/benchmark/app_benchmark.h b/ref_app/src/app/benchmark/app_benchmark.h index 345041b4b..6dee600f5 100644 --- a/ref_app/src/app/benchmark/app_benchmark.h +++ b/ref_app/src/app/benchmark/app_benchmark.h @@ -31,6 +31,7 @@ #define APP_BENCHMARK_TYPE_ECC_GENERIC_ECC 20 #define APP_BENCHMARK_TYPE_NON_STD_DECIMAL 21 #define APP_BENCHMARK_TYPE_PI_AGM_100 22 + #define APP_BENCHMARK_TYPE_BOOST_CRYPT_HASHER 23 //#define APP_BENCHMARK_TYPE APP_BENCHMARK_TYPE_NONE //#define APP_BENCHMARK_TYPE APP_BENCHMARK_TYPE_COMPLEX @@ -55,6 +56,7 @@ //#define APP_BENCHMARK_TYPE APP_BENCHMARK_TYPE_ECC_GENERIC_ECC //#define APP_BENCHMARK_TYPE APP_BENCHMARK_TYPE_NON_STD_DECIMAL //#define APP_BENCHMARK_TYPE APP_BENCHMARK_TYPE_PI_AGM_100 + //#define APP_BENCHMARK_TYPE APP_BENCHMARK_TYPE_BOOST_CRYPT_HASHER #if !defined(APP_BENCHMARK_TYPE) #define APP_BENCHMARK_TYPE APP_BENCHMARK_TYPE_NONE @@ -106,6 +108,8 @@ auto run_ecc_generic_ecc() -> bool; #elif (defined(APP_BENCHMARK_TYPE) && (APP_BENCHMARK_TYPE == APP_BENCHMARK_TYPE_NON_STD_DECIMAL)) auto run_non_std_decimal() -> bool; + #elif (defined(APP_BENCHMARK_TYPE) && (APP_BENCHMARK_TYPE == APP_BENCHMARK_TYPE_BOOST_CRYPT_HASHER)) + auto run_non_boost_crypt_hasher() -> bool; #else #error APP_BENCHMARK_TYPE is undefined. #endif diff --git a/ref_app/src/app/benchmark/app_benchmark_boost_crypt_hasher.cpp b/ref_app/src/app/benchmark/app_benchmark_boost_crypt_hasher.cpp new file mode 100644 index 000000000..b1630ecff --- /dev/null +++ b/ref_app/src/app/benchmark/app_benchmark_boost_crypt_hasher.cpp @@ -0,0 +1,117 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright Christopher Kormanyos 2024. +// Distributed under the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt +// or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include + +#include + +#if (defined(APP_BENCHMARK_TYPE) && (APP_BENCHMARK_TYPE == APP_BENCHMARK_TYPE_BOOST_CRYPT_HASHER)) + +#if !defined(BOOST_CRYPT_STANDALONE) +#define BOOST_CRYPT_STANDALONE +#endif + +#if !defined(BOOST_CRYPT_DISABLE_IOSTREAM) +#define BOOST_CRYPT_DISABLE_IOSTREAM +#endif + +#if !defined(BOOST_CRYPT_NO_EXCEPTIONS) +#define BOOST_CRYPT_NO_EXCEPTIONS +#endif + +#include + +auto app::benchmark::run_non_boost_crypt_hasher() -> bool +{ + // "abc" + const std::array message = + {{ + 0x61U, 0x62U, 0x63U + }}; + + using local_hasher_type = boost::crypt::sha512_hasher; + using local_result_type = typename local_hasher_type::return_type; + + constexpr local_result_type control = + {{ + 0xDDU, 0xAFU, 0x35U, 0xA1U, 0x93U, 0x61U, 0x7AU, 0xBAU, + 0xCCU, 0x41U, 0x73U, 0x49U, 0xAEU, 0x20U, 0x41U, 0x31U, + 0x12U, 0xE6U, 0xFAU, 0x4EU, 0x89U, 0xA9U, 0x7EU, 0xA2U, + 0x0AU, 0x9EU, 0xEEU, 0xE6U, 0x4BU, 0x55U, 0xD3U, 0x9AU, + 0x21U, 0x92U, 0x99U, 0x2AU, 0x27U, 0x4FU, 0xC1U, 0xA8U, + 0x36U, 0xBAU, 0x3CU, 0x23U, 0xA3U, 0xFEU, 0xEBU, 0xBDU, + 0x45U, 0x4DU, 0x44U, 0x23U, 0x64U, 0x3CU, 0xE8U, 0x0EU, + 0x2AU, 0x9AU, 0xC9U, 0x4FU, 0xA5U, 0x4CU, 0xA4U, 0x9FU, + }}; + + local_hasher_type my_hasher { }; + + my_hasher.init(); + + my_hasher.process_bytes(message.data(), message.size()); + + const local_result_type result { my_hasher.get_digest() }; + + const bool result_is_ok { result == control }; + + return result_is_ok; +} + +#if defined(APP_BENCHMARK_STANDALONE_MAIN) +constexpr auto app_benchmark_standalone_foodcafe = static_cast(UINT32_C(0xF00DCAFE)); + +extern "C" +{ + extern volatile std::uint32_t app_benchmark_standalone_result; + + auto app_benchmark_run_standalone (void) -> bool; + auto app_benchmark_get_standalone_result(void) -> bool; + + auto app_benchmark_run_standalone(void) -> bool + { + auto result_is_ok = true; + + for(unsigned i = 0U; i < 64U; ++i) + { + result_is_ok &= app::benchmark::run_crc(); + } + + app_benchmark_standalone_result = + static_cast + ( + result_is_ok ? app_benchmark_standalone_foodcafe : static_cast(UINT32_C(0xFFFFFFFF)) + ); + + return result_is_ok; + } + + auto app_benchmark_get_standalone_result(void) -> bool + { + volatile auto result_is_ok = + (app_benchmark_standalone_result == static_cast(UINT32_C(0xF00DCAFE))); + + return result_is_ok; + } +} + +int main() +{ + auto result_is_ok = true; + + result_is_ok = (::app_benchmark_run_standalone () && result_is_ok); + result_is_ok = (::app_benchmark_get_standalone_result() && result_is_ok); + + return (result_is_ok ? 0 : -1); +} + +extern "C" +{ + volatile std::uint32_t app_benchmark_standalone_result; +} +#endif // APP_BENCHMARK_STANDALONE_MAIN + +#endif // APP_BENCHMARK_TYPE_CRC diff --git a/ref_app/src/mcal/mcal_gpt_arm_sys_tick.h b/ref_app/src/mcal/mcal_gpt_arm_sys_tick.h index 1e469cfe9..b5ad542e5 100644 --- a/ref_app/src/mcal/mcal_gpt_arm_sys_tick.h +++ b/ref_app/src/mcal/mcal_gpt_arm_sys_tick.h @@ -125,7 +125,7 @@ ) ); - const auto sys_tick_value = my_sys_tick_value; + const value_type sys_tick_value { my_sys_tick_value }; // Do the second read of the sys-tick counter and the sys-tick // value. Handle reverse counting for sys-tick counter, which is @@ -143,13 +143,16 @@ // Perform the consistency check. - const auto sys_tick_consistent_value = - static_cast - ( - ((sys_tick_counter_2 >= sys_tick_counter_1) - ? static_cast(static_cast( sys_tick_value) | sys_tick_counter_1) - : static_cast(static_cast(my_sys_tick_value) | sys_tick_counter_2)) - ); + const std::uint64_t + sys_tick_consistent_value + { + static_cast + ( + ((sys_tick_counter_2 >= sys_tick_counter_1) + ? static_cast(static_cast( sys_tick_value) | sys_tick_counter_1) + : static_cast(static_cast(my_sys_tick_value) | sys_tick_counter_2)) + ) + }; // Perform scaling and include a rounding correction. return diff --git a/ref_app/target/app/make/app_files.gmk b/ref_app/target/app/make/app_files.gmk index 07739b6b3..1ae3e493f 100644 --- a/ref_app/target/app/make/app_files.gmk +++ b/ref_app/target/app/make/app_files.gmk @@ -10,6 +10,7 @@ # ------------------------------------------------------------------------------ FILES_CPP = $(PATH_APP)/app/benchmark/app_benchmark \ + $(PATH_APP)/app/benchmark/app_benchmark_boost_crypt_hasher \ $(PATH_APP)/app/benchmark/app_benchmark_boost_math_cbrt_tgamma \ $(PATH_APP)/app/benchmark/app_benchmark_boost_math_cyl_bessel_j \ $(PATH_APP)/app/benchmark/app_benchmark_boost_multiprecision_cbrt \ diff --git a/ref_app/target/build/test_app_benchmarks.sh b/ref_app/target/build/test_app_benchmarks.sh index 932c61836..2a8235950 100755 --- a/ref_app/target/build/test_app_benchmarks.sh +++ b/ref_app/target/build/test_app_benchmarks.sh @@ -47,6 +47,7 @@ if [[ "$GCC" == "g++" ]]; then $GCC -std=$STD -Wall -Werror -O2 -m64 -I./src/mcal/host -I./src -DAPP_BENCHMARK_TYPE=APP_BENCHMARK_TYPE_ECC_GENERIC_ECC -DAPP_BENCHMARK_STANDALONE_MAIN ./src/app/benchmark/app_benchmark_ecc_generic_ecc.cpp -o ./bin/app_benchmark_ecc_generic_ecc.exe fi $GCC -std=$STD -Wall -O2 -m64 -I./src/mcal/host -I./src -I../../cppalliance-decimal-root/include -I../../boost-root -DAPP_BENCHMARK_TYPE=APP_BENCHMARK_TYPE_NON_STD_DECIMAL -DAPP_BENCHMARK_STANDALONE_MAIN ./src/app/benchmark/app_benchmark_non_std_decimal.cpp -o ./bin/app_benchmark_non_std_decimal.exe +$GCC -std=$STD -Wall -O2 -m64 -I./src/mcal/host -I./src -I../../cppalliance-crypt-root/include -I../../boost-root -DAPP_BENCHMARK_TYPE=APP_BENCHMARK_TYPE_BOOST_CRYPT_HASHER -DAPP_BENCHMARK_STANDALONE_MAIN ./src/app/benchmark/app_benchmark_boost_crypt_hasher.cpp -o ./bin/app_benchmark_boost_crypt_hasher.exe ./bin/app_benchmark_complex.exe result_var_complex=$? @@ -113,6 +114,9 @@ fi ./bin/app_benchmark_non_std_decimal.exe result_var_non_std_decimal=$? +./bin/app_benchmark_boost_crypt_hasher.exe +result_var_boost_crypt_hasher=$? + echo "result_var_complex : " "$result_var_complex" echo "result_var_crc : " "$result_var_crc" echo "result_var_fast_math : " "$result_var_fast_math" @@ -136,11 +140,12 @@ if [[ "$GCC" == "g++" ]]; then echo "result_var_ecc_generic_ecc : " "$result_var_ecc_generic_ecc" fi echo "result_var_non_std_decimal : " "$result_var_non_std_decimal" +echo "result_var_boost_crypt_hasher : " "$result_var_boost_crypt_hasher" if [[ "$GCC" == "g++" ]]; then -result_total=$((result_var_complex+result_var_crc+result_var_fast_math+result_var_filter+result_var_fixed_point+result_var_float+result_var_hash+result_var_none+result_var_pi_agm+result_var_pi_spigot+result_var_pi_spigot_single+$result_var_soft_double_h2f1+result_var_trapezoid_integral+result_var_wide_decimal+result_var_wide_integer+result_var_boost_math_cbrt_tgamma+result_var_boost_math_cyl_bessel_j+result_var_boost_multiprecision_cbrt+result_var_hash_sha256+result_var_ecc_generic_ecc+result_var_non_std_decimal)) +result_total=$((result_var_complex+result_var_crc+result_var_fast_math+result_var_filter+result_var_fixed_point+result_var_float+result_var_hash+result_var_none+result_var_pi_agm+result_var_pi_spigot+result_var_pi_spigot_single+$result_var_soft_double_h2f1+result_var_trapezoid_integral+result_var_wide_decimal+result_var_wide_integer+result_var_boost_math_cbrt_tgamma+result_var_boost_math_cyl_bessel_j+result_var_boost_multiprecision_cbrt+result_var_hash_sha256+result_var_ecc_generic_ecc+result_var_non_std_decimal+result_ls_boost_crypt_hasher)) else -result_total=$((result_var_complex+result_var_crc+result_var_fast_math+result_var_filter+result_var_fixed_point+result_var_float+result_var_hash+result_var_none+result_var_pi_agm+result_var_pi_spigot+result_var_pi_spigot_single+$result_var_soft_double_h2f1+result_var_trapezoid_integral+result_var_wide_decimal+result_var_wide_integer+result_var_boost_math_cbrt_tgamma+result_var_boost_math_cyl_bessel_j+result_var_boost_multiprecision_cbrt+result_var_hash_sha256+result_var_non_std_decimal)) +result_total=$((result_var_complex+result_var_crc+result_var_fast_math+result_var_filter+result_var_fixed_point+result_var_float+result_var_hash+result_var_none+result_var_pi_agm+result_var_pi_spigot+result_var_pi_spigot_single+$result_var_soft_double_h2f1+result_var_trapezoid_integral+result_var_wide_decimal+result_var_wide_integer+result_var_boost_math_cbrt_tgamma+result_var_boost_math_cyl_bessel_j+result_var_boost_multiprecision_cbrt+result_var_hash_sha256+result_var_non_std_decimal+result_ls_boost_crypt_hasher)) fi echo "result_total : " "$result_total" diff --git a/ref_app/target/build/test_app_benchmarks_stm32f446.sh b/ref_app/target/build/test_app_benchmarks_stm32f446.sh index 40e4a6294..f3ea0e54d 100755 --- a/ref_app/target/build/test_app_benchmarks_stm32f446.sh +++ b/ref_app/target/build/test_app_benchmarks_stm32f446.sh @@ -44,6 +44,7 @@ arm-none-eabi-g++ -std=$STD -Werror -Wall -O2 -g -gdwarf-2 -fno-exceptio arm-none-eabi-g++ -std=$STD -Werror -Wall $wflags -O2 -g -gdwarf-2 -fno-exceptions -ffunction-sections -fdata-sections -x c++ -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs -ftemplate-depth=128 -Wzero-as-null-pointer-constant -mcpu=cortex-m4 -mtune=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffast-math -mno-unaligned-access -mno-long-calls -I./src/mcal/stm32f446 -I./src -DAPP_BENCHMARK_TYPE=APP_BENCHMARK_TYPE_HASH_SHA256 -DAPP_BENCHMARK_STANDALONE_MAIN ./src/app/benchmark/app_benchmark_hash_sha256.cpp ./target/micros/stm32f446/make/single/crt.cpp -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_hash_sha256.map -T ./target/micros/stm32f446/make/stm32f446.ld --specs=nano.specs --specs=nosys.specs -o ./bin/app_benchmark_hash_sha256.elf arm-none-eabi-g++ -std=$STD -Werror -Wall $wflags -O2 -g -gdwarf-2 -fno-exceptions -ffunction-sections -fdata-sections -x c++ -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs -ftemplate-depth=128 -Wzero-as-null-pointer-constant -mcpu=cortex-m4 -mtune=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffast-math -mno-unaligned-access -mno-long-calls -I./src/mcal/stm32f446 -I./src -DAPP_BENCHMARK_TYPE=APP_BENCHMARK_TYPE_ECC_GENERIC_ECC -DAPP_BENCHMARK_STANDALONE_MAIN ./src/app/benchmark/app_benchmark_ecc_generic_ecc.cpp ./target/micros/stm32f446/make/single/crt.cpp -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_ecc_generic_ecc.map -T ./target/micros/stm32f446/make/stm32f446.ld --specs=nano.specs --specs=nosys.specs -o ./bin/app_benchmark_ecc_generic_ecc.elf arm-none-eabi-g++ -std=$STD -Werror -Wall -O2 -g -gdwarf-2 -fno-exceptions -ffunction-sections -fdata-sections -x c++ -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs -ftemplate-depth=128 -Wzero-as-null-pointer-constant -mcpu=cortex-m4 -mtune=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffast-math -mno-unaligned-access -mno-long-calls -I./src/mcal/stm32f446 -I./src -I../../cppalliance-decimal-root/include -I../../boost-root -DAPP_BENCHMARK_TYPE=APP_BENCHMARK_TYPE_NON_STD_DECIMAL -DAPP_BENCHMARK_STANDALONE_MAIN ./src/app/benchmark/app_benchmark_non_std_decimal.cpp ./target/micros/stm32f446/make/single/crt.cpp -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_non_std_decimal.map -T ./target/micros/stm32f446/make/stm32f446_with_stdlib.ld --specs=nano.specs --specs=nosys.specs -o ./bin/app_benchmark_non_std_decimal.elf +arm-none-eabi-g++ -std=$STD -Werror -Wall -O2 -g -gdwarf-2 -fno-exceptions -ffunction-sections -fdata-sections -x c++ -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs -ftemplate-depth=128 -Wzero-as-null-pointer-constant -mcpu=cortex-m4 -mtune=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffast-math -mno-unaligned-access -mno-long-calls -I./src/mcal/stm32f446 -I./src -I../../cppalliance-crypt-root/include -I../../boost-root -DAPP_BENCHMARK_TYPE=APP_BENCHMARK_TYPE_BOOST_CRYPT_HASHER -DAPP_BENCHMARK_STANDALONE_MAIN ./src/app/benchmark/app_benchmark_boost_crypt_hasher.cpp ./target/micros/stm32f446/make/single/crt.cpp -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_boost_crypt_hasher.map -T ./target/micros/stm32f446/make/stm32f446_with_stdlib.ld --specs=nano.specs --specs=nosys.specs -o ./bin/app_benchmark_boost_crypt_hasher.elf ls -la ./bin/app_benchmark_complex.elf ./bin/app_benchmark_complex.map result_ls_complex=$? @@ -108,6 +109,9 @@ result_ls_ecc_generic_ecc=$? ls -la ./bin/app_benchmark_non_std_decimal.elf ./bin/app_benchmark_non_std_decimal.map result_ls_non_std_decimal=$? +ls -la ./bin/app_benchmark_boost_crypt_hasher.elf ./bin/app_benchmark_boost_crypt_hasher.map +result_ls_boost_crypt_hasher=$? + echo "result_ls_complex : " "$result_ls_complex" echo "result_ls_crc : " "$result_ls_crc" echo "result_ls_fast_math : " "$result_ls_fast_math" @@ -129,8 +133,9 @@ echo "result_ls_boost_multiprecision_cbrt : " "$result_ls_boost_multiprecision_ echo "result_ls_hash_sha256 : " "$result_ls_hash_sha256" echo "result_ls_ecc_generic_ecc : " "$result_ls_ecc_generic_ecc" echo "result_ls_non_std_decimal : " "$result_ls_non_std_decimal" +echo "result_ls_boost_crypt_hasher : " "$result_ls_boost_crypt_hasher" -result_total=$((result_ls_complex+result_ls_crc+result_ls_fast_math+result_ls_filter+result_ls_fixed_point+result_ls_float+result_ls_hash+result_ls_none+result_ls_pi_agm+result_ls_pi_spigot+result_ls_pi_spigot_single+result_ls_soft_double_h2f1+result_ls_trapezoid_integral+result_ls_wide_decimal+result_ls_wide_integer+result_ls_boost_math_cbrt_tgamma+result_ls_boost_math_cyl_bessel_j+result_ls_boost_multiprecision_cbrt+result_ls_hash_sha256+$result_ls_ecc_generic_ecc+result_ls_non_std_decimal)) +result_total=$((result_ls_complex+result_ls_crc+result_ls_fast_math+result_ls_filter+result_ls_fixed_point+result_ls_float+result_ls_hash+result_ls_none+result_ls_pi_agm+result_ls_pi_spigot+result_ls_pi_spigot_single+result_ls_soft_double_h2f1+result_ls_trapezoid_integral+result_ls_wide_decimal+result_ls_wide_integer+result_ls_boost_math_cbrt_tgamma+result_ls_boost_math_cyl_bessel_j+result_ls_boost_multiprecision_cbrt+result_ls_hash_sha256+$result_ls_ecc_generic_ecc+result_ls_non_std_decimal+result_ls_boost_crypt_hasher)) echo "result_total : " "$result_total" From 2897d9e02c938f4600c831f6359f1082191db8ba Mon Sep 17 00:00:00 2001 From: ckormanyos Date: Sat, 26 Oct 2024 11:53:38 +0200 Subject: [PATCH 2/2] Correct typos and stm32f446 CI --- ref_app/src/app/benchmark/app_benchmark.cpp | 2 +- ref_app/src/app/benchmark/app_benchmark.h | 2 +- .../src/app/benchmark/app_benchmark_boost_crypt_hasher.cpp | 4 ++-- ref_app/target/build/test_app_benchmarks_stm32f446.sh | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ref_app/src/app/benchmark/app_benchmark.cpp b/ref_app/src/app/benchmark/app_benchmark.cpp index eca2ebc2f..5ccc73435 100644 --- a/ref_app/src/app/benchmark/app_benchmark.cpp +++ b/ref_app/src/app/benchmark/app_benchmark.cpp @@ -122,7 +122,7 @@ auto app::benchmark::task_func() -> void #elif (defined(APP_BENCHMARK_TYPE) && (APP_BENCHMARK_TYPE == APP_BENCHMARK_TYPE_BOOST_CRYPT_HASHER)) - const bool result_is_ok = app::benchmark::run_non_boost_crypt_hasher(); + const bool result_is_ok = app::benchmark::run_boost_crypt_hasher(); #endif diff --git a/ref_app/src/app/benchmark/app_benchmark.h b/ref_app/src/app/benchmark/app_benchmark.h index 6dee600f5..b6d5b18ea 100644 --- a/ref_app/src/app/benchmark/app_benchmark.h +++ b/ref_app/src/app/benchmark/app_benchmark.h @@ -109,7 +109,7 @@ #elif (defined(APP_BENCHMARK_TYPE) && (APP_BENCHMARK_TYPE == APP_BENCHMARK_TYPE_NON_STD_DECIMAL)) auto run_non_std_decimal() -> bool; #elif (defined(APP_BENCHMARK_TYPE) && (APP_BENCHMARK_TYPE == APP_BENCHMARK_TYPE_BOOST_CRYPT_HASHER)) - auto run_non_boost_crypt_hasher() -> bool; + auto run_boost_crypt_hasher() -> bool; #else #error APP_BENCHMARK_TYPE is undefined. #endif diff --git a/ref_app/src/app/benchmark/app_benchmark_boost_crypt_hasher.cpp b/ref_app/src/app/benchmark/app_benchmark_boost_crypt_hasher.cpp index b1630ecff..bf7324a49 100644 --- a/ref_app/src/app/benchmark/app_benchmark_boost_crypt_hasher.cpp +++ b/ref_app/src/app/benchmark/app_benchmark_boost_crypt_hasher.cpp @@ -25,7 +25,7 @@ #include -auto app::benchmark::run_non_boost_crypt_hasher() -> bool +auto app::benchmark::run_boost_crypt_hasher() -> bool { // "abc" const std::array message = @@ -77,7 +77,7 @@ extern "C" for(unsigned i = 0U; i < 64U; ++i) { - result_is_ok &= app::benchmark::run_crc(); + result_is_ok &= app::benchmark::run_boost_crypt_hasher(); } app_benchmark_standalone_result = diff --git a/ref_app/target/build/test_app_benchmarks_stm32f446.sh b/ref_app/target/build/test_app_benchmarks_stm32f446.sh index f3ea0e54d..e1ff0e2c0 100755 --- a/ref_app/target/build/test_app_benchmarks_stm32f446.sh +++ b/ref_app/target/build/test_app_benchmarks_stm32f446.sh @@ -42,9 +42,9 @@ arm-none-eabi-g++ -std=$STD -Werror -Wall -O2 -g -gdwarf-2 -fno-exceptio arm-none-eabi-g++ -std=$STD -Werror -Wall -O2 -g -gdwarf-2 -fno-exceptions -ffunction-sections -fdata-sections -x c++ -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs -ftemplate-depth=128 -mcpu=cortex-m4 -mtune=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffast-math -mno-unaligned-access -mno-long-calls -I./src/mcal/stm32f446 -I./src -I../../boost-root -DAPP_BENCHMARK_TYPE=APP_BENCHMARK_TYPE_BOOST_MATH_CYL_BESSEL_J -DAPP_BENCHMARK_STANDALONE_MAIN ./src/app/benchmark/app_benchmark_boost_math_cyl_bessel_j.cpp ./target/micros/stm32f446/make/single/crt.cpp -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_boost_math_cyl_bessel_j.map -T ./target/micros/stm32f446/make/stm32f446_with_stdlib.ld --specs=nano.specs --specs=nosys.specs -o ./bin/app_benchmark_boost_math_cyl_bessel_j.elf arm-none-eabi-g++ -std=$STD -Werror -Wall -O2 -g -gdwarf-2 -fno-exceptions -ffunction-sections -fdata-sections -x c++ -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs -ftemplate-depth=128 -mcpu=cortex-m4 -mtune=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffast-math -mno-unaligned-access -mno-long-calls -I./src/mcal/stm32f446 -I./src -I../../boost-root -DAPP_BENCHMARK_TYPE=APP_BENCHMARK_TYPE_BOOST_MULTIPRECISION_CBRT -DAPP_BENCHMARK_STANDALONE_MAIN ./src/app/benchmark/app_benchmark_boost_multiprecision_cbrt.cpp ./target/micros/stm32f446/make/single/crt.cpp -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_boost_multiprecision_cbrt.map -T ./target/micros/stm32f446/make/stm32f446_with_stdlib.ld --specs=nano.specs --specs=nosys.specs -o ./bin/app_benchmark_boost_multiprecision_cbrt.elf arm-none-eabi-g++ -std=$STD -Werror -Wall $wflags -O2 -g -gdwarf-2 -fno-exceptions -ffunction-sections -fdata-sections -x c++ -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs -ftemplate-depth=128 -Wzero-as-null-pointer-constant -mcpu=cortex-m4 -mtune=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffast-math -mno-unaligned-access -mno-long-calls -I./src/mcal/stm32f446 -I./src -DAPP_BENCHMARK_TYPE=APP_BENCHMARK_TYPE_HASH_SHA256 -DAPP_BENCHMARK_STANDALONE_MAIN ./src/app/benchmark/app_benchmark_hash_sha256.cpp ./target/micros/stm32f446/make/single/crt.cpp -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_hash_sha256.map -T ./target/micros/stm32f446/make/stm32f446.ld --specs=nano.specs --specs=nosys.specs -o ./bin/app_benchmark_hash_sha256.elf -arm-none-eabi-g++ -std=$STD -Werror -Wall $wflags -O2 -g -gdwarf-2 -fno-exceptions -ffunction-sections -fdata-sections -x c++ -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs -ftemplate-depth=128 -Wzero-as-null-pointer-constant -mcpu=cortex-m4 -mtune=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffast-math -mno-unaligned-access -mno-long-calls -I./src/mcal/stm32f446 -I./src -DAPP_BENCHMARK_TYPE=APP_BENCHMARK_TYPE_ECC_GENERIC_ECC -DAPP_BENCHMARK_STANDALONE_MAIN ./src/app/benchmark/app_benchmark_ecc_generic_ecc.cpp ./target/micros/stm32f446/make/single/crt.cpp -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_ecc_generic_ecc.map -T ./target/micros/stm32f446/make/stm32f446.ld --specs=nano.specs --specs=nosys.specs -o ./bin/app_benchmark_ecc_generic_ecc.elf +arm-none-eabi-g++ -std=$STD -Werror -Wall $wflags -Os -g -gdwarf-2 -fno-exceptions -ffunction-sections -fdata-sections -x c++ -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs -ftemplate-depth=128 -Wzero-as-null-pointer-constant -mcpu=cortex-m4 -mtune=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffast-math -mno-unaligned-access -mno-long-calls -I./src/mcal/stm32f446 -I./src -DAPP_BENCHMARK_TYPE=APP_BENCHMARK_TYPE_ECC_GENERIC_ECC -DAPP_BENCHMARK_STANDALONE_MAIN ./src/app/benchmark/app_benchmark_ecc_generic_ecc.cpp ./target/micros/stm32f446/make/single/crt.cpp -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_ecc_generic_ecc.map -T ./target/micros/stm32f446/make/stm32f446_with_stdlib.ld --specs=nano.specs --specs=nosys.specs -o ./bin/app_benchmark_ecc_generic_ecc.elf arm-none-eabi-g++ -std=$STD -Werror -Wall -O2 -g -gdwarf-2 -fno-exceptions -ffunction-sections -fdata-sections -x c++ -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs -ftemplate-depth=128 -Wzero-as-null-pointer-constant -mcpu=cortex-m4 -mtune=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffast-math -mno-unaligned-access -mno-long-calls -I./src/mcal/stm32f446 -I./src -I../../cppalliance-decimal-root/include -I../../boost-root -DAPP_BENCHMARK_TYPE=APP_BENCHMARK_TYPE_NON_STD_DECIMAL -DAPP_BENCHMARK_STANDALONE_MAIN ./src/app/benchmark/app_benchmark_non_std_decimal.cpp ./target/micros/stm32f446/make/single/crt.cpp -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_non_std_decimal.map -T ./target/micros/stm32f446/make/stm32f446_with_stdlib.ld --specs=nano.specs --specs=nosys.specs -o ./bin/app_benchmark_non_std_decimal.elf -arm-none-eabi-g++ -std=$STD -Werror -Wall -O2 -g -gdwarf-2 -fno-exceptions -ffunction-sections -fdata-sections -x c++ -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs -ftemplate-depth=128 -Wzero-as-null-pointer-constant -mcpu=cortex-m4 -mtune=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffast-math -mno-unaligned-access -mno-long-calls -I./src/mcal/stm32f446 -I./src -I../../cppalliance-crypt-root/include -I../../boost-root -DAPP_BENCHMARK_TYPE=APP_BENCHMARK_TYPE_BOOST_CRYPT_HASHER -DAPP_BENCHMARK_STANDALONE_MAIN ./src/app/benchmark/app_benchmark_boost_crypt_hasher.cpp ./target/micros/stm32f446/make/single/crt.cpp -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_boost_crypt_hasher.map -T ./target/micros/stm32f446/make/stm32f446_with_stdlib.ld --specs=nano.specs --specs=nosys.specs -o ./bin/app_benchmark_boost_crypt_hasher.elf +arm-none-eabi-g++ -std=$STD -Werror -Wall -O2 -g -gdwarf-2 -fno-exceptions -ffunction-sections -fdata-sections -x c++ -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs -ftemplate-depth=128 -Wzero-as-null-pointer-constant -mcpu=cortex-m4 -mtune=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ffast-math -mno-unaligned-access -mno-long-calls -I./src/mcal/stm32f446 -I./src -I../../cppalliance-crypt-root/include -I../../boost-root -DAPP_BENCHMARK_TYPE=APP_BENCHMARK_TYPE_BOOST_CRYPT_HASHER -DAPP_BENCHMARK_STANDALONE_MAIN ./src/app/benchmark/app_benchmark_boost_crypt_hasher.cpp ./target/micros/stm32f446/make/single/crt.cpp -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_boost_crypt_hasher.map -T ./target/micros/stm32f446/make/stm32f446.ld --specs=nano.specs --specs=nosys.specs -o ./bin/app_benchmark_boost_crypt_hasher.elf ls -la ./bin/app_benchmark_complex.elf ./bin/app_benchmark_complex.map result_ls_complex=$?