Skip to content

Commit

Permalink
Merge pull request #463 from ckormanyos/update_sync
Browse files Browse the repository at this point in the history
Update sync
  • Loading branch information
ckormanyos authored Jan 27, 2024
2 parents 74ca655 + f39e449 commit 87e3fd1
Show file tree
Hide file tree
Showing 14 changed files with 606 additions and 620 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ------------------------------------------------------------------------------
# Copyright Christopher Kormanyos 2022.
# Copyright Christopher Kormanyos 2022 - 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)
Expand Down Expand Up @@ -29,7 +29,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Configure (cpp)
if: ${{ matrix.language == 'cpp' }}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/real-time-cpp-examples.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
##############################################################################
# Copyright Christopher Kormanyos 2023.
# Copyright Christopher Kormanyos 2023 - 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)
Expand All @@ -23,7 +23,7 @@ jobs:
matrix:
example: [ chapter02_02, chapter02_06 ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: update-tools
Expand All @@ -44,7 +44,7 @@ jobs:
matrix:
example: [ chapter02_03, chapter02_03a, chapter03_02, chapter04_04, chapter04_04a, chapter06_01, chapter06_14, chapter09_07, chapter09_08, chapter09_08a, chapter10_08, chapter10_08a, chapter11_07, chapter12_04, chapter16_08, chapter17_03, chapter17_03a ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: update-tools
Expand All @@ -65,7 +65,7 @@ jobs:
matrix:
example: [ chapter10_09 ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: update-tools
Expand All @@ -83,7 +83,7 @@ jobs:
matrix:
example: [ chapter02_03, chapter02_03a, chapter03_02, chapter04_04, chapter04_04a, chapter06_01, chapter06_14, chapter09_07, chapter09_08, chapter09_08a, chapter10_08, chapter10_08a, chapter10_09, chapter11_07, chapter12_04, chapter17_03, chapter17_03a ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- uses: ilammy/msvc-dev-cmd@v1
Expand All @@ -102,7 +102,7 @@ jobs:
matrix:
example: [ chapter16_08 ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: clone-boost-develop
working-directory: ${{ runner.workspace }}
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/real-time-cpp-snippets.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
##############################################################################
# Copyright Christopher Kormanyos 2023.
# Copyright Christopher Kormanyos 2023 - 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)
Expand All @@ -24,7 +24,7 @@ jobs:
chapter: [ appendix0a, chapter01, chapter03, chapter04, chapter05, chapter07, chapter08, chapter09, chapter12, chapter16, chapter17 ]
compiler: [ g++, clang++ ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: host-snippets-all
Expand All @@ -43,7 +43,7 @@ jobs:
chapter: [ chapter06 ]
compiler: [ g++, clang++ ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: clone-submods-bootstrap-headers-boost-develop
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
chapter: [ chapter10 ]
compiler: [ g++, clang++ ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: clone-submods-bootstrap-headers-boost-develop
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/real-time-cpp-sonar.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ------------------------------------------------------------------------------
# Copyright Christopher Kormanyos 2022 - 2023.
# Copyright Christopher Kormanyos 2022 - 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)
Expand All @@ -21,7 +21,7 @@ jobs:
SONAR_SERVER_URL: "https://sonarcloud.io"
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 17
Expand Down
44 changes: 22 additions & 22 deletions .github/workflows/real-time-cpp.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
##############################################################################
# Copyright Christopher Kormanyos 2021 - 2023.
# Copyright Christopher Kormanyos 2021 - 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)
Expand All @@ -24,7 +24,7 @@ jobs:
standard: [ c++14 ]
compiler: [ g++, clang++ ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: update-tools
Expand All @@ -51,7 +51,7 @@ jobs:
matrix:
suite: [ avr, atmega2560 ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: update-tools
Expand All @@ -71,7 +71,7 @@ jobs:
matrix:
suite: [ avr, atmega2560 ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: update-tools
Expand All @@ -91,7 +91,7 @@ jobs:
matrix:
suite: [ avr, atmega2560 ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: clone-osx-cross-homebrew-avr
Expand Down Expand Up @@ -135,7 +135,7 @@ jobs:
matrix:
suite: [ am335x, bcm2835_raspi_b, lpc11c24, nxp_imxrt1062, stm32f100, stm32f407, stm32f429, stm32f446, stm32h7a3, stm32l100c, stm32l152 ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: update-tools
Expand All @@ -155,7 +155,7 @@ jobs:
matrix:
suite: [ am335x, bcm2835_raspi_b, lpc11c24, nxp_imxrt1062, stm32f100, stm32f407, stm32f429, stm32f446, stm32h7a3, stm32l100c, stm32l152 ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: update-tools
Expand All @@ -175,7 +175,7 @@ jobs:
matrix:
suite: [ am335x, bcm2835_raspi_b, lpc11c24, nxp_imxrt1062, stm32f100, stm32f407, stm32f429, stm32f446, stm32h7a3, stm32l100c, stm32l152 ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: wget-macos-gnu-arm-toolchain
Expand Down Expand Up @@ -215,7 +215,7 @@ jobs:
matrix:
suite: [ riscvfe310 ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: update-tools
Expand All @@ -232,7 +232,7 @@ jobs:
target-x86_64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: build-target-x86_64-w64-mingw32
Expand All @@ -244,7 +244,7 @@ jobs:
target-host-cmake:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: build-target-host
Expand All @@ -266,7 +266,7 @@ jobs:
matrix:
suite: [ Debug, Release ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- uses: ilammy/msvc-dev-cmd@v1
Expand All @@ -288,7 +288,7 @@ jobs:
compiler: [ g++, clang++ ]
standard: [ c++14, c++17, c++2a ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: clone-submods-bootstrap-headers-boost-develop
Expand Down Expand Up @@ -316,7 +316,7 @@ jobs:
compiler: [ g++-8, g++-9, clang++-8, clang++-9 ]
standard: [ c++14, c++17 ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: update-tools
Expand Down Expand Up @@ -346,7 +346,7 @@ jobs:
compiler: [ g++-10, clang++-10 ]
standard: [ c++14, c++17, c++20 ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: update-tools
Expand All @@ -373,7 +373,7 @@ jobs:
compiler: [ g++, clang++ ]
standard: [ c++14, c++17, c++2a ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: clone-submods-bootstrap-headers-boost-develop
Expand All @@ -400,7 +400,7 @@ jobs:
matrix:
standard: [ c++14 ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: update-tools
Expand All @@ -418,7 +418,7 @@ jobs:
matrix:
standard: [ c++14, c++17, c++2a ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: update-tools
Expand All @@ -443,7 +443,7 @@ jobs:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: update-tools
Expand All @@ -466,7 +466,7 @@ jobs:
compiler: [ g++, clang++ ]
standard: [ c++20 ]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: benchmark_single-cnl
Expand All @@ -483,7 +483,7 @@ jobs:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: update-tools
Expand Down Expand Up @@ -520,7 +520,7 @@ jobs:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: update-tools
Expand Down
36 changes: 23 additions & 13 deletions ref_app/src/app/benchmark/app_benchmark_wide_integer.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////////
// Copyright Christopher Kormanyos 2018 - 2023.
// Copyright Christopher Kormanyos 2018 - 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)
Expand All @@ -9,7 +9,14 @@

#if(APP_BENCHMARK_TYPE == APP_BENCHMARK_TYPE_WIDE_INTEGER)

#define WIDE_INTEGER_DISABLE_WIDE_INTEGER_CONSTEXPR
#if (defined(__GNUC__) && defined(__AVR__) && (__GNUC__ < 10))
#define APP_BENCHMARK_WIDE_INTEGER_CONSTEXPR_OR_CONST const // NOLINT(cppcoreguidelines-macro-usage)
#define APP_BENCHMARK_WIDE_INTEGER_CONSTEXPR_IS_COMPILE_TIME_CONSTANT 0 // NOLINT(cppcoreguidelines-macro-usage)
#else
#define APP_BENCHMARK_WIDE_INTEGER_CONSTEXPR_OR_CONST constexpr // NOLINT(cppcoreguidelines-macro-usage)
#define APP_BENCHMARK_WIDE_INTEGER_CONSTEXPR_IS_COMPILE_TIME_CONSTANT 1 // NOLINT(cppcoreguidelines-macro-usage)
#endif

#define WIDE_INTEGER_DISABLE_IOSTREAM
#define WIDE_INTEGER_DISABLE_TO_STRING
#define WIDE_INTEGER_DISABLE_IMPLEMENT_UTIL_DYNAMIC_ARRAY
Expand Down Expand Up @@ -56,16 +63,17 @@ namespace
// Modulus:
// a % b = 0x14998D5CA3DB6385F7DEDF4621DE48A9104AC13797C6567713D7ABC216D7AB4C

WIDE_INTEGER_CONSTEXPR uint256_t a("0xF4DF741DE58BCB2F37F18372026EF9CBCFC456CB80AF54D53BDEED78410065DE");
WIDE_INTEGER_CONSTEXPR uint256_t b("0x166D63E0202B3D90ECCEAA046341AB504658F55B974A7FD63733ECF89DD0DF75");
WIDE_INTEGER_CONSTEXPR uint512_t c("0x1573D6A7CEA734D99865C4F428184983CDB018B80E9CC44B83C773FBE11993E7E491A360C57EB4306C61F9A04F7F7D99BE3676AAD2D71C5592D5AE70F84AF076");
WIDE_INTEGER_CONSTEXPR uint256_t m("0x14998D5CA3DB6385F7DEDF4621DE48A9104AC13797C6567713D7ABC216D7AB4C");
APP_BENCHMARK_WIDE_INTEGER_CONSTEXPR_OR_CONST uint256_t a("0xF4DF741DE58BCB2F37F18372026EF9CBCFC456CB80AF54D53BDEED78410065DE");
APP_BENCHMARK_WIDE_INTEGER_CONSTEXPR_OR_CONST uint256_t b("0x166D63E0202B3D90ECCEAA046341AB504658F55B974A7FD63733ECF89DD0DF75");
APP_BENCHMARK_WIDE_INTEGER_CONSTEXPR_OR_CONST uint512_t c("0x1573D6A7CEA734D99865C4F428184983CDB018B80E9CC44B83C773FBE11993E7E491A360C57EB4306C61F9A04F7F7D99BE3676AAD2D71C5592D5AE70F84AF076");
APP_BENCHMARK_WIDE_INTEGER_CONSTEXPR_OR_CONST uint256_t m("0x14998D5CA3DB6385F7DEDF4621DE48A9104AC13797C6567713D7ABC216D7AB4C");

auto run_wide_integer_mul() -> bool
{
WIDE_INTEGER_CONSTEXPR auto result_of_mul_is_ok = ((uint512_t(a) * uint512_t(b)) == c);
APP_BENCHMARK_WIDE_INTEGER_CONSTEXPR_OR_CONST auto result_of_mul_is_ok = ((uint512_t(a) * uint512_t(b)) == c);

#if (defined(WIDE_INTEGER_CONSTEXPR_IS_COMPILE_TIME_CONST) && (WIDE_INTEGER_CONSTEXPR_IS_COMPILE_TIME_CONST != 0))
#if (defined(APP_BENCHMARK_WIDE_INTEGER_CONSTEXPR_IS_COMPILE_TIME_CONSTANT) \
&& (APP_BENCHMARK_WIDE_INTEGER_CONSTEXPR_IS_COMPILE_TIME_CONSTANT == 1))
static_assert(result_of_mul_is_ok == true, "Error: result_of_mul_is_ok not OK!");
#endif

Expand All @@ -74,11 +82,12 @@ namespace

auto run_wide_integer_div() -> bool
{
WIDE_INTEGER_CONSTEXPR uint256_t q(static_cast<std::uint8_t>(UINT8_C(10)));
APP_BENCHMARK_WIDE_INTEGER_CONSTEXPR_OR_CONST uint256_t q(static_cast<std::uint8_t>(UINT8_C(10)));

WIDE_INTEGER_CONSTEXPR auto result_of_div_is_ok = ((a / b) == q);
APP_BENCHMARK_WIDE_INTEGER_CONSTEXPR_OR_CONST auto result_of_div_is_ok = ((a / b) == q);

#if (defined(WIDE_INTEGER_CONSTEXPR_IS_COMPILE_TIME_CONST) && (WIDE_INTEGER_CONSTEXPR_IS_COMPILE_TIME_CONST != 0))
#if (defined(APP_BENCHMARK_WIDE_INTEGER_CONSTEXPR_IS_COMPILE_TIME_CONSTANT) \
&& (APP_BENCHMARK_WIDE_INTEGER_CONSTEXPR_IS_COMPILE_TIME_CONSTANT == 1))
static_assert(result_of_div_is_ok == true, "Error: result_of_div_is_ok not OK!");
#endif

Expand All @@ -87,9 +96,10 @@ namespace

auto run_wide_integer_mod() -> bool
{
WIDE_INTEGER_CONSTEXPR auto result_of_mod_is_ok = ((a % b) == m);
APP_BENCHMARK_WIDE_INTEGER_CONSTEXPR_OR_CONST auto result_of_mod_is_ok = ((a % b) == m);

#if (defined(WIDE_INTEGER_CONSTEXPR_IS_COMPILE_TIME_CONST) && (WIDE_INTEGER_CONSTEXPR_IS_COMPILE_TIME_CONST != 0))
#if (defined(APP_BENCHMARK_WIDE_INTEGER_CONSTEXPR_IS_COMPILE_TIME_CONSTANT) \
&& (APP_BENCHMARK_WIDE_INTEGER_CONSTEXPR_IS_COMPILE_TIME_CONSTANT == 1))
static_assert(result_of_mod_is_ok == true, "Error: result_of_div_is_ok not OK!");
#endif

Expand Down
Loading

0 comments on commit 87e3fd1

Please sign in to comment.