Skip to content

Commit

Permalink
#291: build benchmarks and compiler benchmarks in the CI
Browse files Browse the repository at this point in the history
  • Loading branch information
nmm0 committed Oct 30, 2023
1 parent 33772c8 commit 4ee7b30
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,27 +44,27 @@ jobs:

- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/mdspan-build

- name: Check Out
uses: actions/checkout@v2
with:
path: ${{github.workspace}}/mdspan-src

- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/mdspan-build
run: CXX=${{ matrix.compiler_prefix}}/${{ matrix.compiler_driver }} cmake $GITHUB_WORKSPACE/mdspan-src -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/mdspan-install -DMDSPAN_ENABLE_TESTS=ON -DMDSPAN_ENABLE_EXAMPLES=ON -DCMAKE_CXX_FLAGS=${{matrix.cxx_flags_extra}}
run: CXX=${{ matrix.compiler_prefix}}/${{ matrix.compiler_driver }} cmake $GITHUB_WORKSPACE/mdspan-src -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/mdspan-install -DMDSPAN_ENABLE_TESTS=ON -DMDSPAN_ENABLE_EXAMPLES=ON -DMDSPAN_ENABLE_BENCHMARKS=ON -DMDSPAN_ENABLE_COMP_BENCH=ON -DCMAKE_CXX_FLAGS=${{matrix.cxx_flags_extra}}

- name: Build
shell: bash
working-directory: ${{github.workspace}}/mdspan-build
run: make -j

- name: Test
working-directory: ${{github.workspace}}/mdspan-build
shell: bash
run: ctest

- name: Install
shell: bash
working-directory: ${{github.workspace}}/mdspan-build
Expand Down
15 changes: 14 additions & 1 deletion comp_bench/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@

include(metabench)

# C++ standards that our benchmark will actually support
set(_cbench_supported_standards 17 20 23)

# Obtain the subset that are actually supported by the compiler
set(_cbench_standards "")
foreach(_std IN LISTS _cbench_supported_standards)
if ("cxx_std_${_std}" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
list(APPEND _cbench_standards "${_std}")
endif()
endforeach()

message(STATUS "Using the following C++ standards for compiler benchmarking: ${_cbench_standards}")

function(add_cxx_comparison name template range)

set(all_datasets)
foreach(std IN ITEMS 11 14 17)
foreach(std IN LISTS _cbench_standards)
metabench_add_dataset(
${name}_${std}
${template}
Expand Down

0 comments on commit 4ee7b30

Please sign in to comment.