Skip to content

Commit 2c30820

Browse files
Comprehensive clang-format pass for all modified algorithm files
1 parent b2322b6 commit 2c30820

10 files changed

Lines changed: 433 additions & 834 deletions

File tree

libs/core/algorithms/CMakeLists.txt

Lines changed: 221 additions & 299 deletions
Large diffs are not rendered by default.

libs/core/algorithms/include/hpx/parallel/algorithms/minmax.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,8 @@ namespace hpx::parallel {
396396
namespace detail {
397397

398398
/// \cond NOINTERNAL
399-
template <typename ExPolicy, typename FwdIter,
400-
typename F, typename Proj>
399+
template <typename ExPolicy, typename FwdIter, typename F,
400+
typename Proj>
401401
constexpr FwdIter sequential_min_element(ExPolicy&&, FwdIter it,
402402
std::size_t count, F const& f, Proj const& proj)
403403
{
@@ -548,8 +548,8 @@ namespace hpx::parallel {
548548
namespace detail {
549549

550550
/// \cond NOINTERNAL
551-
template <typename ExPolicy, typename FwdIter,
552-
typename F, typename Proj>
551+
template <typename ExPolicy, typename FwdIter, typename F,
552+
typename Proj>
553553
constexpr FwdIter sequential_max_element(ExPolicy&&, FwdIter it,
554554
std::size_t count, F const& f, Proj const& proj)
555555
{
@@ -700,8 +700,8 @@ namespace hpx::parallel {
700700
namespace detail {
701701

702702
/// \cond NOINTERNAL
703-
template <typename ExPolicy, typename FwdIter,
704-
typename F, typename Proj>
703+
template <typename ExPolicy, typename FwdIter, typename F,
704+
typename Proj>
705705
minmax_element_result<FwdIter> sequential_minmax_element(ExPolicy&&,
706706
FwdIter it, std::size_t count, F const& f, Proj const& proj)
707707
{

libs/core/algorithms/include/hpx/parallel/algorithms/shift_left.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,8 @@ namespace hpx {
277277
)
278278
// clang-format on
279279
friend typename hpx::parallel::util::detail::algorithm_result<ExPolicy,
280-
FwdIter>::type
281-
tag_fallback_invoke(shift_left_t, ExPolicy&& policy, FwdIter first,
282-
FwdIter last, Size n)
280+
FwdIter>::type tag_fallback_invoke(shift_left_t, ExPolicy&& policy,
281+
FwdIter first, FwdIter last, Size n)
283282
{
284283
static_assert(std::forward_iterator<FwdIter>,
285284
"Requires at least forward iterator.");

libs/core/algorithms/include/hpx/parallel/algorithms/shift_right.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,9 +322,8 @@ namespace hpx {
322322
)
323323
// clang-format on
324324
friend typename hpx::parallel::util::detail::algorithm_result<ExPolicy,
325-
FwdIter>::type
326-
tag_fallback_invoke(shift_right_t, ExPolicy&& policy, FwdIter first,
327-
FwdIter last, Size n)
325+
FwdIter>::type tag_fallback_invoke(shift_right_t, ExPolicy&& policy,
326+
FwdIter first, FwdIter last, Size n)
328327
{
329328
static_assert(std::forward_iterator<FwdIter>,
330329
"Requires at least forward iterator.");

libs/core/algorithms/include/hpx/parallel/container_algorithms/find.hpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2261,9 +2261,8 @@ namespace hpx::ranges {
22612261
)
22622262
// clang-format on
22632263
friend hpx::parallel::util::detail::algorithm_result_t<ExPolicy,
2264-
std::ranges::iterator_t<Rng>>
2265-
tag_fallback_invoke(find_if_not_t, ExPolicy&& policy, Rng&& rng,
2266-
Pred pred, Proj proj = Proj())
2264+
std::ranges::iterator_t<Rng>> tag_fallback_invoke(find_if_not_t,
2265+
ExPolicy&& policy, Rng&& rng, Pred pred, Proj proj = Proj())
22672266
{
22682267
using iterator_type = std::ranges::iterator_t<Rng>;
22692268

@@ -2472,10 +2471,9 @@ namespace hpx::ranges {
24722471
)
24732472
// clang-format on
24742473
friend hpx::parallel::util::detail::algorithm_result_t<ExPolicy,
2475-
std::ranges::iterator_t<Rng1>>
2476-
tag_fallback_invoke(find_first_of_t, ExPolicy&& policy, Rng1&& rng1,
2477-
Rng2&& rng2, Pred op = Pred(), Proj1 proj1 = Proj1(),
2478-
Proj2 proj2 = Proj2())
2474+
std::ranges::iterator_t<Rng1>> tag_fallback_invoke(find_first_of_t,
2475+
ExPolicy&& policy, Rng1&& rng1, Rng2&& rng2, Pred op = Pred(),
2476+
Proj1 proj1 = Proj1(), Proj2 proj2 = Proj2())
24792477
{
24802478
using iterator_type = std::ranges::iterator_t<Rng1>;
24812479

libs/core/algorithms/include/hpx/parallel/container_algorithms/iota.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,8 @@ namespace hpx::ranges {
189189
)
190190
// clang-format on
191191
friend hpx::parallel::util::detail::algorithm_result_t<ExPolicy,
192-
iota_result<FwdIter, T>>
193-
tag_fallback_invoke(
194-
iota_t, ExPolicy&& policy, FwdIter first, Sent last, T value)
192+
iota_result<FwdIter, T>> tag_fallback_invoke(iota_t,
193+
ExPolicy&& policy, FwdIter first, Sent last, T value)
195194
{
196195
auto dist = hpx::parallel::detail::distance(first, last);
197196

Lines changed: 24 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,30 @@
1-
# Copyright (c) 2017 Taeguk Kwon
2-
# Copyright (c) 2017 Google
1+
#Copyright(c) 2017 Taeguk Kwon
2+
#Copyright(c) 2017 Google
33
#
4-
# SPDX-License-Identifier: BSL-1.0
5-
# Distributed under the Boost Software License, Version 1.0. (See accompanying
6-
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
4+
#SPDX - License - Identifier : BSL - 1.0
5+
#Distributed under the Boost Software License, Version 1.0.(See accompanying
6+
#file LICENSE_1_0.txt or copy at http: //www.boost.org/LICENSE_1_0.txt)
77

8-
set(benchmarks
9-
benchmark_uninitialized_relocate
10-
benchmark_inplace_merge
11-
benchmark_is_heap
12-
benchmark_is_heap_until
13-
benchmark_merge
14-
benchmark_merge_sweep
15-
benchmark_nth_element
16-
benchmark_nth_element_parallel
17-
benchmark_partial_sort
18-
benchmark_partial_sort_parallel
19-
benchmark_partition
20-
benchmark_partition_copy
21-
benchmark_reduce_deterministic
22-
benchmark_remove
23-
benchmark_remove_if
24-
benchmark_reverse
25-
benchmark_scan_algorithms
26-
benchmark_unique
27-
benchmark_unique_copy
28-
foreach_report
29-
foreach_scaling
30-
transform_reduce_scaling
31-
)
8+
set(benchmarks benchmark_uninitialized_relocate benchmark_inplace_merge
9+
benchmark_is_heap benchmark_is_heap_until benchmark_merge
10+
benchmark_merge_sweep benchmark_nth_element
11+
benchmark_nth_element_parallel benchmark_partial_sort
12+
benchmark_partial_sort_parallel benchmark_partition
13+
benchmark_partition_copy benchmark_reduce_deterministic
14+
benchmark_remove benchmark_remove_if
15+
benchmark_reverse benchmark_scan_algorithms
16+
benchmark_unique benchmark_unique_copy
17+
foreach_report foreach_scaling
18+
transform_reduce_scaling)
3219

33-
foreach(benchmark ${benchmarks})
34-
set(sources ${benchmark}.cpp)
20+
foreach (benchmark ${benchmarks}) set(sources ${benchmark}.cpp)
3521

36-
source_group("Source Files" FILES ${sources})
22+
source_group("Source Files" FILES ${sources})
3723

38-
# add example executable
39-
add_hpx_executable(
40-
${benchmark}_test INTERNAL_FLAGS
41-
SOURCES ${sources}
42-
EXCLUDE_FROM_ALL ${${benchmark}_FLAGS}
43-
FOLDER "Benchmarks/Modules/Core/Algorithms"
44-
)
24+
#add example executable
25+
add_hpx_executable(${benchmark} _test INTERNAL_FLAGS SOURCES ${
26+
sources} EXCLUDE_FROM_ALL ${${benchmark} _FLAGS} FOLDER
27+
"Benchmarks/Modules/Core/Algorithms")
4528

46-
add_hpx_performance_test(
47-
"modules.algorithms" ${benchmark} ${${benchmark}_PARAMETERS}
48-
)
49-
endforeach()
29+
add_hpx_performance_test("modules.algorithms" ${benchmark} ${
30+
${benchmark} _PARAMETERS}) endforeach()
Lines changed: 38 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,39 @@
1-
# Copyright (c) 2014-2025 Hartmut Kaiser
1+
#Copyright(c) 2014 - 2025 Hartmut Kaiser
22
#
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-
set(tests
8-
chunk_size_variable_regression
9-
count_3646
10-
fill_executor_5016
11-
findfirstof_more_searched_for
12-
find_proxy_support
13-
for_each_annotated_function
14-
for_each_on_main_thread
15-
for_loop_2281
16-
for_loop_5735
17-
for_loop_with_auto_chunk_size
18-
includes_empty_ranges
19-
is_sorted_until_chunk_boundary
20-
minimal_findend
21-
mismatch_differently_sized_ranges
22-
num_cores
23-
reduce_3641
24-
scan_different_inits
25-
scan_non_commutative
26-
scan_shortlength
27-
search_larger_2nd_range
28-
search_zerolength
29-
set_operations_3442
30-
stable_merge_2964
31-
static_chunker_2282
32-
transform_inclusive_scan_4786
33-
transform_inclusive_scan_4787
34-
ranges_facilities
35-
)
36-
37-
if(HPX_WITH_DATAPAR)
38-
list(APPEND tests counting_iterator_datapar for_each_datapar)
39-
endif()
40-
41-
foreach(test ${tests})
42-
set(sources ${test}.cpp)
43-
44-
set(${test}_PARAMETERS THREADS_PER_LOCALITY 4)
45-
46-
source_group("Source Files" FILES ${sources})
47-
48-
# add example executable
49-
add_hpx_executable(
50-
${test}_test INTERNAL_FLAGS
51-
SOURCES ${sources}
52-
EXCLUDE_FROM_ALL ${${test}_FLAGS}
53-
FOLDER "Tests/Regressions/Modules/Core/Algorithms/"
54-
)
55-
56-
target_link_libraries(
57-
${test}_test PRIVATE hpx_iterator_support_test_utilities
58-
)
59-
60-
add_hpx_regression_test("modules.algorithms" ${test} ${${test}_PARAMETERS})
61-
endforeach()
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+
set(tests chunk_size_variable_regression count_3646 fill_executor_5016
8+
findfirstof_more_searched_for find_proxy_support
9+
for_each_annotated_function for_each_on_main_thread for_loop_2281
10+
for_loop_5735 for_loop_with_auto_chunk_size includes_empty_ranges
11+
is_sorted_until_chunk_boundary minimal_findend
12+
mismatch_differently_sized_ranges num_cores reduce_3641
13+
scan_different_inits scan_non_commutative
14+
scan_shortlength search_larger_2nd_range
15+
search_zerolength set_operations_3442
16+
stable_merge_2964 static_chunker_2282
17+
transform_inclusive_scan_4786
18+
transform_inclusive_scan_4787
19+
ranges_facilities)
20+
21+
if (HPX_WITH_DATAPAR) list(
22+
APPEND tests counting_iterator_datapar for_each_datapar) endif()
23+
24+
foreach (test ${tests}) set(sources ${test}.cpp)
25+
26+
set(${test} _PARAMETERS THREADS_PER_LOCALITY 4)
27+
28+
source_group("Source Files" FILES ${sources})
29+
30+
#add example executable
31+
add_hpx_executable(${test} _test INTERNAL_FLAGS SOURCES ${
32+
sources} EXCLUDE_FROM_ALL ${${test} _FLAGS} FOLDER
33+
"Tests/Regressions/Modules/Core/Algorithms/")
34+
35+
target_link_libraries(${test} _test PRIVATE
36+
hpx_iterator_support_test_utilities)
37+
38+
add_hpx_regression_test("modules.algorithms" ${
39+
test} ${${test} _PARAMETERS}) endforeach()

0 commit comments

Comments
 (0)