From 47d5c3abc315e9ad33ad24d6a99957a9d54483f4 Mon Sep 17 00:00:00 2001 From: Yuuichi Asahi Date: Fri, 26 Jul 2024 08:36:26 +0200 Subject: [PATCH] Add C++20 build in CI --- .github/workflows/build_test.yaml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_test.yaml b/.github/workflows/build_test.yaml index c4fff966..e1f15881 100644 --- a/.github/workflows/build_test.yaml +++ b/.github/workflows/build_test.yaml @@ -72,6 +72,7 @@ jobs: c: gcc cxx: g++ cmake_flags: + cxx_standard: 17 kokkos: -DKokkos_ENABLE_OPENMP=ON kokkos_fft: -DCMAKE_CXX_FLAGS="-Wall -Wextra" -DCMAKE_COMPILE_WARNING_AS_ERROR=ON - name: threads @@ -80,6 +81,7 @@ jobs: c: gcc cxx: g++ cmake_flags: + cxx_standard: 20 kokkos: -DKokkos_ENABLE_THREADS=ON kokkos_fft: -DCMAKE_CXX_FLAGS="-Wall -Wextra" -DCMAKE_COMPILE_WARNING_AS_ERROR=ON - name: serial @@ -88,6 +90,7 @@ jobs: c: gcc cxx: g++ cmake_flags: + cxx_standard: 17 kokkos: -DKokkos_ENABLE_SERIAL=ON kokkos_fft: -DCMAKE_CXX_FLAGS="-Wall -Wextra" -DCMAKE_COMPILE_WARNING_AS_ERROR=ON - name: cuda @@ -96,6 +99,7 @@ jobs: c: gcc cxx: g++ cmake_flags: + cxx_standard: 20 kokkos: -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_AMPERE80=ON kokkos_fft: -DCMAKE_CXX_FLAGS="-Wall -Wextra -Werror" - name: hip @@ -104,6 +108,7 @@ jobs: c: hipcc cxx: hipcc cmake_flags: + cxx_standard: 17 kokkos: -DKokkos_ENABLE_HIP=ON -DKokkos_ARCH_VEGA90A=ON kokkos_fft: -DCMAKE_CXX_FLAGS="-Wall -Wextra -Werror" - name: rocm @@ -112,6 +117,7 @@ jobs: c: hipcc cxx: hipcc cmake_flags: + cxx_standard: 20 kokkos: -DKokkos_ENABLE_HIP=ON -DKokkos_ARCH_VEGA90A=ON kokkos_fft: -DCMAKE_CXX_FLAGS="-Wall -Wextra -Werror" -DKokkosFFT_ENABLE_ROCFFT=ON - name: sycl @@ -122,6 +128,7 @@ jobs: cmake_flags: # building for Intel PVC was unsuccessful without the proper # device, so for now, we simply generate generic Intel GPU code + cxx_standard: 17 kokkos: -DKokkos_ENABLE_SYCL=ON -DKokkos_ARCH_INTEL_GEN=ON kokkos_fft: -DCMAKE_CXX_FLAGS="-Wall -Wextra" target: @@ -162,7 +169,7 @@ jobs: -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ -DCMAKE_C_COMPILER=${{ matrix.backend.compiler.c }} \ -DCMAKE_CXX_COMPILER=${{ matrix.backend.compiler.cxx }} \ - -DCMAKE_CXX_STANDARD=17 \ + -DCMAKE_CXX_STANDARD=${{ matrix.backend.cmake_flags.cxx_standard }} \ -DKokkosFFT_ENABLE_EXAMPLES=ON \ -DKokkosFFT_ENABLE_TESTS=ON \ -DKokkosFFT_ENABLE_BENCHMARK=ON \ @@ -212,7 +219,7 @@ jobs: -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ -DCMAKE_C_COMPILER=${{ matrix.backend.compiler.c }} \ -DCMAKE_CXX_COMPILER=${{ matrix.backend.compiler.cxx }} \ - -DCMAKE_CXX_STANDARD=17 \ + -DCMAKE_CXX_STANDARD=${{ matrix.backend.cmake_flags.cxx_standard }} \ ${{ matrix.backend.cmake_flags.kokkos }} \ ${{ matrix.backend.cmake_flags.kokkos_fft }} \ ${{ matrix.target.cmake_flags }} \ @@ -228,7 +235,7 @@ jobs: -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ -DCMAKE_C_COMPILER=${{ matrix.backend.compiler.c }} \ -DCMAKE_CXX_COMPILER=${{ matrix.backend.compiler.cxx }} \ - -DCMAKE_CXX_STANDARD=17 \ + -DCMAKE_CXX_STANDARD=${{ matrix.backend.cmake_flags.cxx_standard }} \ ${{ matrix.backend.cmake_flags.kokkos }} \ tpls/kokkos docker run -v ${{ github.workspace }}:/work ghcr.io/kokkos/kokkos-fft/base_${{ matrix.backend.image }}_${{ needs.check_docker_files.outputs.image_suffix }}:${{ needs.check_docker_files.outputs.image_tag }} \ @@ -245,7 +252,7 @@ jobs: -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ -DCMAKE_C_COMPILER=${{ matrix.backend.compiler.c }} \ -DCMAKE_CXX_COMPILER=${{ matrix.backend.compiler.cxx }} \ - -DCMAKE_CXX_STANDARD=17 \ + -DCMAKE_CXX_STANDARD=${{ matrix.backend.cmake_flags.cxx_standard }} \ ${{ matrix.backend.cmake_flags.kokkos_fft }} \ ${{ matrix.target.cmake_flags }} docker run -v ${{ github.workspace }}:/work ghcr.io/kokkos/kokkos-fft/base_${{ matrix.backend.image }}_${{ needs.check_docker_files.outputs.image_suffix }}:${{ needs.check_docker_files.outputs.image_tag }} \ @@ -261,7 +268,7 @@ jobs: -DCMAKE_PREFIX_PATH=/work/install \ -DCMAKE_C_COMPILER=${{ matrix.backend.compiler.c }} \ -DCMAKE_CXX_COMPILER=${{ matrix.backend.compiler.cxx }} \ - -DCMAKE_CXX_STANDARD=17 \ + -DCMAKE_CXX_STANDARD=${{ matrix.backend.cmake_flags.cxx_standard }} \ install_test/as_library docker run -v ${{ github.workspace }}:/work ghcr.io/kokkos/kokkos-fft/base_${{ matrix.backend.image }}_${{ needs.check_docker_files.outputs.image_suffix }}:${{ needs.check_docker_files.outputs.image_tag }} \ cmake --build install_test/as_library/build -j $(( $(nproc) * 2 + 1 ))