From 6e3e803227aa2e5f3ef7ce721e2a66de0a8d6269 Mon Sep 17 00:00:00 2001 From: Thomas Padioleau Date: Sun, 13 Apr 2025 19:24:09 +0200 Subject: [PATCH] Add Windows CI... --- .github/workflows/tests-windows.yaml | 126 +++++++++++++++++++++++++++ include/ddc/chunk_span.hpp | 3 +- include/ddc/detail/type_seq.hpp | 1 + 3 files changed, 129 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/tests-windows.yaml diff --git a/.github/workflows/tests-windows.yaml b/.github/workflows/tests-windows.yaml new file mode 100644 index 000000000..d1a29a662 --- /dev/null +++ b/.github/workflows/tests-windows.yaml @@ -0,0 +1,126 @@ +# Copyright (C) The DDC development team, see COPYRIGHT.md file +# +# SPDX-License-Identifier: MIT + +--- +name: Tests on Windows + +# yamllint disable-line rule:truthy +on: + pull_request: + paths: + - '.github/workflows/tests-windows.yaml' + - '**.cpp' + - '**.hpp' + - '**.hpp.in' + - 'CMakeLists.txt' + - '**/CMakeLists.txt' + - '**.cmake' + - '**.cmake.in' + - 'docker/**' + - 'vendor/**' + push: + branches: + - main + paths: + - '.github/workflows/tests-windows.yaml' + - '**.cpp' + - '**.hpp' + - '**.hpp.in' + - 'CMakeLists.txt' + - '**/CMakeLists.txt' + - '**.cmake' + - '**.cmake.in' + - 'docker/**' + - 'vendor/**' + +concurrency: + group: ${{github.workflow}}-${{github.ref == github.ref_protected && github.run_id || github.event.pull_request.number || github.ref}} + cancel-in-progress: true + +jobs: + id_repo: + runs-on: windows-latest + steps: + - name: Identify repository + id: identify_repo + run: | + echo "in_base_repo=${{(github.event_name == 'push' && github.repository == 'CExA-project/ddc') || github.event.pull_request.head.repo.full_name == 'CExA-project/ddc'}}" >> "$GITHUB_OUTPUT" + outputs: {in_base_repo: '${{steps.identify_repo.outputs.in_base_repo}}'} + + test-windows: + if: github.ref_name != 'main' + strategy: + fail-fast: false + matrix: + cxx_version: ['17', '20'] # C++23 does not work + config: ['Release'] + runs-on: windows-latest + env: + Kokkos_ROOT: ${{github.workspace}}/opt/kokkos + GTest_ROOT: ${{github.workspace}}/opt/gtest + CMAKE_BUILD_PARALLEL_LEVEL: 4 + steps: + - name: Checkout built branch + uses: actions/checkout@v4 + - uses: actions/checkout@v4 + with: + repository: google/googletest + ref: v1.16.0 + path: googletest + - name: Install Google test + shell: bash + run: | + cmake \ + -D CMAKE_CXX_STANDARD=${{matrix.cxx_version}} \ + -D CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded \ + -B build \ + -S googletest + cmake --build build --config ${{matrix.config}} + cmake --install build --config ${{matrix.config}} --prefix $GTest_ROOT + rm -rf build + - uses: actions/checkout@v4 + with: + repository: kokkos/kokkos + ref: 4.6.00 + path: kokkos + - name: Install Kokkos + shell: bash + run: | + cmake \ + -D CMAKE_CXX_STANDARD=${{matrix.cxx_version}} \ + -D CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded \ + -D Kokkos_ENABLE_DEPRECATED_CODE_4=OFF \ + -D Kokkos_ENABLE_DEPRECATION_WARNINGS=OFF \ + -D Kokkos_ENABLE_SERIAL=ON \ + -B build \ + -S kokkos + cmake --build build --config ${{matrix.config}} + cmake --install build --config ${{matrix.config}} --prefix $Kokkos_ROOT + rm -rf build + - name: Build DDC + shell: bash + run: | + cmake \ + -D CMAKE_CXX_STANDARD=${{matrix.cxx_version}} \ + -D CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded \ + -D DDC_GTest_DEPENDENCY_POLICY=INSTALLED \ + -D DDC_Kokkos_DEPENDENCY_POLICY=INSTALLED \ + -D DDC_BUILD_KERNELS_FFT=OFF \ + -D DDC_BUILD_KERNELS_SPLINES=OFF \ + -D DDC_BUILD_PDI_WRAPPER=OFF \ + -B build + cmake --build build --config ${{matrix.config}} + ctest --test-dir build --build-config ${{matrix.config}} --output-on-failure --timeout 10 --output-junit tests.xml + - name: Publish Test Report + uses: mikepenz/action-junit-report@v5 + if: ( success() || failure() ) # always run even if the previous step fails + with: + report_paths: '${{github.workspace}}/build/tests.xml' + - name: Run examples + shell: bash + run: | + ./build/examples/${{matrix.config}}/game_of_life.exe + ./build/examples/${{matrix.config}}/heat_equation.exe + ./build/examples/${{matrix.config}}/non_uniform_heat_equation.exe + ./build/examples/${{matrix.config}}/uniform_heat_equation.exe diff --git a/include/ddc/chunk_span.hpp b/include/ddc/chunk_span.hpp index f41eecff7..608b81538 100644 --- a/include/ddc/chunk_span.hpp +++ b/include/ddc/chunk_span.hpp @@ -106,7 +106,8 @@ class ChunkSpan, LayoutStridedPolicy, Memo discrete_domain_type const& domain) { if (!domain.empty()) { - extents_type const extents_s((front(domain) + extents(domain)).uid()...); + extents_type const extents_s( + (front(domain) + ddc::extents(domain)).uid()...); std::array const strides_s { allocation_mdspan.mapping().stride( type_seq_rank_v>)...}; diff --git a/include/ddc/detail/type_seq.hpp b/include/ddc/detail/type_seq.hpp index 9ebafe538..579c657dc 100644 --- a/include/ddc/detail/type_seq.hpp +++ b/include/ddc/detail/type_seq.hpp @@ -27,6 +27,7 @@ template struct TypeSeqRank, TypeSeq<>> { static constexpr bool present = false; + static constexpr std::size_t val = std::numeric_limits::max(); }; template