Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
132 changes: 132 additions & 0 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# ------------------------------------------------------------------------------
# Copyright Matt Borland 2026.
# 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)
# ------------------------------------------------------------------------------
#
# Runs the Boost.Decimal benchmarks (test/benchmarks.cpp) in release mode on a
# spread of native runners so that performance numbers, and any regressions in
# them, are captured on every run. The benchmark target is a run-fail test that
# always returns non-zero, so b2 reports success and the timing output is read
# back from the captured .output file.

name: Run Benchmarks

on:
push:
branches:
- master
- develop
- feature/**
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:

concurrency:
group: ${{ format('{0}:{1}:benchmarks', github.repository, github.ref) }}
cancel-in-progress: true

env:
GIT_FETCH_JOBS: 8

jobs:
linux:
name: Linux GCC ${{ matrix.address_model }}-bit
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
address_model: [ 32, 64 ]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v6
- name: Install packages
run: |
sudo apt-get update
sudo apt-get install -y g++-14 g++-14-multilib
- name: Setup Boost
run: |
LIBRARY=${GITHUB_REPOSITORY#*/}
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
REF=${REF#refs/heads/}
BOOST_BRANCH=develop && [ "$REF" = "master" ] && BOOST_BRANCH=master || true
echo "BOOST_BRANCH: $BOOST_BRANCH"
cd ..
git clone -b "$BOOST_BRANCH" --depth 1 "https://github.com/boostorg/boost.git" boost-root
cd boost-root
mkdir -p libs/$LIBRARY
cp -r "$GITHUB_WORKSPACE"/* libs/$LIBRARY
git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py --git_args "--jobs $GIT_FETCH_JOBS" $LIBRARY
./bootstrap.sh
./b2 headers
echo "using gcc : : g++-14 ;" > ~/user-config.jam
- name: Run benchmarks (release)
run: |
cd ../boost-root
./b2 -j$(nproc) toolset=gcc cxxstd=20 variant=release address-model=${{ matrix.address_model }} \
define=BOOST_DECIMAL_RUN_BENCHMARKS libs/$LIBRARY/test//benchmarks
echo "==================== Benchmark results (Linux GCC ${{ matrix.address_model }}-bit) ===================="
find bin.v2 -path '*release*' -name 'benchmarks.output' -exec cat {} +
find bin.v2 -path '*release*' -name 'benchmarks.output' -exec cp {} "$GITHUB_WORKSPACE/benchmarks-linux-gcc-${{ matrix.address_model }}-bit.txt" \;
- name: Upload benchmark output
if: always()
uses: actions/upload-artifact@v6
with:
name: benchmarks-linux-gcc-${{ matrix.address_model }}-bit
path: benchmarks-linux-gcc-${{ matrix.address_model }}-bit.txt
if-no-files-found: warn

windows:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: Windows x64 MSVC
os: windows-latest
arch: x64
- name: Windows ARM64 MSVC
os: windows-11-arm
arch: arm64
defaults:
run:
shell: cmd
steps:
- uses: actions/checkout@v6
- name: Setup Boost
run: |
for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi
echo LIBRARY=%LIBRARY%>>%GITHUB_ENV%
if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF%
set BOOST_BRANCH=develop
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
echo BOOST_BRANCH: %BOOST_BRANCH%
cd ..
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" %LIBRARY%
cmd /c bootstrap
b2 -d0 headers
- name: Run benchmarks (release)
run: |
cd ../boost-root
b2 -j3 libs/%LIBRARY%/test//benchmarks toolset=msvc cxxstd=latest address-model=64 variant=release define=BOOST_DECIMAL_RUN_BENCHMARKS embed-manifest-via=linker || exit /b 1
echo ==================== Benchmark results (%RUNNER_OS% %RUNNER_ARCH%) ====================
for /f "delims=" %%f in ('dir /s /b bin.v2\benchmarks.output 2^>nul') do @type "%%f"
for /f "delims=" %%f in ('dir /s /b bin.v2\benchmarks.output 2^>nul') do @copy /y "%%f" "%GITHUB_WORKSPACE%\benchmarks-windows-${{ matrix.arch }}.txt" >nul
exit /b 0
- name: Upload benchmark output
if: always()
uses: actions/upload-artifact@v6
with:
name: benchmarks-windows-${{ matrix.arch }}
path: benchmarks-windows-${{ matrix.arch }}.txt
if-no-files-found: warn
57 changes: 0 additions & 57 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1125,60 +1125,3 @@ jobs:
run: |
cd ../boost-root/__build__
ctest --output-on-failure --no-tests=error

cuda-cmake-test:
strategy:
fail-fast: false

runs-on: ubuntu-24.04

steps:
- uses: Jimver/cuda-toolkit@v0.2.30
id: cuda-toolkit
with:
cuda: '12.8.0'
method: 'network'
sub-packages: '["nvcc"]'

- name: Output CUDA information
run: |
echo "Installed cuda version is: ${{steps.cuda-toolkit.outputs.cuda}}"+
echo "Cuda install location: ${{steps.cuda-toolkit.outputs.CUDA_PATH}}"
nvcc -V
- uses: actions/checkout@v5

- name: Install Packages
run: |
sudo apt-get install -y cmake make
- name: Setup Boost
run: |
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
LIBRARY=${GITHUB_REPOSITORY#*/}
echo LIBRARY: $LIBRARY
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
echo GITHUB_REF: $GITHUB_REF
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
REF=${REF#refs/heads/}
echo REF: $REF
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
echo BOOST_BRANCH: $BOOST_BRANCH
cd ..
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
mkdir -p libs/$LIBRARY
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
git submodule update --init tools/boostdep
python3 tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
# ctest --output-on-failure --no-tests=error should be added between the last cmake and cd when GPU runners are available
- name: Test C++17/20/23
run: |
for std in 17 20 23; do
echo "======== Testing C++${std} ========"
cd ../boost-root
rm -rf __build__
mkdir __build__ && cd __build__
cmake -DBOOST_INCLUDE_LIBRARIES=$LIBRARY -DBUILD_TESTING=ON -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc -DBOOST_DECIMAL_ENABLE_CUDA=1 -DCMAKE_CUDA_ARCHITECTURES="75;86" -DCMAKE_CUDA_STANDARD=${std} ..
cmake --build . --target tests -j $(nproc)
cd $GITHUB_WORKSPACE
done
Loading
Loading