Skip to content

Commit 3770167

Browse files
authored
Add Windows CI... (#823)
1 parent a2ff971 commit 3770167

File tree

3 files changed

+129
-1
lines changed

3 files changed

+129
-1
lines changed
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
# Copyright (C) The DDC development team, see COPYRIGHT.md file
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
---
6+
name: Tests on Windows
7+
8+
# yamllint disable-line rule:truthy
9+
on:
10+
pull_request:
11+
paths:
12+
- '.github/workflows/tests-windows.yaml'
13+
- '**.cpp'
14+
- '**.hpp'
15+
- '**.hpp.in'
16+
- 'CMakeLists.txt'
17+
- '**/CMakeLists.txt'
18+
- '**.cmake'
19+
- '**.cmake.in'
20+
- 'docker/**'
21+
- 'vendor/**'
22+
push:
23+
branches:
24+
- main
25+
paths:
26+
- '.github/workflows/tests-windows.yaml'
27+
- '**.cpp'
28+
- '**.hpp'
29+
- '**.hpp.in'
30+
- 'CMakeLists.txt'
31+
- '**/CMakeLists.txt'
32+
- '**.cmake'
33+
- '**.cmake.in'
34+
- 'docker/**'
35+
- 'vendor/**'
36+
37+
concurrency:
38+
group: ${{github.workflow}}-${{github.ref == github.ref_protected && github.run_id || github.event.pull_request.number || github.ref}}
39+
cancel-in-progress: true
40+
41+
jobs:
42+
id_repo:
43+
runs-on: windows-latest
44+
steps:
45+
- name: Identify repository
46+
id: identify_repo
47+
run: |
48+
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"
49+
outputs: {in_base_repo: '${{steps.identify_repo.outputs.in_base_repo}}'}
50+
51+
test-windows:
52+
if: github.ref_name != 'main'
53+
strategy:
54+
fail-fast: false
55+
matrix:
56+
cxx_version: ['17', '20'] # C++23 does not work
57+
config: ['Release']
58+
runs-on: windows-latest
59+
env:
60+
Kokkos_ROOT: ${{github.workspace}}/opt/kokkos
61+
GTest_ROOT: ${{github.workspace}}/opt/gtest
62+
CMAKE_BUILD_PARALLEL_LEVEL: 4
63+
steps:
64+
- name: Checkout built branch
65+
uses: actions/checkout@v4
66+
- uses: actions/checkout@v4
67+
with:
68+
repository: google/googletest
69+
ref: v1.16.0
70+
path: googletest
71+
- name: Install Google test
72+
shell: bash
73+
run: |
74+
cmake \
75+
-D CMAKE_CXX_STANDARD=${{matrix.cxx_version}} \
76+
-D CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded \
77+
-B build \
78+
-S googletest
79+
cmake --build build --config ${{matrix.config}}
80+
cmake --install build --config ${{matrix.config}} --prefix $GTest_ROOT
81+
rm -rf build
82+
- uses: actions/checkout@v4
83+
with:
84+
repository: kokkos/kokkos
85+
ref: 4.6.00
86+
path: kokkos
87+
- name: Install Kokkos
88+
shell: bash
89+
run: |
90+
cmake \
91+
-D CMAKE_CXX_STANDARD=${{matrix.cxx_version}} \
92+
-D CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded \
93+
-D Kokkos_ENABLE_DEPRECATED_CODE_4=OFF \
94+
-D Kokkos_ENABLE_DEPRECATION_WARNINGS=OFF \
95+
-D Kokkos_ENABLE_SERIAL=ON \
96+
-B build \
97+
-S kokkos
98+
cmake --build build --config ${{matrix.config}}
99+
cmake --install build --config ${{matrix.config}} --prefix $Kokkos_ROOT
100+
rm -rf build
101+
- name: Build DDC
102+
shell: bash
103+
run: |
104+
cmake \
105+
-D CMAKE_CXX_STANDARD=${{matrix.cxx_version}} \
106+
-D CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded \
107+
-D DDC_GTest_DEPENDENCY_POLICY=INSTALLED \
108+
-D DDC_Kokkos_DEPENDENCY_POLICY=INSTALLED \
109+
-D DDC_BUILD_KERNELS_FFT=OFF \
110+
-D DDC_BUILD_KERNELS_SPLINES=OFF \
111+
-D DDC_BUILD_PDI_WRAPPER=OFF \
112+
-B build
113+
cmake --build build --config ${{matrix.config}}
114+
ctest --test-dir build --build-config ${{matrix.config}} --output-on-failure --timeout 10 --output-junit tests.xml
115+
- name: Publish Test Report
116+
uses: mikepenz/action-junit-report@v5
117+
if: ( success() || failure() ) # always run even if the previous step fails
118+
with:
119+
report_paths: '${{github.workspace}}/build/tests.xml'
120+
- name: Run examples
121+
shell: bash
122+
run: |
123+
./build/examples/${{matrix.config}}/game_of_life.exe
124+
./build/examples/${{matrix.config}}/heat_equation.exe
125+
./build/examples/${{matrix.config}}/non_uniform_heat_equation.exe
126+
./build/examples/${{matrix.config}}/uniform_heat_equation.exe

include/ddc/chunk_span.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ class ChunkSpan<ElementType, DiscreteDomain<DDims...>, LayoutStridedPolicy, Memo
106106
discrete_domain_type const& domain)
107107
{
108108
if (!domain.empty()) {
109-
extents_type const extents_s((front<DDims>(domain) + extents<DDims>(domain)).uid()...);
109+
extents_type const extents_s(
110+
(front<DDims>(domain) + ddc::extents<DDims>(domain)).uid()...);
110111
std::array<std::size_t, sizeof...(DDims)> const strides_s {
111112
allocation_mdspan.mapping().stride(
112113
type_seq_rank_v<DDims, detail::TypeSeq<DDims...>>)...};

include/ddc/detail/type_seq.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ template <class QueryTag>
2727
struct TypeSeqRank<SingleType<QueryTag>, TypeSeq<>>
2828
{
2929
static constexpr bool present = false;
30+
static constexpr std::size_t val = std::numeric_limits<std::size_t>::max();
3031
};
3132

3233
template <class QueryTag, class... TagsTail>

0 commit comments

Comments
 (0)