Skip to content

Commit 9cc5fbf

Browse files
committed
Fixing STD_EXEC and algorithm tests
Signed-off-by: Hartmut Kaiser <hartmut.kaiser@gmail.com>
1 parent 4c203b2 commit 9cc5fbf

File tree

64 files changed

+263
-171
lines changed

Some content is hidden

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

64 files changed

+263
-171
lines changed

cmake/HPX_SetupTarget.cmake

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ function(hpx_setup_target target)
190190
)
191191
endif()
192192
endif()
193-
elseif(HPX_WITH_CXX_MODULES AND ${target}_SCAN_FOR_MODULES)
194-
set(${target}_SCAN_FOR_MODULES OFF)
193+
elseif(HPX_WITH_CXX_MODULES AND target_SCAN_FOR_MODULES)
194+
set(target_SCAN_FOR_MODULES OFF)
195195
endif()
196196

197197
if(("${_type}" STREQUAL "EXECUTABLE") AND MINGW)
@@ -231,21 +231,29 @@ function(hpx_setup_target target)
231231

232232
if(HPX_WITH_CXX_MODULES AND target_SCAN_FOR_MODULES)
233233
hpx_debug("setup_target.${target} SCAN_FOR_MODULES: ON")
234+
234235
hpx_configure_module_consumer(${target} hpx_core_module_if)
235236
if(TARGET hpx_full_module_if)
236237
hpx_configure_module_consumer(${target} hpx_full_module_if)
237238
endif()
238239
else()
239240
hpx_debug("setup_target.${target} SCAN_FOR_MODULES: OFF")
240241

241-
# If modules are enabled, Clang emits DWARF v5, which requires using lld
242-
# instead of ld.
243-
if(HPX_WITH_CXX_MODULES AND (CMAKE_CXX_COMPILER_ID MATCHES "Clang"
244-
OR CMAKE_CXX_COMPILER_ID MATCHES "AppleClang")
245-
)
246-
get_target_property(_type ${target} TYPE)
247-
if((_type STREQUAL "SHARED_LIBRARY") OR (_type STREQUAL "EXECUTABLE"))
248-
target_link_options(${target} PRIVATE "-fuse-ld=lld")
242+
if(HPX_WITH_CXX_MODULES)
243+
# explicitly disable C++ modules
244+
target_compile_definitions(
245+
${target} PRIVATE HPX_HAVE_FORCE_NO_CXX_MODULES
246+
)
247+
248+
# If modules are enabled, Clang emits DWARF v5, which requires using lld
249+
# instead of ld.
250+
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES
251+
"AppleClang"
252+
)
253+
get_target_property(_type ${target} TYPE)
254+
if((_type STREQUAL "SHARED_LIBRARY") OR (_type STREQUAL "EXECUTABLE"))
255+
target_link_options(${target} PRIVATE "-fuse-ld=lld")
256+
endif()
249257
endif()
250258
endif()
251259

cmake/templates/global_module_header_modules.hpp.in

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,17 @@
1111

1212
#include <hpx/config/defines.hpp>
1313

14+
// The compilation will fall back to using the HPX headers (instead of the
15+
// generated C++ module interface files) if any of the following is true:
16+
//
17+
// - C++ modules are not enabled
18+
// - Otherwise:
19+
// - The HPX @libname@ library is being compiled
20+
// - The module interface file is being compiled
21+
// - The current translation unit is not forcing to disable using C++ modules
22+
//
1423
#if !defined(HPX_HAVE_CXX_MODULES) || defined(HPX_@libname_upper@_EXPORTS) || \
15-
defined(HPX_COMPILE_BMI)
24+
defined(HPX_COMPILE_BMI) || defined(HPX_HAVE_FORCE_NO_CXX_MODULES)
1625
@module_headers@
1726
#else
1827

libs/core/algorithms/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,8 @@ add_hpx_module(
266266
GLOBAL_HEADER_MODULE_GEN ON
267267
HEADERS ${algorithms_headers}
268268
COMPAT_HEADERS ${algorithms_compat_headers}
269-
ADD_TO_GLOBAL_HEADER "hpx/parallel/util/detail/handle_remote_exceptions.hpp"
269+
ADD_TO_GLOBAL_HEADER "hpx/parallel/util/detail/chunk_size_iterator.hpp"
270+
"hpx/parallel/util/detail/handle_remote_exceptions.hpp"
270271
SOURCES ${algorithms_sources}
271272
MODULE_DEPENDENCIES
272273
hpx_async_combinators

libs/core/algorithms/include/hpx/parallel/unseq/simd_helpers.hpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright (c) 2022 A Kishore Kumar
2-
// Copyright (c) 2023 Hartmut Kaiser
2+
// Copyright (c) 2023-2026 Hartmut Kaiser
33
//
44
// SPDX-License-Identifier: BSL-1.0
55
// Distributed under the Boost Software License, Version 1.0. (See accompanying
@@ -25,7 +25,7 @@ namespace hpx::parallel::util {
2525

2626
// Compiler and Hardware should also support vector operations for IterDiff,
2727
// else we see slower performance when compared to sequential version
28-
template <typename Iter, typename IterDiff, typename F>
28+
HPX_CXX_CORE_EXPORT template <typename Iter, typename IterDiff, typename F>
2929
Iter unseq_first_n(Iter const first, IterDiff const n, F&& f) noexcept
3030
{
3131
// OMP loops can not have ++Iter, only integral types are allowed Hence
@@ -54,7 +54,7 @@ namespace hpx::parallel::util {
5454
IterDiff i = 0;
5555
constexpr std::int32_t num_blocks =
5656
HPX_LANE_SIZE / sizeof(std::int32_t);
57-
alignas(HPX_LANE_SIZE) std::int32_t simd_lane[num_blocks] = {0};
57+
alignas(HPX_LANE_SIZE) std::int32_t simd_lane[num_blocks] = {};
5858

5959
while (i <= n - num_blocks)
6060
{
@@ -98,7 +98,8 @@ namespace hpx::parallel::util {
9898
#endif // HPX_EARLYEXIT_PRESENT
9999
}
100100

101-
template <typename Iter1, typename Iter2, typename IterDiff, typename F>
101+
HPX_CXX_CORE_EXPORT template <typename Iter1, typename Iter2,
102+
typename IterDiff, typename F>
102103
std::pair<Iter1, Iter2> unseq2_first_n(Iter1 const first1,
103104
Iter2 const first2, IterDiff const n, F&& f) noexcept
104105
{
@@ -118,7 +119,7 @@ namespace hpx::parallel::util {
118119

119120
constexpr std::int32_t num_blocks =
120121
HPX_LANE_SIZE / sizeof(std::int32_t);
121-
alignas(HPX_LANE_SIZE) std::int32_t simd_lane[num_blocks] = {0};
122+
alignas(HPX_LANE_SIZE) std::int32_t simd_lane[num_blocks] = {};
122123

123124
IterDiff outer_loop_ind = 0;
124125
while (outer_loop_ind <= n - num_blocks)

libs/core/algorithms/tests/performance/transform_reduce_scaling.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
// Copyright (c) 2014 Grant Mercer
2-
// Copyright (c) 2020-2025 Hartmut Kaiser
2+
// Copyright (c) 2020-2026 Hartmut Kaiser
33
//
44
// SPDX-License-Identifier: BSL-1.0
55
// Distributed under the Boost Software License, Version 1.0. (See accompanying
66
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
77

88
#include <hpx/chrono.hpp>
99
#include <hpx/init.hpp>
10+
#include <hpx/modules/type_support.hpp>
1011
#include <hpx/numeric.hpp>
1112

1213
#include "worker_timed.hpp"

libs/core/algorithms/tests/regressions/ranges_facilities.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
66

77
#include <hpx/iterator_support/tests/iter_sent.hpp>
8+
#include <hpx/modules/algorithms.hpp>
89
#include <hpx/modules/testing.hpp>
9-
#include <hpx/parallel/util/ranges_facilities.hpp>
1010

1111
#include <cstdint>
1212
#include <vector>

libs/core/algorithms/tests/unit/algorithms/detail/chunk_size_idx_iterator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
1010

1111
#include <hpx/iterator_support/tests/iterator_tests.hpp>
12+
#include <hpx/modules/algorithms.hpp>
1213
#include <hpx/modules/datastructures.hpp>
1314
#include <hpx/modules/testing.hpp>
14-
#include <hpx/parallel/util/detail/chunk_size_iterator.hpp>
1515

1616
#include <algorithm>
1717
#include <cstddef>

libs/core/algorithms/tests/unit/algorithms/detail/chunk_size_iterator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
1010

1111
#include <hpx/iterator_support/tests/iterator_tests.hpp>
12+
#include <hpx/modules/algorithms.hpp>
1213
#include <hpx/modules/datastructures.hpp>
1314
#include <hpx/modules/testing.hpp>
14-
#include <hpx/parallel/util/detail/chunk_size_iterator.hpp>
1515

1616
#include <algorithm>
1717
#include <cstddef>

libs/core/algorithms/tests/unit/algorithms/uninitialized_relocate.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <hpx/modules/algorithms.hpp>
99
#include <hpx/modules/executors.hpp>
1010
#include <hpx/modules/testing.hpp>
11+
#include <hpx/modules/type_support.hpp>
1112

1213
#include <atomic>
1314
#include <random>

libs/core/algorithms/tests/unit/algorithms/uninitialized_relocate_backward.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <hpx/modules/algorithms.hpp>
99
#include <hpx/modules/executors.hpp>
1010
#include <hpx/modules/testing.hpp>
11+
#include <hpx/modules/type_support.hpp>
1112

1213
#include <atomic>
1314
#include <random>

0 commit comments

Comments
 (0)