Skip to content

Commit fc9837c

Browse files
authored
Merge branch 'master' into feature/forward-bulk
2 parents b823699 + 14d6bb9 commit fc9837c

18 files changed

Lines changed: 433 additions & 276 deletions

File tree

cmake/HPX_AddConfigTest.cmake

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -570,15 +570,6 @@ function(hpx_check_for_cxx20_std_construct_at)
570570
)
571571
endfunction()
572572

573-
# ##############################################################################
574-
function(hpx_check_for_cxx20_std_bit_cast)
575-
add_hpx_config_test(
576-
HPX_WITH_CXX20_STD_BIT_CAST
577-
SOURCE cmake/tests/cxx20_std_bit_cast.cpp
578-
FILE ${ARGN}
579-
)
580-
endfunction()
581-
582573
# ##############################################################################
583574
function(hpx_check_for_cxx23_std_generator)
584575
add_hpx_config_test(

cmake/HPX_PerformCxxFeatureTests.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ function(hpx_perform_cxx_feature_tests)
122122
DEFINITIONS HPX_HAVE_CXX20_STD_CONSTRUCT_AT
123123
)
124124

125-
hpx_check_for_cxx20_std_bit_cast(DEFINITIONS HPX_HAVE_CXX20_STD_BIT_CAST)
126125
endif()
127126

128127
if(HPX_WITH_CXX20_COROUTINES)

cmake/templates/std_headers.hpp.in

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@
4444
# endif
4545
#endif
4646

47-
#if defined(HPX_HAVE_CXX20_STD_BIT_CAST) || defined(HPX_HAVE_CXX20_STD_ENDIAN)
48-
# include <bit>
49-
#endif
47+
#include <bit>
5048
#if defined(HPX_HAVE_CXX20_SOURCE_LOCATION)
5149
# include <source_location>
5250
#endif

cmake/tests/cxx20_std_bit_cast.cpp

Lines changed: 0 additions & 18 deletions
This file was deleted.

components/containers/partitioned_vector/tests/regressions/CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,18 @@
44
# Distributed under the Boost Software License, Version 1.0. (See accompanying
55
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
66

7-
set(tests partitioned_vector_2201 partitioned_vector_constructor_6650)
7+
set(tests partitioned_vector_2201 partitioned_vector_constructor_6650
8+
partitioned_vector_fewer_partitions_than_localities
9+
)
810

911
set(partitioned_vector_2201_FLAGS COMPONENT_DEPENDENCIES partitioned_vector)
1012
set(partitioned_vector_constructor_6650_FLAGS COMPONENT_DEPENDENCIES
1113
partitioned_vector
1214
)
15+
set(partitioned_vector_fewer_partitions_than_localities_FLAGS
16+
COMPONENT_DEPENDENCIES partitioned_vector
17+
)
18+
set(partitioned_vector_fewer_partitions_than_localities_PARAMETERS LOCALITIES 3)
1319

1420
foreach(test ${tests})
1521
set(sources ${test}.cpp)
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// Copyright (c) 2026 Mo'men Samir
2+
//
3+
// SPDX-License-Identifier: BSL-1.0
4+
// Distributed under the Boost Software License, Version 1.0. (See accompanying
5+
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6+
7+
// Regression test to make sure default distribution policy works correctly
8+
// when the number of localities is more than the number partitions
9+
10+
#include <hpx/config.hpp>
11+
#if !defined(HPX_COMPUTE_DEVICE_CODE)
12+
#include <hpx/hpx_main.hpp>
13+
#include <hpx/include/partitioned_vector_predef.hpp>
14+
#include <hpx/include/runtime.hpp>
15+
#include <hpx/modules/testing.hpp>
16+
17+
#include <cstddef>
18+
#include <vector>
19+
20+
///////////////////////////////////////////////////////////////////////////////
21+
template <typename T, typename InIter>
22+
void verify_values(InIter first, InIter last, T const& val)
23+
{
24+
for (InIter it = first; it != last; ++it)
25+
{
26+
HPX_TEST_EQ(*it, val);
27+
}
28+
}
29+
30+
template <typename T>
31+
void test_with_policy(std::size_t length, std::size_t num_partitions,
32+
std::vector<hpx::id_type> const& localities)
33+
{
34+
hpx::partitioned_vector<T> v(
35+
length, T(42), hpx::container_layout(num_partitions, localities));
36+
37+
verify_values(v.begin(), v.end(), T(42));
38+
HPX_TEST_EQ(v.size(), length);
39+
}
40+
41+
template <typename T>
42+
void test_partition_locality_combinations()
43+
{
44+
std::vector<hpx::id_type> localities = hpx::find_all_localities();
45+
std::size_t const nlocs = localities.size();
46+
std::size_t const length = 12;
47+
48+
// fewer partitions than localities
49+
if (nlocs >= 2)
50+
test_with_policy<T>(length, nlocs - 1, localities);
51+
52+
// same number of partitions as localities
53+
test_with_policy<T>(length, nlocs, localities);
54+
}
55+
56+
int main()
57+
{
58+
test_partition_locality_combinations<int>();
59+
test_partition_locality_combinations<double>();
60+
61+
return hpx::util::report_errors();
62+
}
63+
#endif

0 commit comments

Comments
 (0)