Skip to content

Commit 57c0b46

Browse files
committed
Adapting HPX algorithm module to C++ modules
Signed-off-by: Hartmut Kaiser <hartmut.kaiser@gmail.com>
1 parent 6ead071 commit 57c0b46

312 files changed

Lines changed: 2366 additions & 2427 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cmake/templates/std_headers.hpp.in

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
#include <hpx/config/compiler_specific.hpp>
1414

1515
@cxx_standard_headers@
16-
// Some standard headers include the following headers.
17-
#include <numeric>
18-
1916
#if defined(HPX_HAVE_STDEXEC)
2017
# if defined(HPX_GCC_VERSION)
2118
# pragma GCC diagnostic push

components/component_storage/include/hpx/components/component_storage/component_storage.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
#include <hpx/config.hpp>
1010
#include <hpx/components/client_base.hpp>
11-
#include <hpx/modules/futures.hpp>
1211
#include <hpx/modules/async_base.hpp>
12+
#include <hpx/modules/futures.hpp>
1313
#include <hpx/naming_base/address.hpp>
1414
#include <hpx/naming_base/id_type.hpp>
1515

components/containers/partitioned_vector/include/hpx/components/containers/partitioned_vector/partitioned_vector_segmented_iterator.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@
1414
// http://lafstern.org/matt/segmented.pdf.
1515

1616
#include <hpx/config.hpp>
17-
#include <hpx/algorithms/traits/is_value_proxy.hpp>
18-
#include <hpx/algorithms/traits/segmented_iterator_traits.hpp>
1917
#include <hpx/assert.hpp>
18+
#include #include < hpx / modules / algorithms.hpp>
2019
#include <hpx/modules/async_base.hpp>
2120
#include <hpx/modules/iterator_support.hpp>
2221
#include <hpx/naming_base/id_type.hpp>

components/containers/partitioned_vector/tests/unit/partitioned_vector_view.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
#include <hpx/collectives/spmd_block.hpp>
1010
#include <hpx/components/containers/partitioned_vector/partitioned_vector_local_view.hpp>
1111
#include <hpx/components/containers/partitioned_vector/partitioned_vector_view.hpp>
12-
#include <hpx/modules/executors.hpp>
1312
#include <hpx/hpx_main.hpp>
1413
#include <hpx/include/partitioned_vector_predef.hpp>
1514
#include <hpx/include/partitioned_vector_view.hpp>
15+
#include <hpx/modules/executors.hpp>
1616
#include <hpx/modules/testing.hpp>
1717
#include <hpx/runtime_distributed/find_all_localities.hpp>
1818

docs/sphinx/manual/executors.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Parallel Executor
5353
.. code-block:: c++
5454

5555
#include <hpx/execution.hpp>
56-
#include <hpx/parallel/algorithms/for_each.hpp>
56+
#include <hpx/algorithm.hpp>
5757
#include <vector>
5858

5959
std::vector<int> data(100, 1);
@@ -77,7 +77,7 @@ Fork-Join Executor
7777
.. code-block:: c++
7878

7979
#include <hpx/execution.hpp>
80-
#include <hpx/parallel/algorithms/for_each.hpp>
80+
#include <hpx/algorithm.hpp>
8181
#include <vector>
8282

8383
std::vector<int> data(100, 1);
@@ -103,7 +103,7 @@ Sequential Executor
103103
.. code-block:: c++
104104

105105
#include <hpx/execution.hpp>
106-
#include <hpx/parallel/algorithms/for_each.hpp>
106+
#include <hpx/algorithm.hpp>
107107
#include <vector>
108108

109109
std::vector<int> data(100, 1);

examples/quickstart/sort_by_key_demo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
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+
#include <hpx/algorithm.hpp>
78
#include <hpx/execution.hpp>
89
#include <hpx/init.hpp>
9-
#include <hpx/parallel/algorithms/sort_by_key.hpp>
1010

1111
#include <cstddef>
1212
#include <iostream>

libs/core/algorithms/CMakeLists.txt

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2019-2023 The STE||AR-Group
1+
# Copyright (c) 2019-2025 The STE||AR-Group
22
#
33
# SPDX-License-Identifier: BSL-1.0
44
# Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -172,22 +172,6 @@ set(algorithms_headers
172172
hpx/parallel/container_algorithms/unique.hpp
173173
hpx/parallel/container_memory.hpp
174174
hpx/parallel/container_numeric.hpp
175-
hpx/parallel/datapar.hpp
176-
hpx/parallel/datapar/adjacent_difference.hpp
177-
hpx/parallel/datapar/adjacent_find.hpp
178-
hpx/parallel/datapar/equal.hpp
179-
hpx/parallel/datapar/fill.hpp
180-
hpx/parallel/datapar/find.hpp
181-
hpx/parallel/datapar/generate.hpp
182-
hpx/parallel/datapar/handle_local_exceptions.hpp
183-
hpx/parallel/datapar/iterator_helpers.hpp
184-
hpx/parallel/datapar/loop.hpp
185-
hpx/parallel/datapar/mismatch.hpp
186-
hpx/parallel/datapar/reduce.hpp
187-
hpx/parallel/datapar/replace.hpp
188-
hpx/parallel/datapar/transfer.hpp
189-
hpx/parallel/datapar/transform_loop.hpp
190-
hpx/parallel/datapar/zip_iterator.hpp
191175
hpx/parallel/memory.hpp
192176
hpx/parallel/numeric.hpp
193177
hpx/parallel/run_on_all.hpp
@@ -236,6 +220,28 @@ set(algorithms_headers
236220
hpx/parallel/util/zip_iterator.hpp
237221
)
238222

223+
if(HPX_WITH_DATAPAR)
224+
set(algorithms_headers
225+
${algorithms_headers}
226+
hpx/parallel/datapar.hpp
227+
hpx/parallel/datapar/adjacent_difference.hpp
228+
hpx/parallel/datapar/adjacent_find.hpp
229+
hpx/parallel/datapar/equal.hpp
230+
hpx/parallel/datapar/fill.hpp
231+
hpx/parallel/datapar/find.hpp
232+
hpx/parallel/datapar/generate.hpp
233+
hpx/parallel/datapar/handle_local_exceptions.hpp
234+
hpx/parallel/datapar/iterator_helpers.hpp
235+
hpx/parallel/datapar/loop.hpp
236+
hpx/parallel/datapar/mismatch.hpp
237+
hpx/parallel/datapar/reduce.hpp
238+
hpx/parallel/datapar/replace.hpp
239+
hpx/parallel/datapar/transfer.hpp
240+
hpx/parallel/datapar/transform_loop.hpp
241+
hpx/parallel/datapar/zip_iterator.hpp
242+
)
243+
endif()
244+
239245
# cmake-format: off
240246
set(algorithms_compat_headers
241247
hpx/algorithms.hpp => hpx/algorithm.hpp
@@ -252,8 +258,11 @@ set(algorithms_sources handle_exception_termination_handler.cpp task_group.cpp)
252258
include(HPX_AddModule)
253259
add_hpx_module(
254260
core algorithms
261+
GLOBAL_HEADER_GEN ON
262+
GLOBAL_HEADER_MODULE_GEN ON
255263
HEADERS ${algorithms_headers}
256264
COMPAT_HEADERS ${algorithms_compat_headers}
265+
ADD_TO_GLOBAL_HEADER "hpx/parallel/util/detail/handle_remote_exceptions.hpp"
257266
SOURCES ${algorithms_sources}
258267
MODULE_DEPENDENCIES
259268
hpx_async_combinators
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
// Copyright (c) 2023 Hartmut Kaiser
1+
// Copyright (c) 2023-2025 Hartmut Kaiser
22
//
33
// SPDX-License-Identifier: BSL-1.0
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

77
#pragma once
88

9+
#include <hpx/config.hpp>
10+
911
#include <utility>
1012

1113
namespace hpx::traits {
1214

13-
template <typename T>
15+
HPX_CXX_EXPORT template <typename T>
1416
inline constexpr bool is_pair_v = false;
1517

16-
template <typename T1, typename T2>
18+
HPX_CXX_EXPORT template <typename T1, typename T2>
1719
inline constexpr bool is_pair_v<std::pair<T1, T2>> = true;
1820
} // namespace hpx::traits

libs/core/algorithms/include/hpx/algorithms/traits/is_value_proxy.hpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,26 @@
88

99
#pragma once
1010

11+
#include <hpx/config.hpp>
12+
1113
#include <type_traits>
1214

1315
namespace hpx::traits {
1416

15-
template <typename T>
17+
HPX_CXX_EXPORT template <typename T>
1618
struct is_value_proxy : std::false_type
1719
{
1820
};
1921

20-
template <typename T>
22+
HPX_CXX_EXPORT template <typename T>
2123
inline constexpr bool is_value_proxy_v = is_value_proxy<T>::value;
2224

23-
template <typename T>
25+
HPX_CXX_EXPORT template <typename T>
2426
struct proxy_value
2527
{
2628
using type = T;
2729
};
2830

29-
template <typename T>
31+
HPX_CXX_EXPORT template <typename T>
3032
using proxy_value_t = typename proxy_value<T>::type;
3133
} // namespace hpx::traits

0 commit comments

Comments
 (0)