Skip to content

Commit 454cb46

Browse files
committed
Adapt last HPX modules of the HPX core library to C++ modules
Signed-off-by: Hartmut Kaiser <hartmut.kaiser@gmail.com>
1 parent a2aee50 commit 454cb46

48 files changed

Lines changed: 195 additions & 210 deletions

Some content is hidden

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

libs/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,9 @@ set(_is_library "$<IN_LIST:$<TARGET_PROPERTY:TYPE>,${_library_types}>")
152152
add_library(hpx INTERFACE)
153153
add_library(init INTERFACE)
154154
add_library(wrap_main INTERFACE)
155-
add_library(auto_wrap_main INTERFACE)
155+
if(NOT MSVC)
156+
add_library(auto_wrap_main INTERFACE)
157+
endif()
156158

157159
target_link_libraries(hpx INTERFACE hpx_full)
158160

libs/core/async_mpi/include/hpx/async_mpi/mpi_future.hpp

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ namespace hpx::mpi::experimental {
5252

5353
// mutex needed to protect mpi request vector, note that the
5454
// mpi poll function takes place inside the main scheduling loop
55-
// of hpx and not on an hpx worker thread, so we must use std:mutex
55+
// of hpx and not on a hpx worker thread, so we must use std:mutex
5656
HPX_CXX_EXPORT HPX_CORE_EXPORT mutex_type& get_vector_mtx();
5757

5858
// -----------------------------------------------------------------
@@ -114,8 +114,8 @@ namespace hpx::mpi::experimental {
114114
HPX_CXX_EXPORT using future_data_ptr = hpx::intrusive_ptr<future_data>;
115115

116116
// -----------------------------------------------------------------
117-
// a convenience structure to hold state vars
118-
// used extensively with debug::print to display rank etc
117+
// a convenience structure to hold state vars used extensively with
118+
// debug::print to display rank etc
119119
HPX_CXX_EXPORT struct mpi_info
120120
{
121121
bool error_handler_initialized_ = false;
@@ -135,8 +135,8 @@ namespace hpx::mpi::experimental {
135135
std::ostream& os, mpi_info const& i);
136136

137137
// -----------------------------------------------------------------
138-
// an MPI error handling type that we can use to intercept
139-
// MPI errors is we enable the error handler
138+
// an MPI error handling type that we can use to intercept MPI errors is
139+
// we enable the error handler
140140
HPX_CXX_EXPORT HPX_CORE_EXPORT extern MPI_Errhandler hpx_mpi_errhandler;
141141

142142
// function that converts an MPI error into an exception
@@ -161,8 +161,8 @@ namespace hpx::mpi::experimental {
161161
} // namespace detail
162162

163163
// -----------------------------------------------------------------
164-
// set an error handler for communicators that will be called
165-
// on any error instead of the default behavior of program termination
164+
// set an error handler for communicators that will be called on any error
165+
// instead of the default behavior of program termination
166166
HPX_CXX_EXPORT HPX_CORE_EXPORT void set_error_handler();
167167

168168
// -----------------------------------------------------------------
@@ -195,9 +195,9 @@ namespace hpx::mpi::experimental {
195195
} // namespace detail
196196

197197
// -----------------------------------------------------------------
198-
// Background progress function for MPI async operations
199-
// Checks for completed MPI_Requests and sets mpi::experimental::future ready
200-
// when found
198+
// Background progress function for MPI async operations. Checks for
199+
// completed MPI_Requests and sets mpi::experimental::future ready when
200+
// found
201201
HPX_CXX_EXPORT HPX_CORE_EXPORT
202202
hpx::threads::policies::detail::polling_status
203203
poll();
@@ -233,9 +233,8 @@ namespace hpx::mpi::experimental {
233233
});
234234
}
235235

236-
// initialize the hpx::mpi background request handler
237-
// All ranks should call this function,
238-
// but only one thread per rank needs to do so
236+
// initialize the hpx::mpi background request handler All ranks should call
237+
// this function, but only one thread per rank needs to do so
239238
HPX_CXX_EXPORT HPX_CORE_EXPORT void init(bool init_mpi = false,
240239
std::string const& pool_name = "", bool init_errorhandler = false);
241240

libs/core/compute_local/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2019-2022 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
@@ -41,6 +41,7 @@ include(HPX_AddModule)
4141
add_hpx_module(
4242
core compute_local
4343
GLOBAL_HEADER_GEN ON
44+
GLOBAL_HEADER_MODULE_GEN ON
4445
SOURCES ${compute_local_sources}
4546
HEADERS ${compute_local_headers}
4647
COMPAT_HEADERS ${compute_local_compat_headers}

libs/core/compute_local/include/hpx/compute_local/detail/get_proxy_type.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@
1414

1515
namespace hpx::compute::detail {
1616

17-
template <typename T, typename Enable = void>
17+
HPX_CXX_EXPORT template <typename T, typename Enable = void>
1818
struct get_proxy_type_impl
1919
{
2020
using type = T;
2121
};
2222

23-
template <typename T>
23+
HPX_CXX_EXPORT template <typename T>
2424
struct get_proxy_type_impl<T,
2525
std::void_t<typename std::decay_t<T>::proxy_type>>
2626
{
2727
using proxy_type = typename std::decay_t<T>::proxy_type;
2828
};
2929

30-
template <typename T, typename Enable = void>
30+
HPX_CXX_EXPORT template <typename T, typename Enable = void>
3131
struct get_proxy_type : get_proxy_type_impl<T>
3232
{
3333
};

libs/core/compute_local/include/hpx/compute_local/detail/iterator.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
namespace hpx::compute::detail {
2020

21-
template <typename T, typename Allocator>
21+
HPX_CXX_EXPORT template <typename T, typename Allocator>
2222
struct iterator
2323
: hpx::util::iterator_adaptor<iterator<T, Allocator>,
2424
typename traits::allocator_traits<Allocator>::pointer,
@@ -78,12 +78,12 @@ namespace hpx::compute::detail {
7878
target_type const* target_;
7979
};
8080

81-
template <typename T, typename Allocator>
81+
HPX_CXX_EXPORT template <typename T, typename Allocator>
8282
struct reverse_iterator
8383
{
8484
};
8585

86-
template <typename T, typename Allocator>
86+
HPX_CXX_EXPORT template <typename T, typename Allocator>
8787
struct const_reverse_iterator
8888
{
8989
};

libs/core/compute_local/include/hpx/compute_local/host/block_allocator.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ namespace hpx::compute::host {
3434

3535
/// The policy_allocator allocates blocks of memory touched according to
3636
/// the distribution policy of the given executor.
37-
template <typename T, typename Policy,
37+
HPX_CXX_EXPORT template <typename T, typename Policy,
3838
typename Enable =
3939
std::enable_if_t<hpx::is_execution_policy_v<Policy>>>
4040
struct policy_allocator
@@ -253,7 +253,7 @@ namespace hpx::compute::host {
253253
/// std::size_t N = 2048;
254254
/// vector_type v(N, allocator_type(numa_nodes));
255255
///
256-
template <typename T,
256+
HPX_CXX_EXPORT template <typename T,
257257
typename Executor =
258258
hpx::execution::experimental::restricted_thread_pool_executor>
259259
struct block_allocator

libs/core/compute_local/include/hpx/compute_local/host/block_executor.hpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ namespace hpx::compute::host {
3131
/// It will distribute work evenly across the passed targets
3232
///
3333
/// \tparam Executor The underlying executor to use
34-
template <typename Executor =
35-
hpx::execution::experimental::restricted_thread_pool_executor>
34+
HPX_CXX_EXPORT template <
35+
typename Executor =
36+
hpx::execution::experimental::restricted_thread_pool_executor>
3637
struct block_executor
3738
{
3839
public:
@@ -319,31 +320,31 @@ namespace hpx::compute::host {
319320

320321
namespace hpx::execution::experimental {
321322

322-
template <typename Executor>
323+
HPX_CXX_EXPORT template <typename Executor>
323324
struct executor_execution_category<compute::host::block_executor<Executor>>
324325
{
325326
using type = hpx::execution::parallel_execution_tag;
326327
};
327328

328-
template <typename Executor>
329+
HPX_CXX_EXPORT template <typename Executor>
329330
struct is_one_way_executor<compute::host::block_executor<Executor>>
330331
: std::true_type
331332
{
332333
};
333334

334-
template <typename Executor>
335+
HPX_CXX_EXPORT template <typename Executor>
335336
struct is_two_way_executor<compute::host::block_executor<Executor>>
336337
: std::true_type
337338
{
338339
};
339340

340-
template <typename Executor>
341+
HPX_CXX_EXPORT template <typename Executor>
341342
struct is_bulk_one_way_executor<compute::host::block_executor<Executor>>
342343
: std::true_type
343344
{
344345
};
345346

346-
template <typename Executor>
347+
HPX_CXX_EXPORT template <typename Executor>
347348
struct is_bulk_two_way_executor<compute::host::block_executor<Executor>>
348349
: std::true_type
349350
{

libs/core/compute_local/include/hpx/compute_local/host/block_fork_join_executor.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ namespace hpx::execution::experimental {
5252
/// This behaviour is similar to the plain \a fork_join_executor except that
5353
/// the block_fork_join_executor creates a hierarchy of fork_join_executors,
5454
/// one for each target used to initialize it.
55-
class block_fork_join_executor
55+
HPX_CXX_EXPORT class block_fork_join_executor
5656
{
5757
static hpx::threads::mask_type cores_for_targets(
5858
std::vector<compute::host::target> const& targets)

libs/core/compute_local/include/hpx/compute_local/host/get_targets.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
namespace hpx::compute::host {
1414

15-
struct HPX_CORE_EXPORT target;
15+
HPX_CXX_EXPORT struct HPX_CORE_EXPORT target;
1616

17-
HPX_CORE_EXPORT std::vector<target> get_local_targets();
17+
HPX_CXX_EXPORT HPX_CORE_EXPORT std::vector<target> get_local_targets();
1818
} // namespace hpx::compute::host

libs/core/compute_local/include/hpx/compute_local/host/numa_allocator.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
namespace hpx::parallel::util {
3232

3333
///////////////////////////////////////////////////////////////////////////
34-
template <typename T, typename Executors>
34+
HPX_CXX_EXPORT template <typename T, typename Executors>
3535
class numa_allocator
3636
{
3737
using executor_type = typename Executors::value_type;

0 commit comments

Comments
 (0)