Skip to content
This repository was archived by the owner on Sep 22, 2025. It is now read-only.

Commit 45ba1ab

Browse files
committed
Fix association of tests to cmake target groups and missing EOLs before EOFs
1 parent eef4b0e commit 45ba1ab

File tree

5 files changed

+27
-29
lines changed

5 files changed

+27
-29
lines changed

include/dr/mp/halo/instance.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,4 @@ class span_halo : public span_halo_impl<T, Memory> {
9595
return halo;
9696
}
9797
};
98-
} // namespace dr::mp
98+
} // namespace dr::mp

test/gtest/mp/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ add_executable(
4343
stencil.cpp
4444
segments.cpp
4545
slide_view.cpp
46-
wave_kernel.cpp
47-
wide-halo-1d-3.cpp
48-
wide-halo-2d-3.cpp)
46+
wave_kernel.cpp)
4947

5048
add_executable(
5149
mp-tests-3

test/gtest/mp/mdstar.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class Mdspan : public ::testing::Test {
3535

3636
TEST_F(Mdspan, StaticAssert) {
3737
xp::distributed_vector<T> dist(n2d, dist2d_1d);
38-
auto mdspan = xp::views::mdspan(dist, extents2d);
38+
auto mdspan = xp::views::mdspan(dist, extents2d, dist2d_1d);
3939
static_assert(rng::forward_range<decltype(mdspan)>);
4040
static_assert(dr::distributed_range<decltype(mdspan)>);
4141
auto segments = dr::ranges::segments(mdspan);
@@ -47,7 +47,7 @@ TEST_F(Mdspan, StaticAssert) {
4747

4848
TEST_F(Mdspan, Iterator) {
4949
xp::distributed_vector<T> dist(n2d, dist2d_1d);
50-
auto mdspan = xp::views::mdspan(dist, extents2d);
50+
auto mdspan = xp::views::mdspan(dist, extents2d, dist2d_1d);
5151

5252
*mdspan.begin() = 17;
5353
xp::fence();
@@ -57,7 +57,7 @@ TEST_F(Mdspan, Iterator) {
5757

5858
TEST_F(Mdspan, Mdindex2D) {
5959
xp::distributed_vector<T> dist(n2d, dist2d_1d);
60-
auto dmdspan = xp::views::mdspan(dist, extents2d);
60+
auto dmdspan = xp::views::mdspan(dist, extents2d, dist2d_1d);
6161

6262
std::size_t i = 1, j = 2;
6363
dmdspan.mdspan()(i, j) = 17;
@@ -68,7 +68,7 @@ TEST_F(Mdspan, Mdindex2D) {
6868

6969
TEST_F(Mdspan, Mdindex3D) {
7070
xp::distributed_vector<T> dist(n3d, dist3d_1d);
71-
auto dmdspan = xp::views::mdspan(dist, extents3d);
71+
auto dmdspan = xp::views::mdspan(dist, extents3d, dist3d_1d);
7272

7373
std::size_t i = 1, j = 2, k = 0;
7474
dmdspan.mdspan()(i, j, k) = 17;
@@ -79,7 +79,7 @@ TEST_F(Mdspan, Mdindex3D) {
7979

8080
TEST_F(Mdspan, Pipe) {
8181
xp::distributed_vector<T> dist(n2d, dist2d_1d);
82-
auto mdspan = dist | xp::views::mdspan(extents2d);
82+
auto mdspan = dist | xp::views::mdspan(extents2d, dist2d_1d);
8383

8484
*mdspan.begin() = 17;
8585
xp::fence();
@@ -89,7 +89,7 @@ TEST_F(Mdspan, Pipe) {
8989

9090
TEST_F(Mdspan, SegmentExtents) {
9191
xp::distributed_vector<T> dist(n2d, dist2d_1d);
92-
auto dmdspan = xp::views::mdspan(dist, extents2d);
92+
auto dmdspan = xp::views::mdspan(dist, extents2d, dist2d_1d);
9393

9494
// Sum of leading dimension matches original
9595
std::size_t x = 0;
@@ -106,7 +106,7 @@ TEST_F(Mdspan, Subrange) {
106106
xp::distributed_vector<T> dist(n2d, dist2d_1d);
107107
auto inner = rng::subrange(dist.begin() + ydim, dist.end() - ydim);
108108
std::array<std::size_t, 2> inner_extents({extents2d[0] - 2, extents2d[1]});
109-
auto dmdspan = xp::views::mdspan(inner, inner_extents);
109+
auto dmdspan = xp::views::mdspan(inner, inner_extents, dist2d_1d);
110110

111111
// Summing up leading dimension size of segments should equal
112112
// original minus 2 rows
@@ -123,7 +123,7 @@ TEST_F(Mdspan, Subrange) {
123123
TEST_F(Mdspan, GridExtents) {
124124
xp::distributed_vector<T> dist(n2d, dist2d_1d);
125125
xp::iota(dist, 100);
126-
auto dmdspan = xp::views::mdspan(dist, extents2d);
126+
auto dmdspan = xp::views::mdspan(dist, extents2d, dist2d_1d);
127127
auto grid = dmdspan.grid();
128128

129129
auto x = 0;
@@ -147,7 +147,7 @@ TEST_F(Mdspan, GridLocalReference) {
147147

148148
xp::distributed_vector<T> dist(n2d, dist2d_1d);
149149
xp::iota(dist, 100);
150-
auto dmdspan = xp::views::mdspan(dist, extents2d);
150+
auto dmdspan = xp::views::mdspan(dist, extents2d, dist2d_1d);
151151
auto grid = dmdspan.grid();
152152

153153
auto tile = grid(0, 0).mdspan();

test/gtest/mp/wide-halo-1d-3.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,25 @@
44

55
#include "xp-tests.hpp"
66

7-
template <typename T> class WideHalo3 : public testing::Test {};
7+
template <typename T> class WideHalo3_1D : public testing::Test {};
88

99
using T = int;
1010
using Array = dr::mp::distributed_vector<T>;
1111

12-
const std::size_t redundancy = 2;
13-
const std::size_t size = 6;
12+
static const std::size_t redundancy = 2;
13+
static const std::size_t size = 6;
1414

15-
dr::mp::distribution get_distribution() {
15+
static dr::mp::distribution get_distribution() {
1616
return dr::mp::distribution().halo(1).redundancy(redundancy);
1717
}
1818

19-
int &get(Array &v, std::size_t i) { return *(v.begin() + i).local(); }
19+
static int &get(Array &v, std::size_t i) { return *(v.begin() + i).local(); }
2020

21-
TEST(WideHalo3, suite_works_for_3_processes_only) {
21+
TEST(WideHalo3_1D, suite_works_for_3_processes_only) {
2222
EXPECT_EQ(dr::mp::default_comm().size(), 3);
2323
}
2424

25-
TEST(WideHalo3, halo_is_visible_after_exchange_not_earlier) {
25+
TEST(WideHalo3_1D, halo_is_visible_after_exchange_not_earlier) {
2626
dr::mp::distribution dist = get_distribution();
2727
Array dv(size, dist);
2828
Array dv_out(size, dist);
@@ -141,7 +141,7 @@ TEST(WideHalo3, halo_is_visible_after_exchange_not_earlier) {
141141
}
142142
}
143143

144-
TEST(WideHalo3, halo_api_works) {
144+
TEST(WideHalo3_1D, halo_api_works) {
145145
dr::mp::distribution dist = get_distribution();
146146
Array dv(size, dist);
147147
Array dv_out(size, dist);

test/gtest/mp/wide-halo-2d-3.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,27 @@
44

55
#include "xp-tests.hpp"
66

7-
template <typename T> class WideHalo3 : public testing::Test {};
7+
template <typename T> class WideHalo3_2D : public testing::Test {};
88

99
using T = int;
1010
using Array = dr::mp::distributed_mdarray<T, 2>;
1111

12-
const std::size_t redundancy = 2;
13-
const std::array<std::size_t, 2> size = {6, 6};
12+
static const std::size_t redundancy = 2;
13+
static const std::array<std::size_t, 2> size = {6, 6};
1414

15-
dr::mp::distribution get_distribution() {
15+
static dr::mp::distribution get_distribution() {
1616
return dr::mp::distribution().halo(1).redundancy(redundancy);
1717
}
1818

19-
int &get(Array &v, std::size_t i, std::size_t j) {
19+
static int &get(Array &v, std::size_t i, std::size_t j) {
2020
return *(v.begin() + i * size[0] + j).local();
2121
}
2222

23-
TEST(WideHalo3, suite_works_for_3_processes_only) {
23+
TEST(WideHalo3_2D, suite_works_for_3_processes_only) {
2424
EXPECT_EQ(dr::mp::default_comm().size(), 3);
2525
}
2626

27-
TEST(WideHalo3, halo2d_is_visible_after_exchange_not_earlier) {
27+
TEST(WideHalo3_2D, halo2d_is_visible_after_exchange_not_earlier) {
2828
dr::mp::distribution dist = get_distribution();
2929
Array dv(size, dist);
3030
Array dv_out(size, dist);
@@ -178,7 +178,7 @@ TEST(WideHalo3, halo2d_is_visible_after_exchange_not_earlier) {
178178
}
179179
}
180180

181-
TEST(WideHalo3, halo2d_api_works) {
181+
TEST(WideHalo3_2D, halo2d_api_works) {
182182
dr::mp::distribution dist = get_distribution();
183183
Array dv(size, dist);
184184
Array dv_out(size, dist);

0 commit comments

Comments
 (0)