Cilkify #40
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI Benchmark | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
permissions: | |
contents: read | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
jobs: | |
bench: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0 | |
- name: install | |
run: | | |
sudo apt update | |
sudo apt install build-essential ninja-build cmake | |
- name: fftw-download # TODO use fftw-cpp for download | |
run: | | |
wget https://www.fftw.org/fftw-3.3.10.tar.gz | |
tar -xf fftw-3.3.10.tar.gz | |
- name: configure-fftw | |
working-directory: ./fftw-3.3.10 | |
run: | | |
./configure --enable-threads --enable-avx2 --enable-avx512 | |
make | |
sudo make install | |
- name: build | |
run: | | |
mkdir cmake-build-release | |
cd cmake-build-release | |
cmake ../cpp -G Ninja -D CMAKE_BUILD_TYPE=Release -D ENABLE_CILK=OFF | |
ninja | |
- name: benchmark | |
run: ./cmake-build-release/bench/bench-naive --benchmark_out_format=json --benchmark_out=../bench-naive.json --benchmark_repetitions=10 | |
# Compare to baseline (main) | |
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0 | |
with: | |
ref: main | |
- name: build-main | |
run: | | |
mkdir cmake-build-release-main | |
cd cmake-build-release-main | |
cmake ../cpp -G Ninja -D CMAKE_BUILD_TYPE=Release -D ENABLE_CILK=OFF | |
ninja | |
- name: benchmark-main | |
run: ./cmake-build-release-main/bench/bench-naive --benchmark_out_format=json --benchmark_out=../bench-naive-main.json --benchmark_repetitions=10 | |
- name: compare-install | |
run: | | |
# Use cmake-build-release-main because cmake-build-release is gone after checkout | |
pip3 install -r cmake-build-release-main/_deps/google-benchmark-src/tools/requirements.txt | |
- name: compare | |
run: | | |
echo "Times in milliseconds" | |
python3 cmake-build-release-main/_deps/google-benchmark-src/tools/compare.py -d bench-naive-compared.json benchmarks ../bench-naive-main.json ../bench-naive.json | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: bench-naive-comparison | |
path: bench-naive-compared.json | |
compression-level: '0' # Short file, no need to compress |