Skip to content

Commit 04d8f07

Browse files
authored
Merge pull request #650 from ckormanyos/v850_benches
Add v850 benchmark runs to CI
2 parents 1497d41 + b6b0541 commit 04d8f07

31 files changed

Lines changed: 203 additions & 30 deletions

.github/workflows/real-time-cpp-benchmarks.yml

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,11 @@ jobs:
154154
echo 'Add rl78-unknown-elf-g++ path'
155155
echo
156156
PATH="${{ runner.workspace }}/gcc-15.1.0-rl78-unknown-elf/bin:$PATH"
157-
echo 'Query avr-g++ version'
157+
echo 'Query rl78-unknown-elf-g++ version'
158158
echo
159159
rl78-unknown-elf-g++ -v
160160
echo
161-
echo 'Build avr benchmarks'
161+
echo 'Build rl78-unknown-elf-g++ benchmarks'
162162
echo
163163
./target/build/test_app_benchmarks_rl78.sh ${{ matrix.standard }}
164164
working-directory: ./ref_app/
@@ -198,6 +198,37 @@ jobs:
198198
- name: benchmark_builds-stm32f446
199199
run: ./target/build/test_app_benchmarks_stm32f446.sh ${{ matrix.standard }}
200200
working-directory: ./ref_app/
201+
benchmark_builds-v850:
202+
runs-on: ubuntu-latest
203+
defaults:
204+
run:
205+
shell: bash
206+
strategy:
207+
fail-fast: false
208+
matrix:
209+
standard: [ c++23 ]
210+
steps:
211+
- uses: actions/checkout@v4
212+
with:
213+
fetch-depth: '0'
214+
- name: update-tools
215+
run: |
216+
wget --no-check-certificate https://github.com/ckormanyos/gcc-v850-unknown-elf/releases/download/v14.2.0/gcc-14.2.0-v850-unknown-elf.tar.gz
217+
tar -xzf gcc-14.2.0-v850-unknown-elf.tar.gz -C ${{ runner.workspace }}
218+
- name: benchmark_builds-v850
219+
run: |
220+
echo
221+
echo 'Add v850-unknown-elf-g++ path'
222+
echo
223+
PATH="${{ runner.workspace }}/gcc-14.2.0-v850-unknown-elf/bin:$PATH"
224+
echo 'Query v850-unknown-elf-g++ version'
225+
echo
226+
v850-unknown-elf-g++ -v
227+
echo
228+
echo 'Build v850-unknown-elf-g++ benchmarks'
229+
echo
230+
./target/build/test_app_benchmarks_v850.sh ${{ matrix.standard }}
231+
working-directory: ./ref_app/
201232
benchmark_single-stm32f446:
202233
runs-on: ubuntu-latest
203234
defaults:

ref_app/src/app/benchmark/app_benchmark.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@
88
#ifndef APP_BENCHMARK_2018_10_02_H
99
#define APP_BENCHMARK_2018_10_02_H
1010

11+
#if defined(ATTRIBUTE)
12+
#undef ATTRIBUTE
13+
#endif
14+
15+
#if defined(_MSC_VER)
16+
#define ATTRIBUTE(a)
17+
#else
18+
#define ATTRIBUTE(a) __attribute__((a))
19+
#endif
20+
1121
#define APP_BENCHMARK_TYPE_NONE 0
1222
#define APP_BENCHMARK_TYPE_COMPLEX 1
1323
#define APP_BENCHMARK_TYPE_CRC 2

ref_app/src/app/benchmark/app_benchmark_boost_crypt_hasher.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ extern "C"
9898
}
9999
}
100100

101-
auto main() -> int;
101+
ATTRIBUTE(used) auto main() -> int;
102102

103103
auto main() -> int
104104
{

ref_app/src/app/benchmark/app_benchmark_boost_math_cbrt_tgamma.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ auto app::benchmark::run_boost_math_cbrt_tgamma() -> bool
8989
}
9090

9191
#if defined(APP_BENCHMARK_STANDALONE_MAIN)
92-
auto main() -> int;
92+
ATTRIBUTE(used) auto main() -> int;
9393

9494
auto main() -> int
9595
{

ref_app/src/app/benchmark/app_benchmark_boost_math_cyl_bessel_j.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ auto app::benchmark::run_boost_math_cbrt_cyl_bessel_j() -> bool
129129
}
130130

131131
#if defined(APP_BENCHMARK_STANDALONE_MAIN)
132-
auto main() -> int;
132+
ATTRIBUTE(used) auto main() -> int;
133133

134134
auto main() -> int
135135
{

ref_app/src/app/benchmark/app_benchmark_boost_multiprecision_cbrt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ auto app::benchmark::run_boost_multiprecision_cbrt() -> bool
9090
}
9191

9292
#if defined(APP_BENCHMARK_STANDALONE_MAIN)
93-
auto main() -> int;
93+
ATTRIBUTE(used) auto main() -> int;
9494

9595
auto main() -> int
9696
{

ref_app/src/app/benchmark/app_benchmark_cnl_scaled_integer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ extern "C"
135135
}
136136
}
137137

138-
auto main() -> int;
138+
ATTRIBUTE(used) auto main() -> int;
139139

140140
auto main() -> int
141141
{

ref_app/src/app/benchmark/app_benchmark_complex.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ auto app::benchmark::run_complex() -> bool
3838
}
3939

4040
#if defined(APP_BENCHMARK_STANDALONE_MAIN)
41-
auto main() -> int;
41+
ATTRIBUTE(used) auto main() -> int;
4242

4343
auto main() -> int
4444
{

ref_app/src/app/benchmark/app_benchmark_crc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ extern "C"
6767
}
6868
}
6969

70-
auto main() -> int;
70+
ATTRIBUTE(used) auto main() -> int;
7171

7272
auto main() -> int
7373
{

ref_app/src/app/benchmark/app_benchmark_detail.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
{
5050
const numeric_type ratio { a / b };
5151

52-
const numeric_type closeness { fabs(numeric_type { 1 - ratio }) };
52+
const numeric_type closeness { fabs(static_cast<numeric_type>(1 - ratio )) };
5353

5454
result_is_ok = (closeness < tol);
5555
}

0 commit comments

Comments
 (0)