diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a4c688d262b..5302fc864f16 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1407,6 +1407,9 @@ if((HPX_WITH_NETWORKING AND HPX_WITH_PARCELPORT_MPI) # hpx_add_compile_flag() below does not add the extra options to the top # level directory hpx_add_config_define(OMPI_IMPORTS) + if(HPX_WITH_CUDA) + hpx_add_config_cond_define(NOMINMAX) + endif() endif() endif() diff --git a/cmake/HPX_AddModule.cmake b/cmake/HPX_AddModule.cmake index b0328bc1adae..681943263c75 100644 --- a/cmake/HPX_AddModule.cmake +++ b/cmake/HPX_AddModule.cmake @@ -351,8 +351,9 @@ function(add_hpx_module libname modulename) ) set(generated_headers ${generated_headers} ${cache_line_size_file}) - # Generate an empty placeholder file for hpx/config/std_headers.hpp This - # will be overwritten in libs/CMakeLists.txt with some real content. + # Generate empty placeholder files for hpx/config/std_headers.hpp and + # hpx/config/modules_enabled.hpp. Those will be overwritten in + # libs/CMakeLists.txt with some real content. if(HPX_WITH_CXX_MODULES) set(std_header_file "${CMAKE_CURRENT_BINARY_DIR}/include/hpx/config/std_headers.hpp" @@ -361,6 +362,11 @@ function(add_hpx_module libname modulename) set(generated_headers ${generated_headers} ${std_header_file}) endif() + set(modules_enabled_file + "${CMAKE_CURRENT_BINARY_DIR}/include/hpx/config/modules_enabled.hpp" + ) + file(WRITE ${modules_enabled_file} "") + set(generated_headers ${generated_headers} ${modules_enabled_file}) endif() # collect zombie generated headers diff --git a/cmake/templates/std_headers.hpp.in b/cmake/templates/std_headers.hpp.in index 3bb6723527c3..0afb9783df47 100644 --- a/cmake/templates/std_headers.hpp.in +++ b/cmake/templates/std_headers.hpp.in @@ -14,9 +14,6 @@ #include @cxx_standard_headers@ -// Some standard headers include the following headers. -#include - #if defined(HPX_HAVE_STDEXEC) # if defined(HPX_GCC_VERSION) # pragma GCC diagnostic push @@ -95,8 +92,33 @@ // Include LCI headers if required #if (defined(HPX_HAVE_NETWORKING) && defined(HPX_HAVE_PARCELPORT_LCI)) || \ defined(HPX_HAVE_MODULE_LCI_BASE) - # include "lci.hpp" # include "lct.h" +#endif +#if defined(HPX_HAVE_MODULE_THRUST) +# include +#endif + +#if defined(HPX_HAVE_MM_PREFETCH) +# if defined(HPX_MSVC) +# include +# endif +# if defined(HPX_GCC_VERSION) +# include +# endif +#endif + +#if defined(HPX_HAVE_DATAPAR) +# if defined(HPX_HAVE_DATAPAR_EVE) +# include +# include +# endif +# if defined(HPX_HAVE_DATAPAR_STD_EXPERIMENTAL_SIMD) +# include +# endif +# if defined(HPX_HAVE_DATAPAR_VC) +# include +# include +# endif #endif diff --git a/components/component_storage/include/hpx/components/component_storage/component_storage.hpp b/components/component_storage/include/hpx/components/component_storage/component_storage.hpp index 94ad5982ec2f..7eda0a7a98d7 100644 --- a/components/component_storage/include/hpx/components/component_storage/component_storage.hpp +++ b/components/component_storage/include/hpx/components/component_storage/component_storage.hpp @@ -8,8 +8,8 @@ #include #include -#include #include +#include #include #include diff --git a/components/containers/partitioned_vector/include/hpx/components/containers/partitioned_vector/partitioned_vector_segmented_iterator.hpp b/components/containers/partitioned_vector/include/hpx/components/containers/partitioned_vector/partitioned_vector_segmented_iterator.hpp index e87ddcb15287..f31bcb7eeaa1 100644 --- a/components/containers/partitioned_vector/include/hpx/components/containers/partitioned_vector/partitioned_vector_segmented_iterator.hpp +++ b/components/containers/partitioned_vector/include/hpx/components/containers/partitioned_vector/partitioned_vector_segmented_iterator.hpp @@ -14,9 +14,8 @@ // http://lafstern.org/matt/segmented.pdf. #include -#include -#include #include +#include #include #include #include diff --git a/components/containers/partitioned_vector/tests/unit/partitioned_vector_view.cpp b/components/containers/partitioned_vector/tests/unit/partitioned_vector_view.cpp index 6e53033a032b..e7effe56314a 100644 --- a/components/containers/partitioned_vector/tests/unit/partitioned_vector_view.cpp +++ b/components/containers/partitioned_vector/tests/unit/partitioned_vector_view.cpp @@ -9,10 +9,10 @@ #include #include #include -#include #include #include #include +#include #include #include diff --git a/docs/sphinx/manual/creating_hpx_projects.rst b/docs/sphinx/manual/creating_hpx_projects.rst index 766967921c0d..691a3f0b4aa0 100644 --- a/docs/sphinx/manual/creating_hpx_projects.rst +++ b/docs/sphinx/manual/creating_hpx_projects.rst @@ -265,7 +265,12 @@ implicitly using ``main()`` as the entry point. If you want the same wrapping behavior without including :hpx-header:`wrap/include,hpx/hpx_main.hpp`, link to the ``HPX::auto_wrap_main`` target instead. This enables the runtime initialization around ``main()`` unconditionally and is useful for codebases -where adding the header to ``main.cpp`` is impractical. +where adding the header to ``main.cpp`` is impractical + +.. note:: + + The use of ``HPX::auto_wrap_main`` is not supported when using the + native Windows MSVC toolchain. If you want to use the facilities exposed by ``hpx::runtime_manager`` in binaries that were not linked as executables (e.g., in shared libraries), you will need diff --git a/docs/sphinx/manual/executors.rst b/docs/sphinx/manual/executors.rst index 9af95bd7904b..9832677f7f0a 100644 --- a/docs/sphinx/manual/executors.rst +++ b/docs/sphinx/manual/executors.rst @@ -53,7 +53,7 @@ Parallel Executor .. code-block:: c++ #include - #include + #include #include std::vector data(100, 1); @@ -77,7 +77,7 @@ Fork-Join Executor .. code-block:: c++ #include - #include + #include #include std::vector data(100, 1); @@ -103,7 +103,7 @@ Sequential Executor .. code-block:: c++ #include - #include + #include #include std::vector data(100, 1); diff --git a/docs/sphinx/manual/starting_the_hpx_runtime.rst b/docs/sphinx/manual/starting_the_hpx_runtime.rst index 27afb8ceabef..39869d02e925 100644 --- a/docs/sphinx/manual/starting_the_hpx_runtime.rst +++ b/docs/sphinx/manual/starting_the_hpx_runtime.rst @@ -59,6 +59,10 @@ you cannot or do not want to include ``hpx/hpx_main.hpp`` in ``main.cpp``, you can instead link against ``HPX::auto_wrap_main``. That target enables the same runtime startup path without needing the header-triggered opt-in. +.. note:: + + The use of ``HPX::auto_wrap_main`` is not supported when using the + native Windows MSVC toolchain. .. note:: diff --git a/examples/quickstart/sort_by_key_demo.cpp b/examples/quickstart/sort_by_key_demo.cpp index ac8c747be7cb..87b4b3cd5f98 100644 --- a/examples/quickstart/sort_by_key_demo.cpp +++ b/examples/quickstart/sort_by_key_demo.cpp @@ -4,9 +4,9 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#include #include #include -#include #include #include diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt index 9704fdc5ea16..0dff34c40d8c 100644 --- a/libs/CMakeLists.txt +++ b/libs/CMakeLists.txt @@ -184,21 +184,30 @@ add_library(hpx_interface_wrap_main INTERFACE) target_link_libraries( hpx_interface_wrap_main INTERFACE $<${_is_executable}:HPXInternal::hpx_wrap> ) -add_library(hpx_interface_auto_wrap_main INTERFACE) -target_link_libraries( - hpx_interface_auto_wrap_main - INTERFACE $<${_is_executable}:HPXInternal::hpx_auto_wrap> -) target_link_libraries(wrap_main INTERFACE hpx_interface_wrap_main) -target_link_libraries(auto_wrap_main INTERFACE hpx_interface_auto_wrap_main) target_link_libraries(init INTERFACE HPXInternal::hpx_init) target_link_libraries(hpx INTERFACE hpx_interface) -# HPX::component is to be linked privately to all HPX components NOTE: The -# _is_library guard only prevents simple mistakes of linking HPX::component to -# executables. It does not prevent linking it to libraries that are not -# components. +set(hpx_targets hpx wrap_main init plugin component) +set(hpx_internal_targets hpx_full hpx_interface hpx_interface_wrap_main) + +if(NOT MSVC) + add_library(hpx_interface_auto_wrap_main INTERFACE) + target_link_libraries( + hpx_interface_auto_wrap_main + INTERFACE $<${_is_executable}:HPXInternal::hpx_auto_wrap> + ) + target_link_libraries(auto_wrap_main INTERFACE hpx_interface_auto_wrap_main) + set(hpx_targets ${hpx_targets} auto_wrap_main) + set(hpx_internal_targets ${hpx_internal_targets} hpx_interface_auto_wrap_main) +endif() + +# HPX::component is to be linked privately to all HPX components +# +# NOTE: The _is_library guard only prevents simple mistakes of linking +# HPX::component to executables. It does not prevent linking it to libraries +# that are not components. add_library(component INTERFACE) target_compile_definitions( component @@ -219,11 +228,6 @@ target_compile_definitions( "$<${_is_library}:HPX_PLUGIN_NAME_DEFAULT=hpx_$>" ) -set(hpx_targets hpx wrap_main auto_wrap_main init plugin component) -set(hpx_internal_targets hpx_full hpx_interface hpx_interface_wrap_main - hpx_interface_auto_wrap_main -) - # cmake-format: off install( TARGETS ${hpx_targets} diff --git a/libs/core/algorithms/CMakeLists.txt b/libs/core/algorithms/CMakeLists.txt index cb67cda92e4c..10654330e54c 100644 --- a/libs/core/algorithms/CMakeLists.txt +++ b/libs/core/algorithms/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2019-2023 The STE||AR-Group +# Copyright (c) 2019-2025 The STE||AR-Group # # SPDX-License-Identifier: BSL-1.0 # Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -172,22 +172,6 @@ set(algorithms_headers hpx/parallel/container_algorithms/unique.hpp hpx/parallel/container_memory.hpp hpx/parallel/container_numeric.hpp - hpx/parallel/datapar.hpp - hpx/parallel/datapar/adjacent_difference.hpp - hpx/parallel/datapar/adjacent_find.hpp - hpx/parallel/datapar/equal.hpp - hpx/parallel/datapar/fill.hpp - hpx/parallel/datapar/find.hpp - hpx/parallel/datapar/generate.hpp - hpx/parallel/datapar/handle_local_exceptions.hpp - hpx/parallel/datapar/iterator_helpers.hpp - hpx/parallel/datapar/loop.hpp - hpx/parallel/datapar/mismatch.hpp - hpx/parallel/datapar/reduce.hpp - hpx/parallel/datapar/replace.hpp - hpx/parallel/datapar/transfer.hpp - hpx/parallel/datapar/transform_loop.hpp - hpx/parallel/datapar/zip_iterator.hpp hpx/parallel/memory.hpp hpx/parallel/numeric.hpp hpx/parallel/run_on_all.hpp @@ -236,6 +220,28 @@ set(algorithms_headers hpx/parallel/util/zip_iterator.hpp ) +if(HPX_WITH_DATAPAR) + set(algorithms_headers + ${algorithms_headers} + hpx/parallel/datapar.hpp + hpx/parallel/datapar/adjacent_difference.hpp + hpx/parallel/datapar/adjacent_find.hpp + hpx/parallel/datapar/equal.hpp + hpx/parallel/datapar/fill.hpp + hpx/parallel/datapar/find.hpp + hpx/parallel/datapar/generate.hpp + hpx/parallel/datapar/handle_local_exceptions.hpp + hpx/parallel/datapar/iterator_helpers.hpp + hpx/parallel/datapar/loop.hpp + hpx/parallel/datapar/mismatch.hpp + hpx/parallel/datapar/reduce.hpp + hpx/parallel/datapar/replace.hpp + hpx/parallel/datapar/transfer.hpp + hpx/parallel/datapar/transform_loop.hpp + hpx/parallel/datapar/zip_iterator.hpp + ) +endif() + # cmake-format: off set(algorithms_compat_headers hpx/algorithms.hpp => hpx/algorithm.hpp @@ -252,8 +258,11 @@ set(algorithms_sources handle_exception_termination_handler.cpp task_group.cpp) include(HPX_AddModule) add_hpx_module( core algorithms + GLOBAL_HEADER_GEN ON + GLOBAL_HEADER_MODULE_GEN ON HEADERS ${algorithms_headers} COMPAT_HEADERS ${algorithms_compat_headers} + ADD_TO_GLOBAL_HEADER "hpx/parallel/util/detail/handle_remote_exceptions.hpp" SOURCES ${algorithms_sources} MODULE_DEPENDENCIES hpx_async_combinators diff --git a/libs/core/algorithms/include/hpx/algorithms/traits/is_pair.hpp b/libs/core/algorithms/include/hpx/algorithms/traits/is_pair.hpp index 021f41039486..0f1b434f1a1f 100644 --- a/libs/core/algorithms/include/hpx/algorithms/traits/is_pair.hpp +++ b/libs/core/algorithms/include/hpx/algorithms/traits/is_pair.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Hartmut Kaiser +// Copyright (c) 2023-2025 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -6,13 +6,15 @@ #pragma once +#include + #include namespace hpx::traits { - template + HPX_CXX_EXPORT template inline constexpr bool is_pair_v = false; - template + HPX_CXX_EXPORT template inline constexpr bool is_pair_v> = true; } // namespace hpx::traits diff --git a/libs/core/algorithms/include/hpx/algorithms/traits/is_value_proxy.hpp b/libs/core/algorithms/include/hpx/algorithms/traits/is_value_proxy.hpp index d8a3543138e4..78d247d13dd9 100644 --- a/libs/core/algorithms/include/hpx/algorithms/traits/is_value_proxy.hpp +++ b/libs/core/algorithms/include/hpx/algorithms/traits/is_value_proxy.hpp @@ -8,24 +8,26 @@ #pragma once +#include + #include namespace hpx::traits { - template + HPX_CXX_EXPORT template struct is_value_proxy : std::false_type { }; - template + HPX_CXX_EXPORT template inline constexpr bool is_value_proxy_v = is_value_proxy::value; - template + HPX_CXX_EXPORT template struct proxy_value { using type = T; }; - template + HPX_CXX_EXPORT template using proxy_value_t = typename proxy_value::type; } // namespace hpx::traits diff --git a/libs/core/algorithms/include/hpx/algorithms/traits/pointer_category.hpp b/libs/core/algorithms/include/hpx/algorithms/traits/pointer_category.hpp index 8783773a23bf..74b3a9c384a6 100644 --- a/libs/core/algorithms/include/hpx/algorithms/traits/pointer_category.hpp +++ b/libs/core/algorithms/include/hpx/algorithms/traits/pointer_category.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2023 Hartmut Kaiser +// Copyright (c) 2016-2025 Hartmut Kaiser // Copyright (c) 2016 John Biddiscombe // // SPDX-License-Identifier: BSL-1.0 @@ -7,6 +7,7 @@ #pragma once +#include #include #include @@ -17,37 +18,37 @@ namespace hpx::traits { - struct general_pointer_tag + HPX_CXX_EXPORT struct general_pointer_tag { }; - struct trivially_copyable_pointer_tag : general_pointer_tag + HPX_CXX_EXPORT struct trivially_copyable_pointer_tag : general_pointer_tag { }; - struct relocatable_pointer_tag : general_pointer_tag + HPX_CXX_EXPORT struct relocatable_pointer_tag : general_pointer_tag { }; namespace detail { /////////////////////////////////////////////////////////////////////// - template > + HPX_CXX_EXPORT template > struct unwrap_enum { using type = std::underlying_type_t; }; - template + HPX_CXX_EXPORT template struct unwrap_enum { using type = T; }; - template + HPX_CXX_EXPORT template using unwrap_enum_t = typename unwrap_enum::type; - template + HPX_CXX_EXPORT template struct pointer_category_helper { using source = unwrap_enum_t; @@ -66,7 +67,7 @@ namespace hpx::traits { }; // every type is layout-compatible with itself - template + HPX_CXX_EXPORT template struct pointer_category_helper { using type = std::conditional_t, @@ -74,36 +75,34 @@ namespace hpx::traits { }; // pointers are layout compatible - template + HPX_CXX_EXPORT template struct pointer_category_helper { using type = trivially_copyable_pointer_tag; }; - template + HPX_CXX_EXPORT template struct pointer_category_helper { using type = trivially_copyable_pointer_tag; }; - template + HPX_CXX_EXPORT template struct pointer_category_helper { using type = trivially_copyable_pointer_tag; }; - template + HPX_CXX_EXPORT template using pointer_category_helper_t = typename pointer_category_helper::type; /////////////////////////////////////////////////////////////////////// - // clang-format off - template + HPX_CXX_EXPORT template inline constexpr bool iterators_are_contiguous_v = is_contiguous_iterator_v && is_contiguous_iterator_v; - // clang-format on - template > struct pointer_move_category { @@ -115,13 +114,13 @@ namespace hpx::traits { general_pointer_tag>; }; - template + HPX_CXX_EXPORT template struct pointer_move_category { using type = general_pointer_tag; }; - template > struct pointer_copy_category { @@ -133,13 +132,13 @@ namespace hpx::traits { general_pointer_tag>; }; - template + HPX_CXX_EXPORT template struct pointer_copy_category { using type = general_pointer_tag; }; - template > struct pointer_relocate_category { @@ -149,7 +148,7 @@ namespace hpx::traits { relocatable_pointer_tag, general_pointer_tag>; }; - template + HPX_CXX_EXPORT template struct pointer_relocate_category { using type = general_pointer_tag; @@ -158,43 +157,46 @@ namespace hpx::traits { // isolate iterators that refer to contiguous trivially copyable sequences or // which are pointers and their value_types are assignable - template + HPX_CXX_EXPORT template struct pointer_copy_category : detail::pointer_copy_category { }; - template + HPX_CXX_EXPORT template using pointer_copy_category_t = typename pointer_copy_category::type; - template + HPX_CXX_EXPORT template struct pointer_move_category : detail::pointer_move_category { }; - template + HPX_CXX_EXPORT template using pointer_move_category_t = typename pointer_move_category::type; - template + HPX_CXX_EXPORT template struct pointer_relocate_category : detail::pointer_relocate_category { }; - template + HPX_CXX_EXPORT template using pointer_relocate_category_t = typename pointer_relocate_category::type; // Allow for matching of iterator to iterator while calculating // pointer category. - template + HPX_CXX_EXPORT template struct remove_const_iterator_value_type { using type = Iterator; }; - template + HPX_CXX_EXPORT template using remove_const_iterator_value_type_t = typename remove_const_iterator_value_type::type; } // namespace hpx::traits diff --git a/libs/core/algorithms/include/hpx/algorithms/traits/projected.hpp b/libs/core/algorithms/include/hpx/algorithms/traits/projected.hpp index ace187d3b495..8223e0b823ef 100644 --- a/libs/core/algorithms/include/hpx/algorithms/traits/projected.hpp +++ b/libs/core/algorithms/include/hpx/algorithms/traits/projected.hpp @@ -20,7 +20,7 @@ namespace hpx::traits { /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct projected_iterator { using type = std::decay_t; @@ -28,7 +28,7 @@ namespace hpx::traits { // For segmented iterators, we consider the local_raw_iterator instead of // the given one. - template + HPX_CXX_EXPORT template struct projected_iterator>> { @@ -39,14 +39,14 @@ namespace hpx::traits { local_iterator>::local_raw_iterator; }; - template + HPX_CXX_EXPORT template struct projected_iterator::proxy_type>> { using type = typename std::decay_t::proxy_type; }; - template + HPX_CXX_EXPORT template using projected_iterator_t = typename projected_iterator::type; } // namespace hpx::traits @@ -55,17 +55,18 @@ namespace hpx::parallel::traits { /////////////////////////////////////////////////////////////////////////// namespace detail { - template + HPX_CXX_EXPORT template struct projected_result_of; - template + HPX_CXX_EXPORT template struct projected_result_of>> : hpx::util::invoke_result> { }; - template + HPX_CXX_EXPORT template struct projected_result_of_indirect : projected_result_of @@ -76,7 +77,8 @@ namespace hpx::parallel::traits { // This is being instantiated if a vector pack execution policy is used // with a zip_iterator. In this case the function object is invoked // with a tuple...> instead of just a tuple - template + HPX_CXX_EXPORT template struct projected_result_of_vector_pack_ : hpx::util::invoke_result + HPX_CXX_EXPORT template struct projected_result_of_vector_pack; - template + HPX_CXX_EXPORT template struct projected_result_of_vector_pack> : projected_result_of_vector_pack_ + HPX_CXX_EXPORT template struct projected_result_of : detail::projected_result_of, std::decay_t> { @@ -108,7 +110,8 @@ namespace hpx::parallel::traits { /////////////////////////////////////////////////////////////////////////// namespace detail { - template + HPX_CXX_EXPORT template struct is_projected : std::false_type { }; @@ -118,7 +121,7 @@ namespace hpx::parallel::traits { // void // clang-format off - template + HPX_CXX_EXPORT template struct is_projected && @@ -131,12 +134,12 @@ namespace hpx::parallel::traits { }; // clang-format on - template + HPX_CXX_EXPORT template struct is_projected_indirect : std::false_type { }; - template + HPX_CXX_EXPORT template struct is_projected_indirect> : detail::is_projected + HPX_CXX_EXPORT template struct is_projected : detail::is_projected, hpx::traits::projected_iterator_t> { }; - template + HPX_CXX_EXPORT template inline constexpr bool is_projected_v = is_projected::value; /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct projected { using projector_type = std::decay_t; using iterator_type = hpx::traits::projected_iterator_t; }; - template + HPX_CXX_EXPORT template struct is_projected_indirect : detail::is_projected_indirect { }; - template + HPX_CXX_EXPORT template struct is_projected_zip_iterator : std::false_type { }; - template + HPX_CXX_EXPORT template struct is_projected_zip_iterator> : hpx::traits::is_zip_iterator @@ -183,18 +186,19 @@ namespace hpx::parallel::traits { /////////////////////////////////////////////////////////////////////////// namespace detail { - template + HPX_CXX_EXPORT template struct is_indirect_callable_impl : hpx::is_invocable { }; - template + HPX_CXX_EXPORT template struct is_indirect_callable : std::false_type { }; - template + HPX_CXX_EXPORT template struct is_indirect_callable, std::enable_if_t< hpx::util::all_of_v...> && @@ -210,7 +214,8 @@ namespace hpx::parallel::traits { // Vector pack execution policies used with zip-iterators require // special handling because zip_iterator<>::reference is not a real // reference type. - template + HPX_CXX_EXPORT template struct is_indirect_callable, std::enable_if_t< hpx::util::all_of_v...> && @@ -223,14 +228,16 @@ namespace hpx::parallel::traits { #endif } // namespace detail - template + HPX_CXX_EXPORT template struct is_indirect_callable : detail::is_indirect_callable, std::decay_t, hpx::util::pack...>> { }; - template + HPX_CXX_EXPORT template inline constexpr bool is_indirect_callable_v = is_indirect_callable::value; } // namespace hpx::parallel::traits diff --git a/libs/core/algorithms/include/hpx/algorithms/traits/projected_range.hpp b/libs/core/algorithms/include/hpx/algorithms/traits/projected_range.hpp index 8f80cff0c792..f1602d6409bd 100644 --- a/libs/core/algorithms/include/hpx/algorithms/traits/projected_range.hpp +++ b/libs/core/algorithms/include/hpx/algorithms/traits/projected_range.hpp @@ -6,6 +6,7 @@ #pragma once +#include #include #include @@ -14,12 +15,12 @@ namespace hpx::parallel::traits { /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct projected_range_result_of { }; - template + HPX_CXX_EXPORT template struct projected_range_result_of>> : detail::projected_result_of, @@ -28,12 +29,13 @@ namespace hpx::parallel::traits { }; /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct is_projected_range : std::false_type { }; - template + HPX_CXX_EXPORT template struct is_projected_range>> : detail::is_projected, @@ -41,17 +43,18 @@ namespace hpx::parallel::traits { { }; - template + HPX_CXX_EXPORT template inline constexpr bool is_projected_range_v = is_projected_range::value; /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct projected_range { }; - template + HPX_CXX_EXPORT template struct projected_range>> { diff --git a/libs/core/algorithms/include/hpx/algorithms/traits/segmented_iterator_traits.hpp b/libs/core/algorithms/include/hpx/algorithms/traits/segmented_iterator_traits.hpp index 39fac4868219..bbc1b6b28e5b 100644 --- a/libs/core/algorithms/include/hpx/algorithms/traits/segmented_iterator_traits.hpp +++ b/libs/core/algorithms/include/hpx/algorithms/traits/segmented_iterator_traits.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 Hartmut Kaiser +// Copyright (c) 2007-2025 Hartmut Kaiser // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -6,6 +6,7 @@ #pragma once +#include #include #include @@ -14,13 +15,13 @@ namespace hpx::traits { /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct segmented_iterator_traits { using is_segmented_iterator = std::false_type; }; - template + HPX_CXX_EXPORT template struct is_segmented_iterator : segmented_iterator_traits::is_segmented_iterator { @@ -29,7 +30,7 @@ namespace hpx::traits { /////////////////////////////////////////////////////////////////////////// // traits allowing to distinguish iterators which have a purely local // representation - template + HPX_CXX_EXPORT template struct segmented_local_iterator_traits { using is_segmented_local_iterator = std::false_type; @@ -69,7 +70,7 @@ namespace hpx::traits { }; /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct is_segmented_local_iterator : segmented_local_iterator_traits::is_segmented_local_iterator { diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/adjacent_difference.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/adjacent_difference.hpp index 85cd1343e576..54dd93da2552 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/adjacent_difference.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/adjacent_difference.hpp @@ -246,8 +246,9 @@ namespace hpx::parallel { /////////////////////////////////////////////////////////////////////////// // adjacent_difference namespace detail { + /// \cond NOINTERNAL - template + HPX_CXX_EXPORT template struct adjacent_difference : public algorithm, Iter> { @@ -340,7 +341,6 @@ namespace hpx::parallel { HPX_MOVE(f1), HPX_MOVE(f2)); } }; - /// \endcond } // namespace detail } // namespace hpx::parallel @@ -349,7 +349,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::adjacent_difference - inline constexpr struct adjacent_difference_t final + HPX_CXX_EXPORT inline constexpr struct adjacent_difference_t final : hpx::detail::tag_parallel_algorithm { private: diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/adjacent_find.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/adjacent_find.hpp index 25dcf37e8491..82823f37785c 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/adjacent_find.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/adjacent_find.hpp @@ -153,7 +153,7 @@ namespace hpx::parallel { namespace detail { /// \cond NOINTERNAL - template + HPX_CXX_EXPORT template struct adjacent_find : public algorithm, Iter> { constexpr adjacent_find() noexcept @@ -258,7 +258,7 @@ namespace hpx::parallel { namespace hpx { - inline constexpr struct adjacent_find_t final + HPX_CXX_EXPORT inline constexpr struct adjacent_find_t final : hpx::detail::tag_parallel_algorithm { private: diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/all_any_none.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/all_any_none.hpp index 90559820ef28..5f6e5591e331 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/all_any_none.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/all_any_none.hpp @@ -353,7 +353,7 @@ namespace hpx::parallel { namespace detail { /// \cond NOINTERNAL - struct none_of : public algorithm + HPX_CXX_EXPORT struct none_of : public algorithm { constexpr none_of() noexcept : algorithm("none_of") @@ -428,7 +428,7 @@ namespace hpx::parallel { namespace detail { /// \cond NOINTERNAL - struct any_of : public algorithm + HPX_CXX_EXPORT struct any_of : public algorithm { constexpr any_of() noexcept : algorithm("any_of") @@ -503,7 +503,7 @@ namespace hpx::parallel { namespace detail { /// \cond NOINTERNAL - struct all_of : public algorithm + HPX_CXX_EXPORT struct all_of : public algorithm { constexpr all_of() noexcept : algorithm("all_of") @@ -577,7 +577,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::none_of - inline constexpr struct none_of_t final + HPX_CXX_EXPORT inline constexpr struct none_of_t final : hpx::detail::tag_parallel_algorithm { private: @@ -618,7 +618,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::any_of - inline constexpr struct any_of_t final + HPX_CXX_EXPORT inline constexpr struct any_of_t final : hpx::detail::tag_parallel_algorithm { private: @@ -659,7 +659,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::all_of - inline constexpr struct all_of_t final + HPX_CXX_EXPORT inline constexpr struct all_of_t final : hpx::detail::tag_parallel_algorithm { private: @@ -697,7 +697,6 @@ namespace hpx { hpx::execution::seq, first, last, HPX_MOVE(f), hpx::identity_v); } } all_of{}; - } // namespace hpx #endif // DOXYGEN diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/copy.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/copy.hpp index e2148863588d..764e2084f8c2 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/copy.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/copy.hpp @@ -349,7 +349,7 @@ namespace hpx::parallel { // copy namespace detail { - template + HPX_CXX_EXPORT template struct copy_iteration { using execution_policy_type = std::decay_t; @@ -365,7 +365,7 @@ namespace hpx::parallel { } }; - template + HPX_CXX_EXPORT template struct copy : public algorithm, IterPair> { constexpr copy() noexcept @@ -439,10 +439,11 @@ namespace hpx::parallel { }; #else /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct copy_iter; - template + HPX_CXX_EXPORT template struct copy_iter::value>> @@ -454,7 +455,7 @@ namespace hpx::parallel { { }; - template + HPX_CXX_EXPORT template struct copy_iter::value>> @@ -469,7 +470,7 @@ namespace hpx::parallel { namespace detail { // sequential copy_n - template + HPX_CXX_EXPORT template struct copy_n : public algorithm, IterPair> { constexpr copy_n() noexcept @@ -519,8 +520,8 @@ namespace hpx::parallel { namespace detail { // sequential copy_if with projection function - template + HPX_CXX_EXPORT template constexpr util::in_out_result sequential_copy_if( InIter1 first, InIter2 last, OutIter dest, Pred&& pred, Proj&& proj) { @@ -534,7 +535,7 @@ namespace hpx::parallel { HPX_MOVE(first), HPX_MOVE(dest)}; } - template + HPX_CXX_EXPORT template struct copy_if : public algorithm, IterPair> { constexpr copy_if() noexcept @@ -657,7 +658,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::copy - inline constexpr struct copy_t final + HPX_CXX_EXPORT inline constexpr struct copy_t final : hpx::detail::tag_parallel_algorithm { private: @@ -697,7 +698,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::copy_n - inline constexpr struct copy_n_t final + HPX_CXX_EXPORT inline constexpr struct copy_n_t final : hpx::detail::tag_parallel_algorithm { private: @@ -777,7 +778,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::copy_if - inline constexpr struct copy_if_t final + HPX_CXX_EXPORT inline constexpr struct copy_if_t final : hpx::detail::tag_parallel_algorithm { private: diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/count.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/count.hpp index 032a41f4aebe..4d8aedf65818 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/count.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/count.hpp @@ -231,7 +231,7 @@ namespace hpx::parallel { namespace detail { /// \cond NOINTERNAL - template + HPX_CXX_EXPORT template struct count_iteration { using execution_policy_type = std::decay_t; @@ -291,7 +291,7 @@ namespace hpx::parallel { }; /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct count : public algorithm, Value> { typedef Value difference_type; @@ -358,7 +358,7 @@ namespace hpx::parallel { namespace detail { /// \cond NOINTERNAL - template + HPX_CXX_EXPORT template struct count_if : public algorithm, Value> { using difference_type = Value; @@ -423,7 +423,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::count - inline constexpr struct count_t final + HPX_CXX_EXPORT inline constexpr struct count_t final : hpx::detail::tag_parallel_algorithm { private: @@ -472,7 +472,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::count_if - inline constexpr struct count_if_t final + HPX_CXX_EXPORT inline constexpr struct count_if_t final : hpx::detail::tag_parallel_algorithm { private: diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/destroy.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/destroy.hpp index 77b197fb3e8d..db5bbd6da94d 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/destroy.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/destroy.hpp @@ -178,7 +178,7 @@ namespace hpx::parallel { // provide our own implementation of std::destroy as some versions of // MSVC horribly fail at compiling it for some types T - template + HPX_CXX_EXPORT template Iter sequential_destroy(Iter first, Sent last) { for (/* */; first != last; ++first) @@ -189,7 +189,7 @@ namespace hpx::parallel { } /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template decltype(auto) parallel_sequential_destroy_n( ExPolicy&& policy, Iter first, std::size_t count) { @@ -217,7 +217,7 @@ namespace hpx::parallel { } /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct destroy : public algorithm, FwdIter> { constexpr destroy() noexcept @@ -250,7 +250,7 @@ namespace hpx::parallel { // provide our own implementation of std::destroy as some versions of // MSVC horribly fail at compiling it for some types T - template + HPX_CXX_EXPORT template Iter sequential_destroy_n(Iter first, std::size_t count) { for (/* */; count != 0; (void) ++first, --count) @@ -260,7 +260,7 @@ namespace hpx::parallel { return first; } - template + HPX_CXX_EXPORT template struct destroy_n : public algorithm, FwdIter> { constexpr destroy_n() noexcept @@ -290,7 +290,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::destroy - inline constexpr struct destroy_t final + HPX_CXX_EXPORT inline constexpr struct destroy_t final : hpx::detail::tag_parallel_algorithm { private: @@ -330,7 +330,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::destroy_n - inline constexpr struct destroy_n_t final + HPX_CXX_EXPORT inline constexpr struct destroy_n_t final : hpx::detail::tag_parallel_algorithm { private: diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/accumulate.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/accumulate.hpp index 4ad533e3d100..4d64967a72eb 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/accumulate.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/accumulate.hpp @@ -14,7 +14,8 @@ namespace hpx::parallel::detail { // provide implementation of std::accumulate supporting iterators/sentinels - template + HPX_CXX_EXPORT template constexpr T accumulate(Iter first, Sent last, T value, F&& reduce_op) { for (/**/; first != last; ++first) @@ -24,7 +25,7 @@ namespace hpx::parallel::detail { return value; } - template + HPX_CXX_EXPORT template constexpr T accumulate(Iter first, Sent last, T value) { return accumulate(first, last, HPX_MOVE(value), std::plus()); diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/adjacent_difference.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/adjacent_difference.hpp index 245d07c6b267..0cc4005c07b6 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/adjacent_difference.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/adjacent_difference.hpp @@ -17,7 +17,7 @@ namespace hpx::parallel::detail { - template + HPX_CXX_EXPORT template struct sequential_adjacent_difference_t : hpx::functional::detail::tag_fallback< sequential_adjacent_difference_t> @@ -45,12 +45,12 @@ namespace hpx::parallel::detail { }; #if !defined(HPX_COMPUTE_DEVICE_CODE) - template + HPX_CXX_EXPORT template inline constexpr sequential_adjacent_difference_t sequential_adjacent_difference = sequential_adjacent_difference_t{}; #else - template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr OutIter sequential_adjacent_difference( diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/adjacent_find.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/adjacent_find.hpp index b59b589eb1ce..e5f0a0914176 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/adjacent_find.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/adjacent_find.hpp @@ -16,7 +16,7 @@ namespace hpx::parallel::detail { - template + HPX_CXX_EXPORT template struct sequential_adjacent_find_t final : hpx::functional::detail::tag_fallback< sequential_adjacent_find_t> @@ -47,11 +47,11 @@ namespace hpx::parallel::detail { }; #if !defined(HPX_COMPUTE_DEVICE_CODE) - template + HPX_CXX_EXPORT template inline constexpr sequential_adjacent_find_t sequential_adjacent_find = sequential_adjacent_find_t{}; #else - template HPX_HOST_DEVICE HPX_FORCEINLINE InIter sequential_adjacent_find( InIter first, Sent_ last, PredProj&& pred_projected) @@ -60,8 +60,8 @@ namespace hpx::parallel::detail { first, last, HPX_FORWARD(PredProj, pred_projected)); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE void sequential_adjacent_find( std::size_t base_idx, ZipIter part_begin, std::size_t part_count, Token& tok, PredProj&& pred_projected) diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/advance_and_get_distance.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/advance_and_get_distance.hpp index 81e7b2ab3597..86b805dae254 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/advance_and_get_distance.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/advance_and_get_distance.hpp @@ -17,7 +17,7 @@ namespace hpx::parallel::detail { // helper facility to both advance the iterator to the sentinel and return the // distance - template + HPX_CXX_EXPORT template constexpr typename std::iterator_traits::difference_type advance_and_get_distance(Iter& first, Sent last) { diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/advance_to_sentinel.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/advance_to_sentinel.hpp index 695a1bd35c75..63fefd8eb2ef 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/advance_to_sentinel.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/advance_to_sentinel.hpp @@ -14,7 +14,7 @@ namespace hpx::parallel::detail { // Generic implementation for advancing a given iterator to its sentinel - template + HPX_CXX_EXPORT template constexpr Iter advance_to_sentinel(Iter first, Sent last) { if constexpr (std::is_same_v) diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/contains.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/contains.hpp index 0707bfc4c9f1..714ad6b305f5 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/contains.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/contains.hpp @@ -17,7 +17,7 @@ namespace hpx::parallel::detail { - template + HPX_CXX_EXPORT template struct sequential_contains_t final : hpx::functional::detail::tag_fallback> { @@ -57,7 +57,8 @@ namespace hpx::parallel::detail { }); } }; - template + + HPX_CXX_EXPORT template inline constexpr sequential_contains_t sequential_contains = sequential_contains_t{}; } //namespace hpx::parallel::detail diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/dispatch.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/dispatch.hpp index 76ca4827f56d..fce40c0a8d5a 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/dispatch.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/dispatch.hpp @@ -28,14 +28,14 @@ namespace hpx::parallel::detail { /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct local_algorithm_result { using type = typename hpx::traits::segmented_local_iterator_traits< Result>::local_raw_iterator; }; - template + HPX_CXX_EXPORT template struct local_algorithm_result> { using type1 = typename hpx::traits::segmented_local_iterator_traits< @@ -46,7 +46,7 @@ namespace hpx::parallel::detail { using type = util::in_out_result; }; - template + HPX_CXX_EXPORT template struct local_algorithm_result> { using type1 = typename hpx::traits::segmented_local_iterator_traits< @@ -55,7 +55,8 @@ namespace hpx::parallel::detail { using type = util::min_max_result; }; - template + HPX_CXX_EXPORT template struct local_algorithm_result< util::in_in_out_result> { @@ -75,11 +76,11 @@ namespace hpx::parallel::detail { using type = void; }; - template + HPX_CXX_EXPORT template using local_algorithm_result_t = typename local_algorithm_result::type; /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct algorithm { private: diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/distance.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/distance.hpp index 37933fb8c941..35078a32adeb 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/distance.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/distance.hpp @@ -16,7 +16,7 @@ namespace hpx::parallel::detail { // provide implementation of std::distance supporting iterators/sentinels - template + HPX_CXX_EXPORT template constexpr typename std::iterator_traits::difference_type distance( InIterB first, InIterE last) { diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/equal.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/equal.hpp index a93ddf148427..7bd0299f4ea9 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/equal.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/equal.hpp @@ -18,7 +18,7 @@ namespace hpx::parallel::detail { - template + HPX_CXX_EXPORT template struct sequential_equal_t final : hpx::functional::detail::tag_fallback> { @@ -46,11 +46,12 @@ namespace hpx::parallel::detail { }; #if !defined(HPX_COMPUTE_DEVICE_CODE) - template + HPX_CXX_EXPORT template inline constexpr sequential_equal_t sequential_equal = sequential_equal_t{}; #else - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE bool sequential_equal( InIter1 first1, InIter1 last1, InIter2 first2, F&& f) { @@ -58,8 +59,8 @@ namespace hpx::parallel::detail { first1, last1, first2, HPX_FORWARD(F, f)); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE void sequential_equal( ZipIterator it, std::size_t part_count, Token& tok, F&& f) { @@ -68,7 +69,7 @@ namespace hpx::parallel::detail { } #endif - template + HPX_CXX_EXPORT template struct sequential_equal_binary_t final : hpx::functional::detail::tag_fallback< sequential_equal_binary_t> @@ -110,13 +111,13 @@ namespace hpx::parallel::detail { }; #if !defined(HPX_COMPUTE_DEVICE_CODE) - template + HPX_CXX_EXPORT template inline constexpr sequential_equal_binary_t sequential_equal_binary = sequential_equal_binary_t{}; #else - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE bool sequential_equal_binary(InIter1 first1, Sent1 last1, InIter2 first2, Sent2 last2, F&& f, Proj1&& proj1, Proj2&& proj2) @@ -126,8 +127,8 @@ namespace hpx::parallel::detail { HPX_FORWARD(Proj2, proj2)); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE void sequential_equal_binary(ZipIterator it, std::size_t part_count, Token& tok, F&& f, Proj1&& proj1, Proj2&& proj2) { diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/fill.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/fill.hpp index 2396bbd2c6ed..030be401c530 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/fill.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/fill.hpp @@ -16,7 +16,7 @@ namespace hpx::parallel::detail { /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template constexpr Iter sequential_fill_helper(Iter first, Sent last, T const& value) { for (; first != last; ++first) @@ -26,7 +26,7 @@ namespace hpx::parallel::detail { return first; } - struct sequential_fill_t + HPX_CXX_EXPORT struct sequential_fill_t : hpx::functional::detail::tag_fallback { private: @@ -39,9 +39,11 @@ namespace hpx::parallel::detail { }; #if !defined(HPX_COMPUTE_DEVICE_CODE) - inline constexpr sequential_fill_t sequential_fill = sequential_fill_t{}; + HPX_CXX_EXPORT inline constexpr sequential_fill_t sequential_fill = + sequential_fill_t{}; #else - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE Iter sequential_fill( ExPolicy&& policy, Iter first, Sent last, T const& value) { @@ -51,14 +53,14 @@ namespace hpx::parallel::detail { #endif /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template constexpr Iter sequential_fill_n_helper( Iter first, std::size_t count, T const& value) { return std::fill_n(first, count, value); } - struct sequential_fill_n_t + HPX_CXX_EXPORT struct sequential_fill_n_t : hpx::functional::detail::tag_fallback { private: @@ -71,10 +73,10 @@ namespace hpx::parallel::detail { }; #if !defined(HPX_COMPUTE_DEVICE_CODE) - inline constexpr sequential_fill_n_t sequential_fill_n = + HPX_CXX_EXPORT inline constexpr sequential_fill_n_t sequential_fill_n = sequential_fill_n_t{}; #else - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE Iter sequential_fill_n( ExPolicy&& policy, Iter first, std::size_t count, T const& value) { diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/find.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/find.hpp index a8326aaf0c46..f4bd90f69785 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/find.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/find.hpp @@ -23,7 +23,7 @@ namespace hpx::parallel::detail { // provide implementation of std::find supporting iterators/sentinels - template + HPX_CXX_EXPORT template struct sequential_find_t final : hpx::functional::detail::tag_fallback> { @@ -57,20 +57,20 @@ namespace hpx::parallel::detail { }; #if !defined(HPX_COMPUTE_DEVICE_CODE) - template + HPX_CXX_EXPORT template inline constexpr sequential_find_t sequential_find = sequential_find_t{}; #else - template + HPX_CXX_EXPORT template constexpr Iterator sequential_find( Iterator first, Sentinel last, T const& val, Proj proj = Proj()) { return sequential_find_t{}(first, last, val, proj); } - template + HPX_CXX_EXPORT template constexpr void sequential_find(std::size_t base_idx, FwdIter part_begin, std::size_t part_count, Token& tok, T const& val, Proj&& proj) { @@ -80,7 +80,7 @@ namespace hpx::parallel::detail { #endif // provide implementation of std::find_if supporting iterators/sentinels - template + HPX_CXX_EXPORT template struct sequential_find_if_t final : hpx::functional::detail::tag_fallback> { @@ -128,20 +128,20 @@ namespace hpx::parallel::detail { }; #if !defined(HPX_COMPUTE_DEVICE_CODE) - template + HPX_CXX_EXPORT template inline constexpr sequential_find_if_t sequential_find_if = sequential_find_if_t{}; #else - template + HPX_CXX_EXPORT template inline constexpr Iterator sequential_find_if( Iterator first, Sentinel last, Pred pred, Proj proj = Proj()) { return sequential_find_if_t{}(first, last, pred, proj); } - template + HPX_CXX_EXPORT template inline constexpr void sequential_find_if(FwdIter part_begin, std::size_t part_count, Token& tok, F&& op, Proj&& proj) { @@ -149,8 +149,8 @@ namespace hpx::parallel::detail { HPX_FORWARD(F, op), HPX_FORWARD(Proj, proj)); } - template + HPX_CXX_EXPORT template inline constexpr void sequential_find_if(std::size_t base_idx, FwdIter part_begin, std::size_t part_count, Token& tok, F&& f, Proj&& proj) @@ -161,7 +161,7 @@ namespace hpx::parallel::detail { #endif // provide implementation of std::find_if_not supporting iterators/sentinels - template + HPX_CXX_EXPORT template struct sequential_find_if_not_t final : hpx::functional::detail::tag_fallback< sequential_find_if_not_t> @@ -210,20 +210,20 @@ namespace hpx::parallel::detail { }; #if !defined(HPX_COMPUTE_DEVICE_CODE) - template + HPX_CXX_EXPORT template inline constexpr sequential_find_if_not_t sequential_find_if_not = sequential_find_if_not_t{}; #else - template + HPX_CXX_EXPORT template inline constexpr Iterator sequential_find_if_not( Iterator first, Sentinel last, Pred pred, Proj proj = Proj()) { return sequential_find_if_not_t{}(first, last, pred, proj); } - template + HPX_CXX_EXPORT template inline constexpr void sequential_find_if_not(FwdIter part_begin, std::size_t part_count, Token& tok, F&& op, Proj&& proj) { @@ -231,8 +231,8 @@ namespace hpx::parallel::detail { HPX_FORWARD(F, op), HPX_FORWARD(Proj, proj)); } - template + HPX_CXX_EXPORT template inline constexpr void sequential_find_if_not(std::size_t base_idx, FwdIter part_begin, std::size_t part_count, Token& tok, F&& f, Proj&& proj) @@ -243,8 +243,8 @@ namespace hpx::parallel::detail { #endif // provide implementation of std::find_end supporting iterators/sentinels - template + HPX_CXX_EXPORT template constexpr Iter1 sequential_search(Iter1 first1, Sent1 last1, Iter2 first2, Sent2 last2, Pred&& op, Proj1&& proj1, Proj2&& proj2) { @@ -270,7 +270,7 @@ namespace hpx::parallel::detail { } } - template + HPX_CXX_EXPORT template struct sequential_find_end_t final : hpx::functional::detail::tag_fallback> { @@ -348,12 +348,13 @@ namespace hpx::parallel::detail { }; #if !defined(HPX_COMPUTE_DEVICE_CODE) - template + HPX_CXX_EXPORT template inline constexpr sequential_find_end_t sequential_find_end = sequential_find_end_t{}; #else - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE Iter1 sequential_find_end(Iter1 first1, Sent1 last1, Iter2 first2, Sent2 last2, Pred&& op, Proj1&& proj1, Proj2&& proj2) @@ -363,8 +364,8 @@ namespace hpx::parallel::detail { HPX_FORWARD(Proj2, proj2)); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE void sequential_find_end(Iter1 it, Iter2 first2, std::size_t base_idx, std::size_t part_size, std::size_t diff, Token& tok, Pred&& op, Proj1&& proj1, Proj2&& proj2) @@ -375,7 +376,7 @@ namespace hpx::parallel::detail { } #endif - template + HPX_CXX_EXPORT template struct sequential_find_first_of_t final : hpx::functional::detail::tag_fallback< sequential_find_first_of_t> @@ -431,13 +432,14 @@ namespace hpx::parallel::detail { }); } }; + #if !defined(HPX_COMPUTE_DEVICE_CODE) - template + HPX_CXX_EXPORT template inline constexpr sequential_find_first_of_t sequential_find_first_of = sequential_find_first_of_t{}; #else - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE InIter1 sequential_find_first_of( InIter1 first, InIter1 last, InIter2 s_first, InIter2 s_last, Pred&& op, Proj1&& proj1, Proj2&& proj2) @@ -447,8 +449,9 @@ namespace hpx::parallel::detail { HPX_FORWARD(Proj2, proj2)); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE void sequential_find_first_of(FwdIter it, FwdIter2 s_first, FwdIter2 s_last, std::size_t base_idx, std::size_t part_size, Token& tok, Pred&& op, Proj1&& proj1, diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/generate.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/generate.hpp index d44776888130..a54bbd15042f 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/generate.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/generate.hpp @@ -18,14 +18,14 @@ namespace hpx::parallel::detail { /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template constexpr Iter sequential_generate_helper(Iter first, Sent last, F&& f) { return util::loop_ind(first, last, [f = HPX_FORWARD(F, f)](auto&& v) mutable { v = f(); }); } - struct sequential_generate_t + HPX_CXX_EXPORT struct sequential_generate_t : hpx::functional::detail::tag_fallback { private: @@ -38,10 +38,11 @@ namespace hpx::parallel::detail { }; #if !defined(HPX_COMPUTE_DEVICE_CODE) - inline constexpr sequential_generate_t sequential_generate = + HPX_CXX_EXPORT inline constexpr sequential_generate_t sequential_generate = sequential_generate_t{}; #else - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE Iter sequential_generate( ExPolicy&& policy, Iter first, Sent last, F&& f) { @@ -51,14 +52,14 @@ namespace hpx::parallel::detail { #endif /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template constexpr Iter sequential_generate_n_helper( Iter first, std::size_t count, F&& f) { return std::generate_n(first, count, f); } - struct sequential_generate_n_t + HPX_CXX_EXPORT struct sequential_generate_n_t : hpx::functional::detail::tag_fallback { private: @@ -72,10 +73,10 @@ namespace hpx::parallel::detail { }; #if !defined(HPX_COMPUTE_DEVICE_CODE) - inline constexpr sequential_generate_n_t sequential_generate_n = - sequential_generate_n_t{}; + HPX_CXX_EXPORT inline constexpr sequential_generate_n_t + sequential_generate_n = sequential_generate_n_t{}; #else - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE Iter sequential_generate_n( ExPolicy&& policy, Iter first, std::size_t count, F&& f) { diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/indirect.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/indirect.hpp index 17d54d1e9bf0..8078cf042be5 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/indirect.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/indirect.hpp @@ -21,10 +21,10 @@ namespace hpx::parallel::detail { /// \class less_ptr_no_null /// - /// \remarks this is the comparison object for pointers. Receive a object + /// \remarks this is the comparison object for pointers. Receive an object /// for to compare the objects pointed. The pointers can't be /// nullptr - template ::value_type>> struct less_ptr_no_null @@ -42,12 +42,12 @@ namespace hpx::parallel::detail { } }; - /// \brief Create a index of iterators to the elements + /// \brief Create an index of iterators to the elements /// \tparam Iter : iterator to store in the index vector /// \param [in] first : iterator to the first element of the range /// \param [in] last : iterator to the element after the last of the range /// \param [in/out] v_iter : vector where store the iterators of the index - template + HPX_CXX_EXPORT template void create_index(Iter first, Sent last, std::vector& v_iter) { auto const nelem = detail::distance(first, last); @@ -61,12 +61,11 @@ namespace hpx::parallel::detail { } } - /// \brief sort the elements according of the sort of the index + /// \brief sort the elements according to the sort of the index /// \tparam Iter : iterators of the index /// \param [in] first : iterator to the first element of the data /// \param [in] v_iter : vector sorted of the iterators - - template + HPX_CXX_EXPORT template void sort_index(Iter first, std::vector& v_iter) { using value_type = typename std::iterator_traits::value_type; diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/insertion_sort.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/insertion_sort.hpp index bc99ee89d045..b860e890e08c 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/insertion_sort.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/insertion_sort.hpp @@ -19,7 +19,7 @@ namespace hpx::parallel::detail { /// \param [in] last : iterator to the next element of the last in the range /// \param [in] comp : object for to do the comparison between the elements /// \remarks This algorithm is O(N^2) - template ::value_type>> void insertion_sort(Iter first, Iter last, Compare comp = Compare()) diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/is_sorted.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/is_sorted.hpp index a39fe1099ada..7ddc1be53633 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/is_sorted.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/is_sorted.hpp @@ -13,7 +13,7 @@ namespace hpx::parallel::detail { - template constexpr bool is_sorted_sequential( Iter first, Sent last, Compare&& comp, Proj&& proj = Proj()) @@ -32,7 +32,7 @@ namespace hpx::parallel::detail { return sorted; } - template constexpr Iter is_sorted_until_sequential( Iter first, Sent last, Compare&& comp, Proj&& proj = Proj()) diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/mismatch.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/mismatch.hpp index c68e19d80b45..ba49dc31f585 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/mismatch.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/mismatch.hpp @@ -17,7 +17,7 @@ namespace hpx::parallel::detail { - template + HPX_CXX_EXPORT template struct sequential_mismatch_t final : hpx::functional::detail::tag_fallback> { @@ -49,12 +49,12 @@ namespace hpx::parallel::detail { }; #if !defined(HPX_COMPUTE_DEVICE_CODE) - template + HPX_CXX_EXPORT template inline constexpr sequential_mismatch_t sequential_mismatch = sequential_mismatch_t{}; #else - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE auto sequential_mismatch( Iter1 first1, Sent last1, Iter2 first2, F&& f) { @@ -62,8 +62,8 @@ namespace hpx::parallel::detail { first1, last1, first2, HPX_FORWARD(F, f)); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE void sequential_mismatch( std::size_t base_idx, ZipIterator it, std::size_t part_count, Token& tok, F&& f) @@ -73,7 +73,7 @@ namespace hpx::parallel::detail { } #endif - template + HPX_CXX_EXPORT template struct sequential_mismatch_binary_t final : hpx::functional::detail::tag_fallback< sequential_mismatch_binary_t> @@ -114,12 +114,13 @@ namespace hpx::parallel::detail { }; #if !defined(HPX_COMPUTE_DEVICE_CODE) - template + HPX_CXX_EXPORT template inline constexpr sequential_mismatch_binary_t sequential_mismatch_binary = sequential_mismatch_binary_t{}; #else - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE util::in_in_result sequential_mismatch_binary(Iter1 first1, Sent1 last1, Iter2 first2, Sent2 last2, F&& f, Proj1&& proj1, Proj2&& proj2) @@ -129,8 +130,8 @@ namespace hpx::parallel::detail { HPX_FORWARD(Proj2, proj2)); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE void sequential_mismatch_binary( std::size_t base_idx, ZipIterator it, std::size_t part_count, Token& tok, F&& f, Proj1&& proj1, Proj2&& proj2) diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/parallel_stable_sort.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/parallel_stable_sort.hpp index a834bdc89ba8..8932040da5ae 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/parallel_stable_sort.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/parallel_stable_sort.hpp @@ -21,12 +21,13 @@ namespace hpx::parallel::detail { - inline constexpr std::size_t stable_sort_limit_per_task = 1 << 16; + HPX_CXX_EXPORT inline constexpr std::size_t stable_sort_limit_per_task = 1 + << 16; /// \struct parallel_stable_sort /// /// This a structure for to implement a parallel stable sort exception safe - template + HPX_CXX_EXPORT template struct parallel_stable_sort_helper { using value_type = typename std::iterator_traits::value_type; @@ -136,7 +137,8 @@ namespace hpx::parallel::detail { } } - template + HPX_CXX_EXPORT template Iter parallel_stable_sort(Exec&& exec, Iter first, Sent last, std::size_t cores, std::size_t chunk_size, Compare&& comp) { @@ -149,7 +151,7 @@ namespace hpx::parallel::detail { return sorter(HPX_FORWARD(Exec, exec), cores, chunk_size); } - template + HPX_CXX_EXPORT template Iter parallel_stable_sort(Exec&& exec, Iter first, Sent last) { using compare = diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/pivot.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/pivot.hpp index 982cc140d2f0..c82b9fd2aa95 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/pivot.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/pivot.hpp @@ -26,7 +26,7 @@ namespace hpx::parallel::detail { /// \param iter_3 : iterator to the third value /// \param comp : object for comparing two values /// \return iterator to mid value - template + HPX_CXX_EXPORT template constexpr Iter mid3(Iter iter_1, Iter iter_2, Iter iter_3, Comp&& comp) { return HPX_INVOKE(comp, *iter_1, *iter_2) ? @@ -52,7 +52,7 @@ namespace hpx::parallel::detail { /// \param iter_9 iterator to the ninth value /// \param comp : object for comparing two values /// \return iterator to the mid value - template + HPX_CXX_EXPORT template inline constexpr Iter mid9(Iter iter_1, Iter iter_2, Iter iter_3, Iter iter_4, Iter iter_5, Iter iter_6, Iter iter_7, Iter iter_8, Iter iter_9, Comp&& comp) @@ -70,7 +70,7 @@ namespace hpx::parallel::detail { /// \param first iterator to the first element /// \param last iterator to the last element /// \param comp object for to Comp two elements - template + HPX_CXX_EXPORT template constexpr void pivot9(Iter first, Iter last, Comp&& comp) { std::size_t chunk = (last - first) >> 3; diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/reduce.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/reduce.hpp index dde8fa07c6c6..4631f9ed593c 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/reduce.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/reduce.hpp @@ -17,7 +17,7 @@ namespace hpx::parallel::detail { - template + HPX_CXX_EXPORT template struct sequential_reduce_t final : hpx::functional::detail::tag_fallback> { @@ -85,11 +85,11 @@ namespace hpx::parallel::detail { }; #if !defined(HPX_COMPUTE_DEVICE_CODE) - template + HPX_CXX_EXPORT template inline constexpr sequential_reduce_t sequential_reduce = sequential_reduce_t{}; #else - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE auto sequential_reduce(Args&&... args) { return sequential_reduce_t{}(std::forward(args)...); diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/reduce_deterministic.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/reduce_deterministic.hpp index af16e7456730..d6fafd52cd85 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/reduce_deterministic.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/reduce_deterministic.hpp @@ -22,7 +22,7 @@ namespace hpx::parallel::detail { - template + HPX_CXX_EXPORT template struct sequential_reduce_deterministic_t final : hpx::functional::detail::tag_fallback< sequential_reduce_deterministic_t> @@ -67,7 +67,7 @@ namespace hpx::parallel::detail { } }; - template + HPX_CXX_EXPORT template struct sequential_reduce_deterministic_rfa_t final : hpx::functional::detail::tag_fallback< sequential_reduce_deterministic_rfa_t> @@ -132,12 +132,12 @@ namespace hpx::parallel::detail { }; #if !defined(HPX_COMPUTE_DEVICE_CODE) - template + HPX_CXX_EXPORT template inline constexpr sequential_reduce_deterministic_t sequential_reduce_deterministic = sequential_reduce_deterministic_t{}; #else - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE auto sequential_reduce_deterministic( Args&&... args) { @@ -147,12 +147,12 @@ namespace hpx::parallel::detail { #endif #if !defined(HPX_COMPUTE_DEVICE_CODE) - template + HPX_CXX_EXPORT template inline constexpr sequential_reduce_deterministic_rfa_t sequential_reduce_deterministic_rfa = sequential_reduce_deterministic_rfa_t{}; #else - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE auto sequential_reduce_deterministic_rfa( Args&&... args) { diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/replace.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/replace.hpp index f7bd3758d8a5..7e497619babc 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/replace.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/replace.hpp @@ -23,7 +23,7 @@ namespace hpx::parallel::detail { /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct sequential_replace_t final : hpx::functional::detail::tag_fallback> { @@ -63,11 +63,11 @@ namespace hpx::parallel::detail { }; #if !defined(HPX_COMPUTE_DEVICE_CODE) - template + HPX_CXX_EXPORT template inline constexpr sequential_replace_t sequential_replace = sequential_replace_t{}; #else - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE auto sequential_replace(Args&&... args) { return sequential_replace_t{}(std::forward(args)...); @@ -75,7 +75,7 @@ namespace hpx::parallel::detail { #endif /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct sequential_replace_if_t final : hpx::functional::detail::tag_fallback> { @@ -117,11 +117,11 @@ namespace hpx::parallel::detail { }; #if !defined(HPX_COMPUTE_DEVICE_CODE) - template + HPX_CXX_EXPORT template inline constexpr sequential_replace_if_t sequential_replace_if = sequential_replace_if_t{}; #else - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE auto sequential_replace_if(Args&&... args) { return sequential_replace_if_t{}(std::forward(args)...); @@ -129,7 +129,7 @@ namespace hpx::parallel::detail { #endif /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct sequential_replace_copy_t final : hpx::functional::detail::tag_fallback< sequential_replace_copy_t> @@ -176,11 +176,11 @@ namespace hpx::parallel::detail { }; #if !defined(HPX_COMPUTE_DEVICE_CODE) - template + HPX_CXX_EXPORT template inline constexpr sequential_replace_copy_t sequential_replace_copy = sequential_replace_copy_t{}; #else - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE auto sequential_replace_copy(Args&&... args) { return sequential_replace_copy_t{}( @@ -189,7 +189,7 @@ namespace hpx::parallel::detail { #endif /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct sequential_replace_copy_if_t final : hpx::functional::detail::tag_fallback< sequential_replace_copy_if_t> @@ -245,11 +245,11 @@ namespace hpx::parallel::detail { }; #if !defined(HPX_COMPUTE_DEVICE_CODE) - template + HPX_CXX_EXPORT template inline constexpr sequential_replace_copy_if_t sequential_replace_copy_if = sequential_replace_copy_if_t{}; #else - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE auto sequential_replace_copy_if( Args&&... args) { diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/rfa.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/rfa.hpp index f216b852ca38..358482a7b5b4 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/rfa.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/rfa.hpp @@ -64,7 +64,8 @@ #include namespace hpx::parallel::detail::rfa { - template + + HPX_CXX_EXPORT template struct type4 { F x; @@ -73,50 +74,51 @@ namespace hpx::parallel::detail::rfa { F w; }; - template + HPX_CXX_EXPORT template struct type2 { F x; F y; }; - using float4 = type4; - using double4 = type4; - using float2 = type2; - using double2 = type2; - auto abs_max(float4 a) + HPX_CXX_EXPORT using float4 = type4; + HPX_CXX_EXPORT using double4 = type4; + HPX_CXX_EXPORT using float2 = type2; + HPX_CXX_EXPORT using double2 = type2; + + HPX_CXX_EXPORT inline auto abs_max(float4 a) { auto x = std::abs(a.x); auto y = std::abs(a.y); auto z = std::abs(a.z); auto w = std::abs(a.w); - const std::vector v = {x, y, z, w}; + std::vector const v = {x, y, z, w}; return *std::max_element(v.begin(), v.end()); } - auto abs_max(double4 a) + HPX_CXX_EXPORT inline auto abs_max(double4 a) { auto x = std::abs(a.x); auto y = std::abs(a.y); auto z = std::abs(a.z); auto w = std::abs(a.w); - const std::vector v = {x, y, z, w}; + std::vector const v = {x, y, z, w}; return *std::max_element(v.begin(), v.end()); } - auto abs_max(float2 a) + HPX_CXX_EXPORT inline auto abs_max(float2 a) { auto x = std::abs(a.x); auto y = std::abs(a.y); - const std::vector v = {x, y}; + std::vector const v = {x, y}; return *std::max_element(v.begin(), v.end()); } - auto abs_max(double2 a) + HPX_CXX_EXPORT inline auto abs_max(double2 a) { auto x = std::abs(a.x); auto y = std::abs(a.y); - const std::vector v = {x, y}; + std::vector const v = {x, y}; return *std::max_element(v.begin(), v.end()); } @@ -130,7 +132,7 @@ namespace hpx::parallel::detail::rfa { #define MAX_JUMP 5 static_assert(MAX_JUMP <= 5, "MAX_JUMP greater than max"); - template + HPX_CXX_EXPORT template inline constexpr Real ldexp_impl(Real arg, int exp) noexcept { return std::ldexp(arg, exp); @@ -152,7 +154,7 @@ namespace hpx::parallel::detail::rfa { // return arg; } - template + HPX_CXX_EXPORT template struct RFA_bins { static constexpr auto BIN_WIDTH = @@ -199,15 +201,15 @@ namespace hpx::parallel::detail::rfa { } }; - static char hpx_rfa_bin_host_buffer[sizeof(RFA_bins)]; + HPX_CXX_EXPORT inline char + hpx_rfa_bin_host_buffer[sizeof(RFA_bins)]; ///Class to hold a reproducible summation of the numbers passed to it /// ///@param ftype Floating-point data type; either `float` or `double ///@param FOLD The fold; use 3 as a default unless you understand it. - template ::value>* = - nullptr> + HPX_CXX_EXPORT template >* = nullptr> class alignas(2 * sizeof(ftype_)) reproducible_floating_accumulator { public: @@ -247,7 +249,7 @@ namespace hpx::parallel::detail::rfa { ///Applies also to binned complex double precision. static constexpr auto ENDURANCE = 1 << (MANT_DIG - BIN_WIDTH - 2); ///Return a binned floating-point reference bin - inline const ftype* binned_bins(const int x) const + inline ftype const* binned_bins(int const x) const { return &reinterpret_cast&>( hpx_rfa_bin_host_buffer)[x]; @@ -264,18 +266,18 @@ namespace hpx::parallel::detail::rfa { return *reinterpret_cast(&x); } ///Get the bit representation of a const float - static inline uint32_t get_bits(const float& x) + static inline uint32_t get_bits(float const& x) { - return *reinterpret_cast(&x); + return *reinterpret_cast(&x); } ///Get the bit representation of a const double - static inline uint64_t get_bits(const double& x) + static inline uint64_t get_bits(double const& x) { - return *reinterpret_cast(&x); + return *reinterpret_cast(&x); } ///Return primary vector value const ref - inline const ftype& primary(int i) const + inline ftype const& primary(int i) const { if constexpr (FOLD <= MAX_JUMP) { @@ -307,7 +309,7 @@ namespace hpx::parallel::detail::rfa { } ///Return carry vector value const ref - inline const ftype& carry(int i) const + inline ftype const& carry(int i) const { if constexpr (FOLD <= MAX_JUMP) { @@ -341,46 +343,46 @@ namespace hpx::parallel::detail::rfa { ///Return primary vector value ref inline ftype& primary(int i) { - const auto& c = *this; + auto const& c = *this; return const_cast(c.primary(i)); } ///Return carry vector value ref inline ftype& carry(int i) { - const auto& c = *this; + auto const& c = *this; return const_cast(c.carry(i)); } #ifdef DISABLE_ZERO - static inline constexpr bool ISZERO(const ftype) + static inline constexpr bool ISZERO(ftype const) { return false; } #else - static inline constexpr bool ISZERO(const ftype x) + static inline constexpr bool ISZERO(ftype const x) { return x == 0.0; } #endif #ifdef DISABLE_NANINF - static inline constexpr int ISNANINF(const ftype) + static inline constexpr int ISNANINF(ftype const) { return false; } #else - static inline constexpr int ISNANINF(const ftype x) + static inline constexpr int ISNANINF(ftype const x) { - const auto bits = get_bits(x); + auto const bits = get_bits(x); return (bits & ((2ull * MAX_EXP - 1) << (MANT_DIG - 1))) == ((2ull * MAX_EXP - 1) << (MANT_DIG - 1)); } #endif - static inline constexpr int EXP(const ftype x) + static inline constexpr int EXP(ftype const x) { - const auto bits = get_bits(x); + auto const bits = get_bits(x); return (bits >> (MANT_DIG - 1)) & (2 * MAX_EXP - 1); } @@ -388,7 +390,7 @@ namespace hpx::parallel::detail::rfa { ///The index of a non-binned type is the smallest index a binned type would ///need to have to sum it reproducibly. Higher indices correspond to smaller ///bins. - static inline constexpr int binned_dindex(const ftype x) + static inline constexpr int binned_dindex(ftype const x) { int exp = EXP(x); if (exp == 0) @@ -431,7 +433,7 @@ namespace hpx::parallel::detail::rfa { ///@param incpriY stride within Y's primary vector (use every incpriY'th element) ///@param inccarY stride within Y's carry vector (use every inccarY'th element) void binned_dmdupdate( - const ftype max_abs_val, const int incpriY, const int inccarY) + ftype const max_abs_val, int const incpriY, int const inccarY) { if (ISNANINF(primary(0))) return; @@ -439,7 +441,7 @@ namespace hpx::parallel::detail::rfa { int X_index = binned_dindex(max_abs_val); if (ISZERO(primary(0))) { - const ftype* const bins = binned_bins(X_index); + ftype const* const bins = binned_bins(X_index); for (int i = 0; i < FOLD; i++) { primary(i * incpriY) = bins[i]; @@ -461,7 +463,7 @@ namespace hpx::parallel::detail::rfa { primary(i * incpriY) = primary((i - shift) * incpriY); carry(i * inccarY) = carry((i - shift) * inccarY); } - const ftype* const bins = binned_bins(X_index); + ftype const* const bins = binned_bins(X_index); #if !defined(HPX_CLANG_VERSION) HPX_UNROLL #endif @@ -482,7 +484,7 @@ namespace hpx::parallel::detail::rfa { ///larger than the index of @p X /// ///@param incpriY stride within Y's primary vector (use every incpriY'th element) - void binned_dmddeposit(const ftype X, const int incpriY) + void binned_dmddeposit(ftype const X, int const incpriY) { ftype M; ftype x = X; @@ -553,7 +555,7 @@ namespace hpx::parallel::detail::rfa { /// ///@param incpriX stride within X's primary vector (use every incpriX'th element) ///@param inccarX stride within X's carry vector (use every inccarX'th element) - inline void binned_dmrenorm(const int incpriX, const int inccarX) + inline void binned_dmrenorm(int const incpriX, int const inccarX) { if (ISZERO(primary(0)) || ISNANINF(primary(0))) return; @@ -578,7 +580,7 @@ namespace hpx::parallel::detail::rfa { /// ///@param incpriY stride within Y's primary vector (use every incpriY'th element) ///@param inccarY stride within Y's carry vector (use every inccarY'th element) - void binned_dmdadd(const ftype X, const int incpriY, const int inccarY) + void binned_dmdadd(ftype const X, int const incpriY, int const inccarY) { binned_dmdupdate(X, incpriY, inccarY); binned_dmddeposit(X, incpriY); @@ -589,7 +591,7 @@ namespace hpx::parallel::detail::rfa { /// ///@param incpriX stride within X's primary vector (use every incpriX'th element) ///@param inccarX stride within X's carry vector (use every inccarX'th element) - double binned_conv_double(const int incpriX, const int inccarX) const + double binned_conv_double(int const incpriX, int const inccarX) const { int i = 0; @@ -602,8 +604,8 @@ namespace hpx::parallel::detail::rfa { double scale_down; double scale_up; int scaled; - const auto X_index = binned_index(); - const auto* const bins = binned_bins(X_index); + auto const X_index = binned_index(); + auto const* const bins = binned_bins(X_index); if (X_index <= (3 * MANT_DIG) / BIN_WIDTH) { scale_down = std::ldexp(0.5, 1 - (2 * MANT_DIG - BIN_WIDTH)); @@ -674,7 +676,7 @@ namespace hpx::parallel::detail::rfa { /// ///@param incpriX stride within X's primary vector (use every incpriX'th element) ///@param inccarX stride within X's carry vector (use every inccarX'th element) - float binned_conv_single(const int incpriX, const int inccarX) const + float binned_conv_single(int const incpriX, int const inccarX) const { int i = 0; double Y = 0.0; @@ -687,8 +689,8 @@ namespace hpx::parallel::detail::rfa { //Note that the following order of summation is in order of decreasing //exponent. The following code is specific to SBWIDTH=13, FLT_MANT_DIG=24, and //the number of carries equal to 1. - const auto X_index = binned_index(); - const auto* const bins = binned_bins(X_index); + auto const X_index = binned_index(); + auto const* const bins = binned_bins(X_index); if (X_index == 0) { Y += (double) carry(0) * (double) (((double) bins[0]) / 6.0) * @@ -722,9 +724,9 @@ namespace hpx::parallel::detail::rfa { ///@param inccarX stride within X's carry vector (use every inccarX'th element) ///@param incpriY stride within Y's primary vector (use every incpriY'th element) ///@param inccarY stride within Y's carry vector (use every inccarY'th element) - void binned_dmdmadd(const reproducible_floating_accumulator& x, - const int incpriX, const int inccarX, const int incpriY, - const int inccarY) + void binned_dmdmadd(reproducible_floating_accumulator const& x, + int const incpriX, int const inccarX, int const incpriY, + int const inccarY) { if (ISZERO(x.primary(0))) return; @@ -745,12 +747,12 @@ namespace hpx::parallel::detail::rfa { return; } - const auto X_index = x.binned_index(); - const auto Y_index = this->binned_index(); - const auto shift = Y_index - X_index; + auto const X_index = x.binned_index(); + auto const Y_index = this->binned_index(); + auto const shift = Y_index - X_index; if (shift > 0) { - const auto* const bins = binned_bins(Y_index); + auto const* const bins = binned_bins(Y_index); //shift Y upwards and add X to Y #if !defined(HPX_CLANG_VERSION) HPX_UNROLL @@ -777,7 +779,7 @@ namespace hpx::parallel::detail::rfa { } else if (shift < 0) { - const auto* const bins = binned_bins(X_index); + auto const* const bins = binned_bins(X_index); //shift X upwards and add X to Y #if !defined(HPX_CLANG_VERSION) HPX_UNROLL @@ -793,7 +795,7 @@ namespace hpx::parallel::detail::rfa { } else if (shift == 0) { - const auto* const bins = binned_bins(X_index); + auto const* const bins = binned_bins(X_index); // add X to Y #if !defined(HPX_CLANG_VERSION) HPX_UNROLL @@ -810,7 +812,7 @@ namespace hpx::parallel::detail::rfa { ///Add two manually specified binned fp (Y += X) ///Performs the operation Y += X - void binned_dbdbadd(const reproducible_floating_accumulator& other) + void binned_dbdbadd(reproducible_floating_accumulator const& other) { binned_dmdmadd(other, 1, 1, 1, 1); } @@ -818,10 +820,10 @@ namespace hpx::parallel::detail::rfa { public: reproducible_floating_accumulator() = default; reproducible_floating_accumulator( - const reproducible_floating_accumulator&) = default; + reproducible_floating_accumulator const&) = default; ///Sets this binned fp equal to another binned fp reproducible_floating_accumulator& operator=( - const reproducible_floating_accumulator&) = default; + reproducible_floating_accumulator const&) = default; ///Set the binned fp to zero void zero() @@ -851,7 +853,7 @@ namespace hpx::parallel::detail::rfa { ///NOTE: Casts @p x to the type of the binned fp template >* = nullptr> - reproducible_floating_accumulator& operator+=(const U x) + reproducible_floating_accumulator& operator+=(U const x) { binned_dmdadd(static_cast(x), 1, 1); return *this; @@ -861,7 +863,7 @@ namespace hpx::parallel::detail::rfa { ///NOTE: Casts @p x to the type of the binned fp template >* = nullptr> - reproducible_floating_accumulator& operator-=(const U x) + reproducible_floating_accumulator& operator-=(U const x) { binned_dmdadd(-static_cast(x), 1, 1); return *this; @@ -869,7 +871,7 @@ namespace hpx::parallel::detail::rfa { ///Accumulate a binned fp @p x into the binned fp. reproducible_floating_accumulator& operator+=( - const reproducible_floating_accumulator& other) + reproducible_floating_accumulator const& other) { binned_dbdbadd(other); return *this; @@ -878,20 +880,20 @@ namespace hpx::parallel::detail::rfa { ///Accumulate-subtract a binned fp @p x into the binned fp. ///NOTE: Makes a copy and performs arithmetic; slow. reproducible_floating_accumulator& operator-=( - const reproducible_floating_accumulator& other) + reproducible_floating_accumulator const& other) { - const auto temp = -other; + auto const temp = -other; binned_dbdbadd(temp); } ///Determines if two binned fp are equal - bool operator==(const reproducible_floating_accumulator& other) const + bool operator==(reproducible_floating_accumulator const& other) const { return data == other.data; } ///Determines if two binned fp are not equal - bool operator!=(const reproducible_floating_accumulator& other) const + bool operator!=(reproducible_floating_accumulator const& other) const { return !operator==(other); } @@ -900,7 +902,7 @@ namespace hpx::parallel::detail::rfa { ///NOTE: Casts @p x to the type of the binned fp template >* = nullptr> - reproducible_floating_accumulator& operator=(const U x) + reproducible_floating_accumulator& operator=(U const x) { zero(); binned_dmdadd(static_cast(x), 1, 1); @@ -916,7 +918,7 @@ namespace hpx::parallel::detail::rfa { reproducible_floating_accumulator temp = *this; if (primary(0) != 0.0) { - const auto* const bins = binned_bins(binned_index()); + auto const* const bins = binned_bins(binned_index()); for (int i = 0; i < FOLD; i++) { temp.primary(i * incpriX) = @@ -949,10 +951,10 @@ namespace hpx::parallel::detail::rfa { ///@param binned_sum The value of the sum computed using binned types ///@return The absolute error bound static constexpr ftype error_bound( - const uint64_t N, const ftype max_abs_val, const ftype binned_sum) + uint64_t const N, ftype const max_abs_val, ftype const binned_sum) { - const double X = std::abs(max_abs_val); - const double S = std::abs(binned_sum); + double const X = std::abs(max_abs_val); + double const S = std::abs(binned_sum); return static_cast( (std::max) (X, std::ldexp(0.5, MIN_EXP - 1)) * std::ldexp(0.5, (1 - FOLD) * BIN_WIDTH + 1) * N + @@ -963,7 +965,7 @@ namespace hpx::parallel::detail::rfa { } ///Add @p x to the binned fp - void add(const ftype x) + void add(ftype const x) { binned_dmdadd(x, 1, 1); } @@ -974,7 +976,7 @@ namespace hpx::parallel::detail::rfa { ///@param last End of range ///@param max_abs_val Maximum absolute value of any member of the range template - void add(InputIt first, InputIt last, const ftype max_abs_val) + void add(InputIt first, InputIt last, ftype const max_abs_val) { binned_dmdupdate(std::abs(max_abs_val), 1, 1); size_t count = 0; @@ -1001,8 +1003,8 @@ namespace hpx::parallel::detail::rfa { template void add(InputIt first, InputIt last) { - const auto max_abs_val = *std::max_element( - first, last, [](const auto& a, const auto& b) { + auto const max_abs_val = *std::max_element( + first, last, [](auto const& a, auto const& b) { return std::abs(a) < std::abs(b); }); add(first, last, static_cast(max_abs_val)); @@ -1015,7 +1017,7 @@ namespace hpx::parallel::detail::rfa { ///@param max_abs_val Maximum absolute value of any member of the range template >* = nullptr> - void add(const T* input, const size_t N, const ftype max_abs_val) + void add(T const* input, size_t const N, ftype const max_abs_val) { if (N == 0) return; @@ -1031,7 +1033,7 @@ namespace hpx::parallel::detail::rfa { ///@param N Number of elements to add template >* = nullptr> - void add(const T* input, const size_t N) + void add(T const* input, size_t const N) { if (N == 0) return; @@ -1046,7 +1048,7 @@ namespace hpx::parallel::detail::rfa { ///Accumulate a float4 @p x into the binned fp. ///NOTE: Casts @p x to the type of the binned fp - reproducible_floating_accumulator& operator+=(const float4& x) + reproducible_floating_accumulator& operator+=(float4 const& x) { binned_dmdupdate(abs_max(x), 1, 1); binned_dmddeposit(static_cast(x.x), 1); @@ -1058,7 +1060,7 @@ namespace hpx::parallel::detail::rfa { ///Accumulate a double2 @p x into the binned fp. ///NOTE: Casts @p x to the type of the binned fp - reproducible_floating_accumulator& operator+=(const float2& x) + reproducible_floating_accumulator& operator+=(float2 const& x) { binned_dmdupdate(abs_max(x), 1, 1); binned_dmddeposit(static_cast(x.x), 1); @@ -1068,7 +1070,7 @@ namespace hpx::parallel::detail::rfa { ///Accumulate a double2 @p x into the binned fp. ///NOTE: Casts @p x to the type of the binned fp - reproducible_floating_accumulator& operator+=(const double2& x) + reproducible_floating_accumulator& operator+=(double2 const& x) { binned_dmdupdate(abs_max(x), 1, 1); binned_dmddeposit(static_cast(x.x), 1); @@ -1076,7 +1078,7 @@ namespace hpx::parallel::detail::rfa { return *this; } - void add(const float4* input, const size_t N, float max_abs_val) + void add(float4 const* input, size_t const N, float max_abs_val) { if (N == 0) return; @@ -1098,7 +1100,7 @@ namespace hpx::parallel::detail::rfa { } } - void add(const double2* input, const size_t N, double max_abs_val) + void add(double2 const* input, size_t const N, double max_abs_val) { if (N == 0) return; @@ -1118,7 +1120,7 @@ namespace hpx::parallel::detail::rfa { } } - void add(const float2* input, const size_t N, double max_abs_val) + void add(float2 const* input, size_t const N, double max_abs_val) { if (N == 0) return; @@ -1138,7 +1140,7 @@ namespace hpx::parallel::detail::rfa { } } - void add(const float4* input, const size_t N) + void add(float4 const* input, size_t const N) { if (N == 0) return; @@ -1151,7 +1153,7 @@ namespace hpx::parallel::detail::rfa { add(input, N, max_abs_val); } - void add(const double2* input, const size_t N) + void add(double2 const* input, size_t const N) { if (N == 0) return; @@ -1164,7 +1166,7 @@ namespace hpx::parallel::detail::rfa { add(input, N, max_abs_val); } - void add(const float2* input, const size_t N) + void add(float2 const* input, size_t const N) { if (N == 0) return; @@ -1188,7 +1190,7 @@ namespace hpx::parallel::detail::rfa { ///`add()` for an example template >* = nullptr> - void set_max_abs_val(const T mav) + void set_max_abs_val(T const mav) { binned_dmdupdate(std::abs(mav), 1, 1); } @@ -1196,7 +1198,7 @@ namespace hpx::parallel::detail::rfa { ///Add @p x to the binned fp /// ///This is intended to be used after a call to `set_max_abs_val()` - void unsafe_add(const ftype x) + void unsafe_add(ftype const x) { binned_dmddeposit(x, 1); } @@ -1210,5 +1212,4 @@ namespace hpx::parallel::detail::rfa { binned_dmrenorm(1, 1); } }; - } // namespace hpx::parallel::detail::rfa diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/rotate.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/rotate.hpp index e14c490c5aa5..9e48e4d5b5c1 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/rotate.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/rotate.hpp @@ -17,7 +17,7 @@ namespace hpx::parallel::detail { // provide implementation of std::rotate supporting iterators/sentinels - template + HPX_CXX_EXPORT template constexpr void sequential_rotate_helper( Iter first, Iter new_first, Sent last) { @@ -40,7 +40,7 @@ namespace hpx::parallel::detail { } } - template + HPX_CXX_EXPORT template constexpr util::in_out_result sequential_rotate( Iter first, Iter new_first, Sent last) { diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/sample_sort.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/sample_sort.hpp index dc606f6d157d..70226517ae50 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/sample_sort.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/sample_sort.hpp @@ -30,14 +30,15 @@ /////////////////////////////////////////////////////////////////////////////// namespace hpx::parallel::detail { - static constexpr std::uint32_t sample_sort_limit_per_task = 1 << 16; + HPX_CXX_EXPORT inline constexpr std::uint32_t sample_sort_limit_per_task = 1 + << 16; /// \struct sample_sort /// \brief This a structure for to implement a sample sort, exception /// safe /// \tparam /// \remarks - template + HPX_CXX_EXPORT template struct sample_sort_helper { using value_type = typename std::iterator_traits::value_type; @@ -231,7 +232,7 @@ namespace hpx::parallel::detail { /// \remarks this is the comparison object for pointers. Receive a object /// for to compare the objects pointed. The pointers can't be /// nullptr - template + HPX_CXX_EXPORT template struct less_ptr_no_null { Comp comp; @@ -370,8 +371,8 @@ namespace hpx::parallel::detail { } /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template void sample_sort(Exec&& exec, Iter first, Sent last, Compare&& comp, std::uint32_t num_threads, Value* paux, std::size_t naux, std::size_t chunk_size) @@ -383,7 +384,8 @@ namespace hpx::parallel::detail { sorter(HPX_FORWARD(Exec, exec), first, last, paux, naux, chunk_size); } - template + HPX_CXX_EXPORT template void sample_sort(Exec&& exec, Iter first, Sent last, Compare&& comp, std::uint32_t num_threads) { @@ -395,7 +397,8 @@ namespace hpx::parallel::detail { static_cast(sample_sort_limit_per_task)); } - template + HPX_CXX_EXPORT template void sample_sort(Exec&& exec, Iter first, Sent last, Compare&& comp, std::uint32_t num_threads, util::range::value_type*> @@ -412,7 +415,7 @@ namespace hpx::parallel::detail { range_buf_initial.size(), chunk_size); } - template + HPX_CXX_EXPORT template void sample_sort( Exec&& exec, Iter first, Sent last, std::uint32_t num_threads) { @@ -425,7 +428,7 @@ namespace hpx::parallel::detail { static_cast(sample_sort_limit_per_task)); } - template + HPX_CXX_EXPORT template void sample_sort(Exec&& exec, Iter first, Sent last) { using value_type = typename std::iterator_traits::value_type; @@ -436,5 +439,4 @@ namespace hpx::parallel::detail { static_cast(nullptr), static_cast(0), static_cast(sample_sort_limit_per_task)); } - } // namespace hpx::parallel::detail diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/search.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/search.hpp index 88bb917c1a80..1d39da9b1f16 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/search.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/search.hpp @@ -33,7 +33,7 @@ namespace hpx::parallel::detail { /////////////////////////////////////////////////////////////////////////// // search - template + HPX_CXX_EXPORT template struct search final : public algorithm, FwdIter> { constexpr search() noexcept @@ -195,7 +195,7 @@ namespace hpx::parallel::detail { /////////////////////////////////////////////////////////////////////////// // search_n - template + HPX_CXX_EXPORT template struct search_n final : public algorithm, FwdIter> { constexpr search_n() noexcept diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/set_operation.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/set_operation.hpp index a9a6bac0ee1d..8b6c81e2b821 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/set_operation.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/set_operation.hpp @@ -34,7 +34,7 @@ namespace hpx::parallel::detail { /// \cond NOINTERNAL /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct set_operations_buffer { template @@ -72,7 +72,7 @@ namespace hpx::parallel::detail { value_type, rewritable_ref>; }; - struct set_chunk_data + HPX_CXX_EXPORT struct set_chunk_data { static constexpr std::size_t uninit_start = static_cast(-1); @@ -92,9 +92,9 @@ namespace hpx::parallel::detail { }; /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template util::detail::algorithm_result_t> set_operation(ExPolicy&& policy, Iter1 first1, Sent1 last1, Iter2 first2, @@ -163,8 +163,8 @@ namespace hpx::parallel::detail { return; } - // move backwards to find earliest element which is equal to the - // last element of the current chunk + // move backwards to find the earliest element which is equal to + // the last element of the current chunk if (end1 != 0) { auto end_value1 = HPX_INVOKE(proj1, first1[end1 - 1]); @@ -177,7 +177,7 @@ namespace hpx::parallel::detail { } } - // move backwards to find earliest element which is equal to the + // move backwards to find the earliest element which is equal to the // first element of the current chunk if (start1 != 0) { @@ -281,6 +281,5 @@ namespace hpx::parallel::detail { return parallel::util::partitioner::call( policy, chunks.get(), cores, HPX_MOVE(f1), HPX_MOVE(f2)); } - /// \endcond } // namespace hpx::parallel::detail diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/spin_sort.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/spin_sort.hpp index b466129a80fe..a646cb32983f 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/spin_sort.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/spin_sort.hpp @@ -32,8 +32,8 @@ namespace hpx::parallel::detail { /// algorithm if not make a recursive call swapping /// the ranges /// \return range with all the elements sorted and moved - template + HPX_CXX_EXPORT template void range_sort(util::range const& rng_a, util::range const& rng_b, Compare comp, std::uint32_t level) @@ -69,7 +69,7 @@ namespace hpx::parallel::detail { /// \tparam Iter : iterator to the elements /// \tparam Compare : object for to Compare the elements pointed by Iter /// \remarks - template + HPX_CXX_EXPORT template class spin_sort_helper { using value_type = typename std::iterator_traits::value_type; @@ -218,7 +218,7 @@ namespace hpx::parallel::detail { } } - template + HPX_CXX_EXPORT template void spin_sort(Iter first, Sent last) { using compare = @@ -227,14 +227,14 @@ namespace hpx::parallel::detail { spin_sort_helper sorter(first, last, compare{}); } - template + HPX_CXX_EXPORT template void spin_sort(Iter first, Sent last, Compare&& comp) { spin_sort_helper> sorter( first, last, HPX_FORWARD(Compare, comp)); } - template + HPX_CXX_EXPORT template void spin_sort(Iter first, Sent last, Compare&& comp, util::range::value_type*> range_aux) { @@ -242,12 +242,11 @@ namespace hpx::parallel::detail { first, last, HPX_FORWARD(Compare, comp), range_aux); } - template + HPX_CXX_EXPORT template void spin_sort(Iter first, Sent last, Compare comp, typename std::iterator_traits::value_type* paux, std::size_t naux) { spin_sort_helper> sorter( first, last, HPX_FORWARD(Compare, comp), paux, naux); } - } // namespace hpx::parallel::detail diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/transfer.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/transfer.hpp index d763153b81c5..0a2c4b8df729 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/transfer.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/transfer.hpp @@ -23,8 +23,9 @@ namespace hpx::parallel { /////////////////////////////////////////////////////////////////////////// // transfer namespace detail { + /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct iterators_are_segmented : std::integral_constant + HPX_CXX_EXPORT template struct iterators_are_not_segmented : std::integral_constant + HPX_CXX_EXPORT template decltype(auto) transfer_(ExPolicy&& policy, FwdIter1 first, Sent1 last, FwdIter2 dest, std::false_type) { @@ -57,8 +58,8 @@ namespace hpx::parallel { #if !defined(HPX_COMPUTE_DEVICE_CODE) // forward declare segmented version - template + HPX_CXX_EXPORT template typename util::detail::algorithm_result>::type transfer_(ExPolicy&& policy, FwdIter1 first, Sent1 last, FwdIter2 dest, @@ -103,9 +104,8 @@ namespace hpx::parallel { // element in the destination range, one past the last element // transferred. // - - template + HPX_CXX_EXPORT template // clang-format off requires ( hpx::is_execution_policy_v && diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/upper_lower_bound.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/upper_lower_bound.hpp index a962e7646be2..2ffdd95d93c0 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/detail/upper_lower_bound.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/detail/upper_lower_bound.hpp @@ -18,8 +18,8 @@ namespace hpx::parallel::detail { /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template Iter lower_bound( Iter first, Sent last, T&& value, F&& f, Proj&& proj, CancelToken& tok) { @@ -48,7 +48,8 @@ namespace hpx::parallel::detail { return first; } - template + HPX_CXX_EXPORT template constexpr Iter lower_bound_n(Iter first, typename std::iterator_traits::difference_type count, T&& value, F&& f, Proj&& proj) @@ -74,7 +75,7 @@ namespace hpx::parallel::detail { return first; } - template + HPX_CXX_EXPORT template constexpr Iter lower_bound_n(Iter first, typename std::iterator_traits::difference_type count, T&& value, F&& f, hpx::identity) @@ -129,8 +130,8 @@ namespace hpx::parallel::detail { } } - template + HPX_CXX_EXPORT template constexpr Iter lower_bound( Iter first, Sent last, T&& value, F&& f, Proj&& proj) { @@ -144,8 +145,8 @@ namespace hpx::parallel::detail { } /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template Iter upper_bound( Iter first, Sent last, T&& value, F&& f, Proj&& proj, CancelToken& tok) { @@ -174,7 +175,8 @@ namespace hpx::parallel::detail { return first; } - template + HPX_CXX_EXPORT template constexpr Iter upper_bound_n(Iter first, typename std::iterator_traits::difference_type count, T&& value, F&& f, Proj&& proj) @@ -200,7 +202,7 @@ namespace hpx::parallel::detail { return first; } - template + HPX_CXX_EXPORT template constexpr Iter upper_bound_n(Iter first, typename std::iterator_traits::difference_type count, T&& value, F&& f, hpx::identity) @@ -255,8 +257,8 @@ namespace hpx::parallel::detail { } } - template + HPX_CXX_EXPORT template constexpr Iter upper_bound( Iter first, Sent last, T&& value, F&& f, Proj&& proj) { diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/ends_with.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/ends_with.hpp index df42bf2ee927..f19b3f7277b8 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/ends_with.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/ends_with.hpp @@ -133,7 +133,7 @@ namespace hpx::parallel { namespace detail { /// \cond NOINTERNAL - struct ends_with : public algorithm + HPX_CXX_EXPORT struct ends_with : public algorithm { constexpr ends_with() noexcept : algorithm("ends_with") @@ -205,7 +205,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ends_with - inline constexpr struct ends_with_t final + HPX_CXX_EXPORT inline constexpr struct ends_with_t final : hpx::detail::tag_parallel_algorithm { private: diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/equal.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/equal.hpp index b39315a0ffbb..b877d64d1b57 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/equal.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/equal.hpp @@ -477,7 +477,8 @@ namespace hpx::parallel { /// \cond NOINTERNAL /////////////////////////////////////////////////////////////////////// - struct equal_binary : public algorithm + HPX_CXX_EXPORT struct equal_binary + : public algorithm { constexpr equal_binary() noexcept : algorithm("equal_binary") @@ -597,8 +598,9 @@ namespace hpx::parallel { /////////////////////////////////////////////////////////////////////////// // equal namespace detail { + /// \cond NOINTERNAL - struct equal : public algorithm + HPX_CXX_EXPORT struct equal : public algorithm { constexpr equal() noexcept : algorithm("equal") @@ -673,7 +675,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::equal - inline constexpr struct equal_t final + HPX_CXX_EXPORT inline constexpr struct equal_t final : hpx::detail::tag_parallel_algorithm { private: diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/exclusive_scan.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/exclusive_scan.hpp index a9ddd6c60bfe..a8cfc594a514 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/exclusive_scan.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/exclusive_scan.hpp @@ -320,9 +320,9 @@ namespace hpx::parallel { /////////////////////////////////////////////////////////////////////// // Our own version of the sequential exclusive_scan. - template - static constexpr util::in_out_result + HPX_CXX_EXPORT template + constexpr util::in_out_result sequential_exclusive_scan( InIter first, Sent last, OutIter dest, T init, Op&& op) { @@ -336,8 +336,9 @@ namespace hpx::parallel { return util::in_out_result{first, dest}; } - template - static constexpr T sequential_exclusive_scan_n( + HPX_CXX_EXPORT template + constexpr T sequential_exclusive_scan_n( InIter first, std::size_t count, OutIter dest, T init, Op&& op) { T temp = init; @@ -351,7 +352,7 @@ namespace hpx::parallel { } /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct exclusive_scan : public algorithm, IterPair> { @@ -457,7 +458,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::exclusive_scan - inline constexpr struct exclusive_scan_t final + HPX_CXX_EXPORT inline constexpr struct exclusive_scan_t final : hpx::detail::tag_parallel_algorithm { template + HPX_CXX_EXPORT template struct fill_iteration { std::decay_t val_; @@ -192,7 +193,7 @@ namespace hpx::parallel { } }; - template + HPX_CXX_EXPORT template struct fill : public algorithm, Iter> { constexpr fill() noexcept @@ -239,7 +240,7 @@ namespace hpx::parallel { namespace detail { /// \cond NOINTERNAL - template + HPX_CXX_EXPORT template struct fill_n : public algorithm, FwdIter> { constexpr fill_n() noexcept @@ -272,7 +273,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::fill - inline constexpr struct fill_t final + HPX_CXX_EXPORT inline constexpr struct fill_t final : hpx::detail::tag_parallel_algorithm { private: @@ -317,7 +318,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::fill_n - inline constexpr struct fill_n_t final + HPX_CXX_EXPORT inline constexpr struct fill_n_t final : hpx::detail::tag_parallel_algorithm { private: diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/find.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/find.hpp index f65e9fd9a6b0..afdf34a52735 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/find.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/find.hpp @@ -806,7 +806,7 @@ namespace hpx::parallel { // find namespace detail { - template + HPX_CXX_EXPORT template struct find : public algorithm, FwdIter> { constexpr find() noexcept @@ -898,7 +898,7 @@ namespace hpx::parallel { // find_if namespace detail { - template + HPX_CXX_EXPORT template struct find_if : public algorithm, FwdIter> { constexpr find_if() noexcept @@ -990,7 +990,7 @@ namespace hpx::parallel { // find_if_not namespace detail { - template + HPX_CXX_EXPORT template struct find_if_not : public algorithm, FwdIter> { constexpr find_if_not() noexcept @@ -1082,7 +1082,7 @@ namespace hpx::parallel { // find_end namespace detail { - template + HPX_CXX_EXPORT template struct find_end : public algorithm, FwdIter> { constexpr find_end() noexcept @@ -1200,7 +1200,7 @@ namespace hpx::parallel { // find_first_of namespace detail { - template + HPX_CXX_EXPORT template struct find_first_of : public algorithm, FwdIter> { constexpr find_first_of() noexcept @@ -1309,7 +1309,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::find - inline constexpr struct find_t final + HPX_CXX_EXPORT inline constexpr struct find_t final : hpx::detail::tag_parallel_algorithm { private: @@ -1352,7 +1352,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::find_if - inline constexpr struct find_if_t final + HPX_CXX_EXPORT inline constexpr struct find_if_t final : hpx::detail::tag_parallel_algorithm { private: @@ -1395,7 +1395,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::find_if_not - inline constexpr struct find_if_not_t final + HPX_CXX_EXPORT inline constexpr struct find_if_not_t final : hpx::detail::tag_parallel_algorithm { private: @@ -1438,7 +1438,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::find_end - inline constexpr struct find_end_t final + HPX_CXX_EXPORT inline constexpr struct find_end_t final : hpx::detail::tag_parallel_algorithm { private: @@ -1537,7 +1537,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::find_first_of - inline constexpr struct find_first_of_t final + HPX_CXX_EXPORT inline constexpr struct find_first_of_t final : hpx::detail::tag_parallel_algorithm { private: diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/for_each.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/for_each.hpp index dfc96302adab..4680b56b8740 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/for_each.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/for_each.hpp @@ -271,7 +271,8 @@ namespace hpx::parallel { /// \cond NOINTERNAL /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct for_each_iteration { using execution_policy_type = std::decay_t; @@ -326,7 +327,7 @@ namespace hpx::parallel { } }; - template + HPX_CXX_EXPORT template struct for_each_iteration { using execution_policy_type = std::decay_t; @@ -393,7 +394,7 @@ namespace hpx::parallel { }; /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct for_each_n : public algorithm, Iter> { constexpr for_each_n() noexcept @@ -451,7 +452,7 @@ namespace hpx::parallel { namespace detail { /// \cond NOINTERNAL - template + HPX_CXX_EXPORT template struct for_each : public algorithm, Iter> { constexpr for_each() noexcept @@ -541,7 +542,7 @@ namespace hpx { // that the non-segmented algorithms do not need to be explicitly // disabled for other, possibly external specializations. // - inline constexpr struct for_each_t final + HPX_CXX_EXPORT inline constexpr struct for_each_t final : hpx::detail::tag_parallel_algorithm { private: @@ -587,7 +588,7 @@ namespace hpx { } for_each{}; /////////////////////////////////////////////////////////////////////////// - inline constexpr struct for_each_n_t final + HPX_CXX_EXPORT inline constexpr struct for_each_n_t final : hpx::detail::tag_parallel_algorithm { private: @@ -659,7 +660,7 @@ namespace hpx { #if defined(HPX_HAVE_THREAD_DESCRIPTION) namespace hpx::traits { - template + HPX_CXX_EXPORT template struct get_function_address< parallel::detail::for_each_iteration> { @@ -671,7 +672,7 @@ namespace hpx::traits { } }; - template + HPX_CXX_EXPORT template struct get_function_annotation< parallel::detail::for_each_iteration> { @@ -684,7 +685,7 @@ namespace hpx::traits { }; #if HPX_HAVE_ITTNOTIFY != 0 && !defined(HPX_HAVE_APEX) - template + HPX_CXX_EXPORT template struct get_function_annotation_itt< parallel::detail::for_each_iteration> { diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop.hpp index 20459681c7d1..e7f2c60ad1d4 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop.hpp @@ -770,7 +770,7 @@ namespace hpx::parallel { HPX_HAS_XXX_TRAIT_DEF(needs_current_thread_num); /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE constexpr void init_iteration(hpx::tuple& args, hpx::util::index_pack, std::size_t part_index, std::size_t current_thread) noexcept @@ -779,7 +779,8 @@ namespace hpx::parallel { ...); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr void invoke_iteration( hpx::tuple& args, hpx::util::index_pack, F&& f, B part_begin, std::size_t current_thread) @@ -788,7 +789,7 @@ namespace hpx::parallel { hpx::get(args).iteration_value(current_thread)...); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr void next_iteration( hpx::tuple& args, hpx::util::index_pack, std::size_t current_thread) noexcept @@ -796,7 +797,7 @@ namespace hpx::parallel { (hpx::get(args).next_iteration(current_thread), ...); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE constexpr void exit_iteration(hpx::tuple& args, hpx::util::index_pack, std::size_t size) noexcept { @@ -804,11 +805,12 @@ namespace hpx::parallel { } /////////////////////////////////////////////////////////////////////// - template > + HPX_CXX_EXPORT template > struct part_iterations; - template + HPX_CXX_EXPORT template struct part_iterations> { using fun_type = std::decay_t; @@ -911,7 +913,7 @@ namespace hpx::parallel { } }; - template + HPX_CXX_EXPORT template struct part_iterations> { using fun_type = std::decay_t; @@ -1012,7 +1014,7 @@ namespace hpx::parallel { } }; - template + HPX_CXX_EXPORT template struct part_iterations> { using fun_type = std::decay_t; @@ -1092,7 +1094,7 @@ namespace hpx::parallel { } }; - template + HPX_CXX_EXPORT template struct part_iterations> { using fun_type = std::decay_t; @@ -1149,7 +1151,8 @@ namespace hpx::parallel { }; /////////////////////////////////////////////////////////////////////// - struct for_loop_algo : public detail::algorithm + HPX_CXX_EXPORT struct for_loop_algo + : public detail::algorithm { constexpr for_loop_algo() noexcept : for_loop_algo::algorithm("for_loop_algo") @@ -1264,7 +1267,7 @@ namespace hpx::parallel { }; // namespace detail /////////////////////////////////////////////////////////////////////// - struct for_loop_strided_algo + HPX_CXX_EXPORT struct for_loop_strided_algo : public detail::algorithm { constexpr for_loop_strided_algo() noexcept @@ -1466,8 +1469,8 @@ namespace hpx::parallel { }; // reshuffle arguments, last argument is function object, will go first - template + HPX_CXX_EXPORT template auto for_loop(ExPolicy&& policy, B first, E last, hpx::util::index_pack, Args&&... args) { @@ -1494,8 +1497,8 @@ namespace hpx::parallel { size, HPX_MOVE(f), hpx::get(t)...); } - template + HPX_CXX_EXPORT template auto for_loop_range(ExPolicy&& policy, R r, hpx::util::index_pack, Args&&... args) { @@ -1528,8 +1531,8 @@ namespace hpx::parallel { } // reshuffle arguments, last argument is function object, will go first - template + HPX_CXX_EXPORT template auto for_loop_strided(ExPolicy&& policy, B first, E last, S stride, hpx::util::index_pack, Args&&... args) { @@ -1567,8 +1570,8 @@ namespace hpx::parallel { first, size, stride, HPX_MOVE(f), hpx::get(t)...); } - template + HPX_CXX_EXPORT template auto for_loop_strided_range(ExPolicy&& policy, R r, S stride, hpx::util::index_pack, Args&&... args) { @@ -1608,8 +1611,8 @@ namespace hpx::parallel { } // reshuffle arguments, last argument is function object, will go first - template + HPX_CXX_EXPORT template util::detail::algorithm_result_t for_loop_n(ExPolicy&& policy, B first, Size size, S stride, hpx::util::index_pack, Args&&... args) @@ -1643,7 +1646,7 @@ namespace hpx::parallel { namespace hpx::experimental { /////////////////////////////////////////////////////////////////////////// - inline constexpr struct for_loop_t final + HPX_CXX_EXPORT inline constexpr struct for_loop_t final : hpx::detail::tag_parallel_algorithm { private: @@ -1683,7 +1686,7 @@ namespace hpx::experimental { } for_loop{}; /////////////////////////////////////////////////////////////////////////// - inline constexpr struct for_loop_strided_t final + HPX_CXX_EXPORT inline constexpr struct for_loop_strided_t final : hpx::detail::tag_parallel_algorithm { private: @@ -1733,7 +1736,7 @@ namespace hpx::experimental { } for_loop_strided{}; /////////////////////////////////////////////////////////////////////////// - inline constexpr struct for_loop_n_t final + HPX_CXX_EXPORT inline constexpr struct for_loop_n_t final : hpx::detail::tag_parallel_algorithm { private: @@ -1781,7 +1784,7 @@ namespace hpx::experimental { } for_loop_n{}; /////////////////////////////////////////////////////////////////////////// - inline constexpr struct for_loop_n_strided_t final + HPX_CXX_EXPORT inline constexpr struct for_loop_n_strided_t final : hpx::detail::tag_parallel_algorithm { private: @@ -1836,7 +1839,8 @@ namespace hpx::experimental { #if defined(HPX_HAVE_THREAD_DESCRIPTION) namespace hpx::traits { - template + HPX_CXX_EXPORT template struct get_function_address< hpx::parallel::detail::part_iterations> { @@ -1848,7 +1852,8 @@ namespace hpx::traits { } }; - template + HPX_CXX_EXPORT template struct get_function_annotation< hpx::parallel::detail::part_iterations> { @@ -1861,7 +1866,8 @@ namespace hpx::traits { }; #if HPX_HAVE_ITTNOTIFY != 0 && !defined(HPX_HAVE_APEX) - template + HPX_CXX_EXPORT template struct get_function_annotation_itt< hpx::parallel::detail::part_iterations> { diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop_induction.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop_induction.hpp index 0063dd543ec7..deb5741dac28 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop_induction.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop_induction.hpp @@ -22,7 +22,7 @@ namespace hpx::parallel::detail { /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct induction_helper { explicit constexpr induction_helper(T var) noexcept @@ -58,7 +58,7 @@ namespace hpx::parallel::detail { T curr_; }; - template + HPX_CXX_EXPORT template struct induction_helper { explicit constexpr induction_helper(T& var) noexcept @@ -100,7 +100,7 @@ namespace hpx::parallel::detail { }; /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct induction_stride_helper { constexpr induction_stride_helper(T var, std::size_t stride) noexcept @@ -138,7 +138,7 @@ namespace hpx::parallel::detail { std::size_t stride_; }; - template + HPX_CXX_EXPORT template struct induction_stride_helper { constexpr induction_stride_helper(T& var, std::size_t stride) noexcept @@ -214,7 +214,7 @@ namespace hpx::experimental { /// non-const type, \a value is used as the live-out object for the /// induction object; otherwise there is no live-out object. /// - template + HPX_CXX_EXPORT template HPX_FORCEINLINE constexpr hpx::parallel::detail::induction_stride_helper induction(T&& value, std::size_t stride) { @@ -222,7 +222,7 @@ namespace hpx::experimental { HPX_FORWARD(T, value), stride); } - template + HPX_CXX_EXPORT template HPX_FORCEINLINE constexpr hpx::parallel::detail::induction_helper induction(T&& value) { diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop_reduction_base.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop_reduction_base.hpp index 6b0441e77891..45ff37ab7550 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop_reduction_base.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop_reduction_base.hpp @@ -29,7 +29,7 @@ namespace hpx::parallel::detail { /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct reduction_helper { using needs_current_thread_num = void; @@ -143,7 +143,7 @@ namespace hpx::experimental { /// views are combined by invoking the copy of combiner, passing /// it the two views to be combined. /// - template + HPX_CXX_EXPORT template HPX_FORCEINLINE constexpr hpx::parallel::detail::reduction_helper> reduction(T& var, T const& identity, Op&& combiner) @@ -152,7 +152,7 @@ namespace hpx::experimental { var, identity, HPX_FORWARD(Op, combiner)); } - template + HPX_CXX_EXPORT template HPX_FORCEINLINE constexpr hpx::parallel::detail::reduction_helper> reduction(T& var, Op&& combiner) diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop_reduction_bit_and.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop_reduction_bit_and.hpp index 29714c692d0d..ce91c014ac4a 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop_reduction_bit_and.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop_reduction_bit_and.hpp @@ -65,7 +65,7 @@ namespace hpx::experimental { /// views are combined by invoking the copy of combiner, passing it /// the two views to be combined. /// - template + HPX_CXX_EXPORT template HPX_FORCEINLINE constexpr hpx::parallel::detail::reduction_helper> reduction_bit_and(T& var) @@ -73,7 +73,7 @@ namespace hpx::experimental { return reduction(var, ~T(), std::bit_and()); } - template + HPX_CXX_EXPORT template HPX_FORCEINLINE constexpr hpx::parallel::detail::reduction_helper> reduction_bit_and(T& var, T const& identity) diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop_reduction_bit_or.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop_reduction_bit_or.hpp index cd9885f2b400..dd6f54b7e66f 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop_reduction_bit_or.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop_reduction_bit_or.hpp @@ -65,7 +65,7 @@ namespace hpx::experimental { /// views are combined by invoking the copy of combiner, passing it /// the two views to be combined. /// - template + HPX_CXX_EXPORT template HPX_FORCEINLINE constexpr hpx::parallel::detail::reduction_helper> reduction_bit_or(T& var) @@ -73,7 +73,7 @@ namespace hpx::experimental { return reduction(var, T(), std::bit_or()); } - template + HPX_CXX_EXPORT template HPX_FORCEINLINE constexpr hpx::parallel::detail::reduction_helper> reduction_bit_or(T& var, T const& identity) diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop_reduction_bit_xor.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop_reduction_bit_xor.hpp index a2bf57ec745e..12e8a28f3a87 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop_reduction_bit_xor.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop_reduction_bit_xor.hpp @@ -65,7 +65,7 @@ namespace hpx::experimental { /// views are combined by invoking the copy of combiner, passing it /// the two views to be combined. /// - template + HPX_CXX_EXPORT template HPX_FORCEINLINE constexpr hpx::parallel::detail::reduction_helper> reduction_bit_xor(T& var) @@ -73,7 +73,7 @@ namespace hpx::experimental { return reduction(var, T(), std::bit_xor()); } - template + HPX_CXX_EXPORT template HPX_FORCEINLINE constexpr hpx::parallel::detail::reduction_helper> reduction_bit_xor(T& var, T const& identity) diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop_reduction_max.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop_reduction_max.hpp index 71db68ca814a..123fbf89a9ea 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop_reduction_max.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop_reduction_max.hpp @@ -63,7 +63,7 @@ namespace hpx::experimental { /// views are combined by invoking the copy of combiner, passing it /// the two views to be combined. /// - template + HPX_CXX_EXPORT template HPX_FORCEINLINE constexpr hpx::parallel::detail::reduction_helper> reduction_max(T& var) @@ -71,7 +71,7 @@ namespace hpx::experimental { return reduction(var, var, hpx::parallel::detail::max_of()); } - template + HPX_CXX_EXPORT template HPX_FORCEINLINE constexpr hpx::parallel::detail::reduction_helper> reduction_max(T& var, T const& identity) diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop_reduction_min.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop_reduction_min.hpp index c0a348637704..71be32bce3a2 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop_reduction_min.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop_reduction_min.hpp @@ -63,7 +63,7 @@ namespace hpx::experimental { /// views are combined by invoking the copy of combiner, passing it /// the two views to be combined. /// - template + HPX_CXX_EXPORT template HPX_FORCEINLINE constexpr hpx::parallel::detail::reduction_helper> reduction_min(T& var) @@ -71,7 +71,7 @@ namespace hpx::experimental { return reduction(var, var, hpx::parallel::detail::min_of()); } - template + HPX_CXX_EXPORT template HPX_FORCEINLINE constexpr hpx::parallel::detail::reduction_helper> reduction_min(T& var, T const& identity) diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop_reduction_multiplies.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop_reduction_multiplies.hpp index 1d5ad6888798..a61f95f1b8e3 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop_reduction_multiplies.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop_reduction_multiplies.hpp @@ -66,7 +66,7 @@ namespace hpx::experimental { /// views are combined by invoking the copy of combiner, passing it /// the two views to be combined. /// - template + HPX_CXX_EXPORT template HPX_FORCEINLINE constexpr hpx::parallel::detail::reduction_helper> reduction_multiplies(T& var) @@ -74,7 +74,7 @@ namespace hpx::experimental { return reduction(var, T(1), std::multiplies()); } - template + HPX_CXX_EXPORT template HPX_FORCEINLINE constexpr hpx::parallel::detail::reduction_helper> reduction_multiplies(T& var, T const& identity) diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop_reduction_plus.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop_reduction_plus.hpp index 7d404089711d..bde58932db5b 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop_reduction_plus.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/for_loop_reduction_plus.hpp @@ -65,7 +65,7 @@ namespace hpx::experimental { /// views are combined by invoking the copy of combiner, passing it /// the two views to be combined. /// - template + HPX_CXX_EXPORT template HPX_FORCEINLINE constexpr hpx::parallel::detail::reduction_helper> reduction_plus(T& var) @@ -73,7 +73,7 @@ namespace hpx::experimental { return reduction(var, T(), std::plus()); } - template + HPX_CXX_EXPORT template HPX_FORCEINLINE constexpr hpx::parallel::detail::reduction_helper> reduction_plus(T& var, T const& identity) diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/generate.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/generate.hpp index 3e436710dc1d..c0009be439af 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/generate.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/generate.hpp @@ -226,7 +226,7 @@ namespace hpx::parallel { // generate namespace detail { - template + HPX_CXX_EXPORT template struct generate : public algorithm, FwdIter> { constexpr generate() noexcept @@ -269,7 +269,7 @@ namespace hpx::parallel { // generate_n namespace detail { - template + HPX_CXX_EXPORT template struct generate_n : public algorithm, FwdIter> { constexpr generate_n() noexcept @@ -310,7 +310,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::generate - inline constexpr struct generate_t + HPX_CXX_EXPORT inline constexpr struct generate_t : hpx::detail::tag_parallel_algorithm { private: @@ -350,7 +350,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::generate_n - inline constexpr struct generate_n_t + HPX_CXX_EXPORT inline constexpr struct generate_n_t : hpx::detail::tag_parallel_algorithm { private: diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/includes.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/includes.hpp index 87927eefb836..a9ace6f023be 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/includes.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/includes.hpp @@ -181,7 +181,7 @@ namespace hpx::parallel { // includes namespace detail { - template constexpr bool sequential_includes(Iter1 first1, Sent1 last1, @@ -218,7 +218,7 @@ namespace hpx::parallel { return true; } - template constexpr bool sequential_includes(Iter1 first1, Sent1 last1, Iter2 first2, Sent2 last2, F&& f, Proj1&& proj1, Proj2&& proj2) @@ -249,7 +249,7 @@ namespace hpx::parallel { } /////////////////////////////////////////////////////////////////////// - struct includes : public algorithm + HPX_CXX_EXPORT struct includes : public algorithm { constexpr includes() noexcept : algorithm("includes") @@ -377,7 +377,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::includes - inline constexpr struct includes_t final + HPX_CXX_EXPORT inline constexpr struct includes_t final : hpx::detail::tag_parallel_algorithm { private: diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/inclusive_scan.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/inclusive_scan.hpp index e9f589c26cfe..6f0d40bd337e 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/inclusive_scan.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/inclusive_scan.hpp @@ -454,9 +454,9 @@ namespace hpx::parallel { /////////////////////////////////////////////////////////////////////// // Our own version of the sequential inclusive_scan. - template - static constexpr util::in_out_result + HPX_CXX_EXPORT template + constexpr util::in_out_result sequential_inclusive_scan( InIter first, Sent last, OutIter dest, T init, Op&& op) { @@ -468,8 +468,9 @@ namespace hpx::parallel { return util::in_out_result{first, dest}; } - template - static constexpr util::in_out_result + HPX_CXX_EXPORT template + constexpr util::in_out_result sequential_inclusive_scan_noinit( InIter first, Sent last, OutIter dest, Op&& op) { @@ -483,8 +484,9 @@ namespace hpx::parallel { return util::in_out_result{first, dest}; } - template - static constexpr T sequential_inclusive_scan_n( + HPX_CXX_EXPORT template + constexpr T sequential_inclusive_scan_n( InIter first, std::size_t count, OutIter dest, T init, Op&& op) { for (/* */; count-- != 0; (void) ++first, ++dest) @@ -496,7 +498,7 @@ namespace hpx::parallel { } /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct inclusive_scan : public algorithm, IterPair> { @@ -635,7 +637,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::inclusive_scan - inline constexpr struct inclusive_scan_t final + HPX_CXX_EXPORT inline constexpr struct inclusive_scan_t final : hpx::detail::tag_parallel_algorithm { template diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/is_heap.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/is_heap.hpp index 2fe1e36edf5b..a339cbaed927 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/is_heap.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/is_heap.hpp @@ -241,7 +241,8 @@ namespace hpx::parallel { namespace detail { // sequential is_heap with projection function - template + HPX_CXX_EXPORT template constexpr bool sequential_is_heap( Iter first, Sent last, Comp&& comp, Proj&& proj) { @@ -259,7 +260,7 @@ namespace hpx::parallel { return true; } - struct is_heap_helper + HPX_CXX_EXPORT struct is_heap_helper { template @@ -344,7 +345,7 @@ namespace hpx::parallel { } }; - template + HPX_CXX_EXPORT template struct is_heap : public algorithm, bool> { constexpr is_heap() noexcept @@ -377,7 +378,8 @@ namespace hpx::parallel { namespace detail { // sequential is_heap_until with projection function - template + HPX_CXX_EXPORT template constexpr Iter sequential_is_heap_until( Iter first, Sent last, Comp&& comp, Proj&& proj) { @@ -395,7 +397,7 @@ namespace hpx::parallel { return last; } - struct is_heap_until_helper + HPX_CXX_EXPORT struct is_heap_until_helper { template @@ -482,7 +484,7 @@ namespace hpx::parallel { } }; - template + HPX_CXX_EXPORT template struct is_heap_until : public algorithm, RandIter> { @@ -517,7 +519,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::is_heap - inline constexpr struct is_heap_t final + HPX_CXX_EXPORT inline constexpr struct is_heap_t final : hpx::detail::tag_parallel_algorithm { private: @@ -569,7 +571,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::is_heap_until - inline constexpr struct is_heap_until_t final + HPX_CXX_EXPORT inline constexpr struct is_heap_until_t final : hpx::detail::tag_parallel_algorithm { private: diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/is_partitioned.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/is_partitioned.hpp index efd133736d22..2a4a9a46c52c 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/is_partitioned.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/is_partitioned.hpp @@ -136,7 +136,7 @@ namespace hpx::parallel { namespace detail { /// \cond NOINTERNAL - template + HPX_CXX_EXPORT template inline bool sequential_is_partitioned(std::vector&& res) { auto first = res.begin(); @@ -158,7 +158,7 @@ namespace hpx::parallel { return true; } - template + HPX_CXX_EXPORT template struct is_partitioned : public algorithm, bool> { @@ -244,7 +244,7 @@ namespace hpx::parallel { namespace hpx { - inline constexpr struct is_partitioned_t final + HPX_CXX_EXPORT inline constexpr struct is_partitioned_t final : hpx::detail::tag_parallel_algorithm { private: diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/is_sorted.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/is_sorted.hpp index ab72eb9621d7..269ee85d527f 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/is_sorted.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/is_sorted.hpp @@ -254,7 +254,7 @@ namespace hpx::parallel { namespace detail { /// \cond NOINTERNAL - template + HPX_CXX_EXPORT template struct is_sorted : public algorithm, bool> { constexpr is_sorted() noexcept @@ -341,8 +341,9 @@ namespace hpx::parallel { //////////////////////////////////////////////////////////////////////////// // is_sorted_until namespace detail { + /// \cond NOINTERNAL - template + HPX_CXX_EXPORT template struct is_sorted_until : public algorithm, FwdIter> { @@ -451,7 +452,7 @@ namespace hpx::parallel { namespace hpx { - inline constexpr struct is_sorted_t final + HPX_CXX_EXPORT inline constexpr struct is_sorted_t final : hpx::detail::tag_parallel_algorithm { private: @@ -494,7 +495,7 @@ namespace hpx { } } is_sorted{}; - inline constexpr struct is_sorted_until_t final + HPX_CXX_EXPORT inline constexpr struct is_sorted_until_t final : hpx::detail::tag_parallel_algorithm { private: diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/lexicographical_compare.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/lexicographical_compare.hpp index 6f60b08e5507..cfded9c70c94 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/lexicographical_compare.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/lexicographical_compare.hpp @@ -189,7 +189,7 @@ namespace hpx::parallel { namespace detail { /// \cond NOINTERNAL - struct lexicographical_compare + HPX_CXX_EXPORT struct lexicographical_compare : public algorithm { constexpr lexicographical_compare() noexcept @@ -326,7 +326,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::lexicographical_compare - inline constexpr struct lexicographical_compare_t final + HPX_CXX_EXPORT inline constexpr struct lexicographical_compare_t final : hpx::detail::tag_parallel_algorithm { template + HPX_CXX_EXPORT template constexpr void sift_down(RndIter first, Comp&& comp, Proj&& proj, typename std::iterator_traits::difference_type len, RndIter start) @@ -282,7 +282,7 @@ namespace hpx::parallel { *start = top; } - template + HPX_CXX_EXPORT template constexpr void sift_down_range(RndIter first, Comp&& comp, Proj&& proj, typename std::iterator_traits::difference_type len, RndIter start, std::size_t count) @@ -293,7 +293,8 @@ namespace hpx::parallel { } } - template + HPX_CXX_EXPORT template constexpr Iter sequential_make_heap( Iter first, Sent last, Comp&& comp, Proj&& proj) { @@ -313,7 +314,7 @@ namespace hpx::parallel { } ////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct make_heap : public algorithm, Iter> { constexpr make_heap() noexcept @@ -549,7 +550,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::make_heap - inline constexpr struct make_heap_t final + HPX_CXX_EXPORT inline constexpr struct make_heap_t final : hpx::detail::tag_parallel_algorithm { private: diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/merge.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/merge.hpp index 550e9433ae93..221af7466daa 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/merge.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/merge.hpp @@ -320,9 +320,9 @@ namespace hpx::parallel { /// \cond NOINTERNAL /////////////////////////////////////////////////////////////////////// - struct lower_bound_helper; + HPX_CXX_EXPORT struct lower_bound_helper; - struct upper_bound_helper + HPX_CXX_EXPORT struct upper_bound_helper { template @@ -345,7 +345,7 @@ namespace hpx::parallel { using another_type = lower_bound_helper; }; - struct lower_bound_helper + HPX_CXX_EXPORT struct lower_bound_helper { template @@ -368,7 +368,7 @@ namespace hpx::parallel { using another_type = upper_bound_helper; }; - template + HPX_CXX_EXPORT template HPX_FORCEINLINE decltype(auto) init_value([[maybe_unused]] T&& val) { if constexpr (std::is_default_constructible_v>) @@ -382,7 +382,7 @@ namespace hpx::parallel { } // sequential merge helper with projection function. - template constexpr util::in_in_out_result @@ -447,7 +447,7 @@ namespace hpx::parallel { } // sequential merge helper without projection function. - template constexpr util::in_in_out_result sequential_merge_helper(Iter1 first1, Sent1 last1, Iter2 first2, @@ -540,7 +540,7 @@ namespace hpx::parallel { } // sequential merge with projection function. - template constexpr util::in_in_out_result @@ -596,7 +596,7 @@ namespace hpx::parallel { } // sequential merge without projection function. - template constexpr util::in_in_out_result sequential_merge(Iter1 start1, Sent1 sent1, Iter2 start2, Sent2 sent2, @@ -648,8 +648,8 @@ namespace hpx::parallel { } } - template + HPX_CXX_EXPORT template auto get_reshape_chunks(std::size_t len1, Iter2 first2, Iter2 last2, Comp&& comp, Proj1&& proj1, Proj2&& proj2, BinarySearchHelper) { @@ -749,9 +749,9 @@ namespace hpx::parallel { } /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template decltype(auto) parallel_merge(ExPolicy&& policy, Iter1 first1, Sent1 last1, Iter2 first2, Sent2 last2, Iter3 dest, Comp&& comp, Proj1&& proj1, Proj2&& proj2) @@ -803,7 +803,7 @@ namespace hpx::parallel { } /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct merge : public algorithm, IterTuple> { constexpr merge() noexcept @@ -860,7 +860,8 @@ namespace hpx::parallel { namespace detail { // sequential inplace_merge with projection function. - template + HPX_CXX_EXPORT template constexpr Iter sequential_inplace_merge( Iter first, Iter middle, Sent last, Comp&& comp, Proj&& proj) { @@ -871,8 +872,8 @@ namespace hpx::parallel { return last; } - template + HPX_CXX_EXPORT template void parallel_inplace_merge_helper(ExPolicy&& policy, Iter first, Iter middle, Sent last, Comp&& comp, Proj&& proj) { @@ -1003,8 +1004,8 @@ namespace hpx::parallel { } } - template + HPX_CXX_EXPORT template hpx::future parallel_inplace_merge(ExPolicy&& policy, Iter first, Iter middle, Sent last, Comp&& comp, Proj&& proj) { @@ -1027,7 +1028,7 @@ namespace hpx::parallel { }); } - template + HPX_CXX_EXPORT template struct inplace_merge : public algorithm, Result> { constexpr inplace_merge() noexcept @@ -1068,12 +1069,12 @@ namespace hpx::parallel { }; /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template constexpr void get_void_result(Iter) noexcept { } - template + HPX_CXX_EXPORT template hpx::future get_void_result(hpx::future&& f) noexcept { return hpx::future(HPX_MOVE(f)); @@ -1085,7 +1086,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::merge - inline constexpr struct merge_t final + HPX_CXX_EXPORT inline constexpr struct merge_t final : hpx::detail::tag_parallel_algorithm { private: @@ -1161,7 +1162,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::inplace_merge - inline constexpr struct inplace_merge_t final + HPX_CXX_EXPORT inline constexpr struct inplace_merge_t final : hpx::detail::tag_parallel_algorithm { private: diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/minmax.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/minmax.hpp index a089560ac12d..edbd915908df 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/minmax.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/minmax.hpp @@ -387,15 +387,16 @@ namespace hpx { namespace hpx::parallel { - template + HPX_CXX_EXPORT template using minmax_element_result = hpx::parallel::util::min_max_result; /////////////////////////////////////////////////////////////////////////// // min_element namespace detail { + /// \cond NOINTERNAL - template + HPX_CXX_EXPORT template constexpr FwdIter sequential_min_element(ExPolicy&&, FwdIter it, std::size_t count, F const& f, Proj const& proj) { @@ -422,7 +423,7 @@ namespace hpx::parallel { } /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct min_element : public algorithm, Iter> { // this has to be a member of the algorithm type as we access this @@ -539,7 +540,6 @@ namespace hpx::parallel { hpx::unwrapping(HPX_MOVE(f2))); } }; - /// \endcond } // namespace detail @@ -548,8 +548,8 @@ namespace hpx::parallel { namespace detail { /// \cond NOINTERNAL - template + HPX_CXX_EXPORT template constexpr FwdIter sequential_max_element(ExPolicy&&, FwdIter it, std::size_t count, F const& f, Proj const& proj) { @@ -576,7 +576,7 @@ namespace hpx::parallel { } /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct max_element : public algorithm, Iter> { // this has to be a member of the algorithm type as we access this @@ -692,7 +692,6 @@ namespace hpx::parallel { hpx::unwrapping(HPX_MOVE(f2))); } }; - /// \endcond } // namespace detail @@ -701,8 +700,8 @@ namespace hpx::parallel { namespace detail { /// \cond NOINTERNAL - template + HPX_CXX_EXPORT template minmax_element_result sequential_minmax_element(ExPolicy&&, FwdIter it, std::size_t count, F const& f, Proj const& proj) { @@ -735,7 +734,7 @@ namespace hpx::parallel { return result; } - template + HPX_CXX_EXPORT template struct minmax_element : public algorithm, minmax_element_result> { @@ -876,19 +875,18 @@ namespace hpx::parallel { HPX_MOVE(f1), hpx::unwrapping(HPX_MOVE(f2))); } }; - /// \endcond } // namespace detail } // namespace hpx::parallel namespace hpx { - template + HPX_CXX_EXPORT template using minmax_element_result = hpx::parallel::util::min_max_result; /////////////////////////////////////////////////////////////////////////// // CPO for hpx::min_element - inline constexpr struct min_element_t final + HPX_CXX_EXPORT inline constexpr struct min_element_t final : hpx::detail::tag_parallel_algorithm { template @@ -927,7 +925,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::max_element - inline constexpr struct max_element_t final + HPX_CXX_EXPORT inline constexpr struct max_element_t final : hpx::detail::tag_parallel_algorithm { template @@ -968,7 +966,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::minmax_element - inline constexpr struct minmax_element_t final + HPX_CXX_EXPORT inline constexpr struct minmax_element_t final : hpx::detail::tag_parallel_algorithm { template diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/mismatch.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/mismatch.hpp index 413baaa43b8d..9a4710a291ae 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/mismatch.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/mismatch.hpp @@ -564,12 +564,13 @@ namespace hpx { #include namespace hpx::parallel { + /////////////////////////////////////////////////////////////////////////// // mismatch (binary) namespace detail { /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct mismatch_binary : public algorithm, IterPair> { @@ -663,19 +664,15 @@ namespace hpx::parallel { }; /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template constexpr std::pair get_pair( util::in_in_result&& p) noexcept { return {HPX_MOVE(p.in1), HPX_MOVE(p.in2)}; } - template - // clang-format off - requires ( - hpx::execution::experimental::is_sender_v - ) - // clang-format on + HPX_CXX_EXPORT template + requires(hpx::execution::experimental::is_sender_v) decltype(auto) get_pair(InInSender&& in_in_sender) noexcept { return hpx::execution::experimental::then( @@ -685,7 +682,7 @@ namespace hpx::parallel { }); } - template + HPX_CXX_EXPORT template hpx::future> get_pair( hpx::future>&& f) noexcept { @@ -700,7 +697,7 @@ namespace hpx::parallel { // mismatch namespace detail { - template + HPX_CXX_EXPORT template struct mismatch : public algorithm, IterPair> { constexpr mismatch() noexcept @@ -793,7 +790,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::mismatch - inline constexpr struct mismatch_t final + HPX_CXX_EXPORT inline constexpr struct mismatch_t final : hpx::detail::tag_parallel_algorithm { private: diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/move.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/move.hpp index 5006361ac6b6..f38a1eadf133 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/move.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/move.hpp @@ -97,20 +97,19 @@ namespace hpx { template FwdIter2 move(FwdIter1 first, FwdIter1 last, FwdIter2 dest); - // clang-format off -} // namespace hpx + // clang-format on +} // namespace hpx -#else // DOXYGEN +#else // DOXYGEN #include -#include -#include -#include #include #include +#include #include #include #include +#include #include #include #include @@ -128,9 +127,8 @@ namespace hpx::parallel { namespace detail { /// \cond NOINTERNAL - template - struct move_pair - : public algorithm, IterPair> + HPX_CXX_EXPORT template + struct move_pair : public algorithm, IterPair> { move_pair() : algorithm("move") @@ -158,8 +156,7 @@ namespace hpx::parallel { } template - static decltype(auto) - parallel( + static decltype(auto) parallel( ExPolicy&& policy, FwdIter1 first, FwdIter1 last, FwdIter2 dest) { using zip_iterator = @@ -183,12 +180,13 @@ namespace hpx::parallel { }; /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct move; - template + HPX_CXX_EXPORT template struct move::value>> : public move_pair + HPX_CXX_EXPORT template struct move::value>> : public move_pair> { @@ -213,7 +211,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::move - inline constexpr struct move_t + HPX_CXX_EXPORT inline constexpr struct move_t : hpx::detail::tag_parallel_algorithm { private: diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/nth_element.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/nth_element.hpp index 08bac5fee3ed..5c89d8b707d3 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/nth_element.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/nth_element.hpp @@ -164,7 +164,7 @@ namespace hpx::parallel { /// /// \brief : The element placed in the nth position is exactly the /// element that would occur in this position if the range - /// was fully sorted. All of the elements before this new nth + /// was fully sorted. All the elements before this new nth /// element are less than or equal to the elements after the /// new nth element. /// @@ -175,8 +175,9 @@ namespace hpx::parallel { /// \param comp : object for to Compare elements /// \param proj : projection /// - template - static constexpr void nth_element_seq(RandomIt first, RandomIt nth, + HPX_CXX_EXPORT template + constexpr void nth_element_seq(RandomIt first, RandomIt nth, RandomIt end, std::uint32_t level, Compare&& comp, Proj&& proj) { constexpr std::uint32_t nmin_sort = 24; @@ -232,7 +233,7 @@ namespace hpx::parallel { } } - template + HPX_CXX_EXPORT template struct nth_element : public algorithm, Iter> { constexpr nth_element() noexcept @@ -350,7 +351,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::nth_element - inline constexpr struct nth_element_t final + HPX_CXX_EXPORT inline constexpr struct nth_element_t final : hpx::detail::tag_parallel_algorithm { template = 1ull << 32) @@ -193,7 +193,7 @@ namespace hpx::parallel { /// \param last iterator to the last element /// \param comp object to Comp two elements /// - template + HPX_CXX_EXPORT template constexpr void pivot3(Iter first, Iter last, Comp&& comp) noexcept { auto n2 = (last - first) / 2; @@ -217,7 +217,7 @@ namespace hpx::parallel { /// /// \return iterator where is the pivot used in the filtering /// - template + HPX_CXX_EXPORT template constexpr inline Iter filter(Iter first, Iter end, Comp&& comp) { std::int64_t const nelem = end - first; @@ -275,7 +275,7 @@ namespace hpx::parallel { // end : iterator to the element after the end in the range // level : level of depth from the top level call // comp : object for to Comp elements - template + HPX_CXX_EXPORT template constexpr void recursive_partial_sort( Iter first, Iter middle, Iter end, std::uint32_t level, Comp&& comp) { @@ -341,11 +341,12 @@ namespace hpx::parallel { // level : level of depth from the top level call // comp : object for to Comp elements // - template + HPX_CXX_EXPORT template hpx::future parallel_partial_sort(ExPolicy&& policy, Iter first, Iter middle, Iter last, std::uint32_t level, Comp&& comp = Comp()); - struct sort_thread_helper + HPX_CXX_EXPORT struct sort_thread_helper { template decltype(auto) operator()(Ts&&... ts) const @@ -354,7 +355,7 @@ namespace hpx::parallel { } }; - struct parallel_partial_sort_helper + HPX_CXX_EXPORT struct parallel_partial_sort_helper { template decltype(auto) operator()(Ts&&... ts) const @@ -363,7 +364,8 @@ namespace hpx::parallel { } }; - template + HPX_CXX_EXPORT template hpx::future parallel_partial_sort(ExPolicy&& policy, Iter first, Iter middle, Iter last, std::uint32_t level, Comp&& comp) { @@ -448,7 +450,7 @@ namespace hpx::parallel { /// \param end : iterator to the element after the end in the range /// \param comp : object for to Comp elements /// - template + HPX_CXX_EXPORT template Iter sequential_partial_sort(Iter first, Iter middle, Sent end, Comp&& comp) { std::int64_t const nelem = parallel::detail::distance(first, end); @@ -483,7 +485,8 @@ namespace hpx::parallel { /// \param end : iterator to the element after the end in the range /// \param comp : object for to Comp elements /// - template + HPX_CXX_EXPORT template hpx::future parallel_partial_sort( ExPolicy&& policy, Iter first, Iter middle, Sent end, Comp&& comp) { @@ -508,7 +511,7 @@ namespace hpx::parallel { /////////////////////////////////////////////////////////////////////// // partial_sort - template + HPX_CXX_EXPORT template struct partial_sort : public detail::algorithm, RandIter> { @@ -555,7 +558,7 @@ namespace hpx::parallel { namespace hpx { - inline constexpr struct partial_sort_t final + HPX_CXX_EXPORT inline constexpr struct partial_sort_t final : hpx::detail::tag_parallel_algorithm { private: diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/partial_sort_copy.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/partial_sort_copy.hpp index a34d2a999da1..059953dda5dc 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/partial_sort_copy.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/partial_sort_copy.hpp @@ -173,7 +173,7 @@ namespace hpx::parallel::detail { /////////////////////////////////////////////////////////////////////// // partial_sort_copy - template + HPX_CXX_EXPORT template struct partial_sort_copy : public algorithm, Iter> { constexpr partial_sort_copy() noexcept @@ -351,7 +351,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::partial_sort_copy - inline constexpr struct partial_sort_copy_t final + HPX_CXX_EXPORT inline constexpr struct partial_sort_copy_t final : hpx::detail::tag_parallel_algorithm { private: diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/partition.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/partition.hpp index 8a63945ce834..11ccd571af62 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/partition.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/partition.hpp @@ -496,7 +496,7 @@ namespace hpx { namespace hpx::parallel { - template + HPX_CXX_EXPORT template constexpr HPX_FORCEINLINE std::pair::type, typename hpx::tuple_element<2, Tuple>::type> @@ -508,7 +508,7 @@ namespace hpx::parallel { // NOLINTEND(bugprone-use-after-move) } - template + HPX_CXX_EXPORT template hpx::future::type, typename hpx::tuple_element<2, Tuple>::type>> tuple_to_pair(hpx::future&& f) @@ -528,7 +528,7 @@ namespace hpx::parallel { namespace detail { /// \cond NOINTERNAL - struct stable_partition_helper + HPX_CXX_EXPORT struct stable_partition_helper { template @@ -598,8 +598,9 @@ namespace hpx::parallel { } }; - template - static constexpr BidirIter stable_partition_seq( + HPX_CXX_EXPORT template + constexpr BidirIter stable_partition_seq( BidirIter first, Sent last, F&& f, Proj&& proj) { using value_type = @@ -626,7 +627,7 @@ namespace hpx::parallel { return next; } - template + HPX_CXX_EXPORT template struct stable_partition : public algorithm, Iter> { constexpr stable_partition() noexcept @@ -717,12 +718,9 @@ namespace hpx::parallel { /// \cond NOINTERNAL // sequential partition with projection function for bidirectional iterator. - template - // clang-format off - requires ( - hpx::traits::is_bidirectional_iterator_v - ) - // clang-format on + HPX_CXX_EXPORT template + requires(hpx::traits::is_bidirectional_iterator_v) constexpr BidirIter sequential_partition( BidirIter first, BidirIter last, Pred&& pred, Proj&& proj) { @@ -754,12 +752,9 @@ namespace hpx::parallel { } // sequential partition with projection function for forward iterator. - template - // clang-format off - requires (hpx::traits::is_forward_iterator_v && - !hpx::traits::is_bidirectional_iterator_v - ) - // clang-format on + HPX_CXX_EXPORT template + requires(hpx::traits::is_forward_iterator_v && + !hpx::traits::is_bidirectional_iterator_v) constexpr FwdIter sequential_partition( FwdIter first, FwdIter last, Pred&& pred, Proj&& proj) { @@ -784,7 +779,7 @@ namespace hpx::parallel { return first; } - struct partition_helper + HPX_CXX_EXPORT struct partition_helper { template struct block @@ -1186,12 +1181,8 @@ namespace hpx::parallel { // the left of boundary. template - // clang-format off - requires ( - hpx::traits::is_forward_iterator_v && - !hpx::traits::is_bidirectional_iterator_v - ) - // clang-format on + requires(hpx::traits::is_forward_iterator_v && + !hpx::traits::is_bidirectional_iterator_v) static block merge_leftside_remaining_blocks( std::vector>& remaining_blocks, FwdIter boundary, FwdIter first) @@ -1375,8 +1366,8 @@ namespace hpx::parallel { } }; - template + HPX_CXX_EXPORT template hpx::future parallel_partition(ExPolicy&& policy, FwdIter first, FwdIter last, Pred&& pred, Proj&& proj) { @@ -1397,7 +1388,7 @@ namespace hpx::parallel { }); } - template + HPX_CXX_EXPORT template struct partition : public algorithm, FwdIter> { constexpr partition() noexcept @@ -1448,8 +1439,8 @@ namespace hpx::parallel { /// \cond NOINTERNAL // sequential partition_copy with projection function - template + HPX_CXX_EXPORT template constexpr hpx::tuple sequential_partition_copy(InIter first, InIter last, OutIter1 dest_true, OutIter2 dest_false, Pred&& pred, Proj&& proj) @@ -1470,7 +1461,7 @@ namespace hpx::parallel { HPX_MOVE(last), HPX_MOVE(dest_true), HPX_MOVE(dest_false)); } - template + HPX_CXX_EXPORT template struct partition_copy : public algorithm, IterTuple> { @@ -1611,8 +1602,9 @@ namespace hpx::parallel { /// \endcond } // namespace detail - template + HPX_CXX_EXPORT template // clang-format off requires ( hpx::is_execution_policy_v && @@ -1656,7 +1648,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::stable_partition - inline constexpr struct stable_partition_t final + HPX_CXX_EXPORT inline constexpr struct stable_partition_t final : hpx::detail::tag_parallel_algorithm { template @@ -1704,7 +1696,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::partition - inline constexpr struct partition_t final + HPX_CXX_EXPORT inline constexpr struct partition_t final : hpx::detail::tag_parallel_algorithm { template @@ -1748,7 +1740,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::partition_copy - inline constexpr struct partition_copy_t final + HPX_CXX_EXPORT inline constexpr struct partition_copy_t final : hpx::detail::tag_parallel_algorithm { template + HPX_CXX_EXPORT template struct reduce : public algorithm, T> { constexpr reduce() noexcept @@ -443,7 +443,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::reduce - inline constexpr struct reduce_t final + HPX_CXX_EXPORT inline constexpr struct reduce_t final : hpx::detail::tag_parallel_algorithm { private: diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/reduce_by_key.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/reduce_by_key.hpp index e9a5f3a0eb03..6532af793cd9 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/reduce_by_key.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/reduce_by_key.hpp @@ -151,7 +151,7 @@ namespace hpx::parallel::detail { // ------------------------------------------------------------------- // simple iterator helper object for access to prev/next items // ------------------------------------------------------------------- - struct reduce_stencil_transformer + HPX_CXX_EXPORT struct reduce_stencil_transformer { // declare result type as a template template @@ -181,7 +181,7 @@ namespace hpx::parallel::detail { // ------------------------------------------------------------------- // transform iterator using reduce_stencil_transformer helper // ------------------------------------------------------------------- - template class reduce_stencil_iterator : public hpx::util::transform_iterator @@ -203,7 +203,7 @@ namespace hpx::parallel::detail { } }; - template + HPX_CXX_EXPORT template reduce_stencil_iterator make_reduce_stencil_iterator( Iterator const& it, Transformer const& t) { @@ -213,7 +213,7 @@ namespace hpx::parallel::detail { // ------------------------------------------------------------------- // state of a reduce by key step // ------------------------------------------------------------------- - struct reduce_key_series_states + HPX_CXX_EXPORT struct reduce_key_series_states { bool start; // START of a segment bool end; // END of a segment @@ -228,7 +228,7 @@ namespace hpx::parallel::detail { // ------------------------------------------------------------------- // callable that actually computes the state using the stencil iterator // ------------------------------------------------------------------- - template struct reduce_stencil_generate { @@ -267,7 +267,7 @@ namespace hpx::parallel::detail { // ------------------------------------------------------------------- // Zip iterator has 3 iterators inside // Iter1, key type : Iter2, value type : Iter3, state type - template + HPX_CXX_EXPORT template constexpr util::in_out_result make_pair_result( ZIter zipiter, iKey key_start, iVal val_start) { @@ -279,7 +279,7 @@ namespace hpx::parallel::detail { } // async version that returns future from future> - template + HPX_CXX_EXPORT template hpx::future> make_pair_result( hpx::future&& ziter, iKey key_start, iVal val_start) { @@ -300,9 +300,10 @@ namespace hpx::parallel::detail { // internal algorithms. Async execution is handled by the wrapper layer that // calls this. // ------------------------------------------------------------------- - template - static util::in_out_result reduce_by_key_impl( + HPX_CXX_EXPORT template + util::in_out_result reduce_by_key_impl( ExPolicy&& policy, RanIter key_first, RanIter key_last, RanIter2 values_first, FwdIter1 keys_output, FwdIter2 values_output, Compare&& comp, Func&& func) @@ -449,7 +450,7 @@ namespace hpx::parallel::detail { /////////////////////////////////////////////////////////////////////// // reduce_by_key wrapper struct - template + HPX_CXX_EXPORT template struct reduce_by_key : public algorithm, util::in_out_result> @@ -506,8 +507,8 @@ namespace hpx::experimental { } #endif - template , typename Func = std::plus<>> // clang-format off requires ( diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/reduce_deterministic.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/reduce_deterministic.hpp index 4eaee728180f..a4ec7dbf36e1 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/reduce_deterministic.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/reduce_deterministic.hpp @@ -383,7 +383,7 @@ namespace hpx::parallel { namespace detail { /// \cond NOINTERNAL - template + HPX_CXX_EXPORT template struct reduce_deterministic : public algorithm, T> { @@ -430,7 +430,7 @@ namespace hpx::parallel { -> hpx::parallel::detail::rfa:: reproducible_floating_accumulator { T_ val = *part_begin; - // Assumed that hpx_rfa_bin_host_buffer is initiallized + // Assumed that hpx_rfa_bin_host_buffer is initialized return hpx::parallel::detail:: sequential_reduce_deterministic_rfa( HPX_FORWARD(ExPolicy, policy), ++part_begin, @@ -444,7 +444,7 @@ namespace hpx::parallel { call(HPX_FORWARD(ExPolicy, policy), first, detail::distance(first, last), HPX_MOVE(f1), hpx::unwrapping([policy, init](auto&& results) -> T_ { - // Assumed that hpx_rfa_bin_host_buffer is initiallized + // Assumed that hpx_rfa_bin_host_buffer is initialized hpx::parallel::detail::rfa:: reproducible_floating_accumulator rfa; @@ -468,7 +468,7 @@ namespace hpx::experimental { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::reduce - inline constexpr struct reduce_deterministic_t final + HPX_CXX_EXPORT inline constexpr struct reduce_deterministic_t final : hpx::detail::tag_parallel_algorithm { private: diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/remove.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/remove.hpp index cf1976e8e1e0..ea9f6a29de50 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/remove.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/remove.hpp @@ -247,7 +247,8 @@ namespace hpx::parallel { namespace detail { /// \cond NOINTERNAL - template + HPX_CXX_EXPORT template constexpr Iter sequential_remove_if( Iter first, Sent last, Pred pred, Proj proj) { @@ -265,7 +266,7 @@ namespace hpx::parallel { return first; } - template + HPX_CXX_EXPORT template struct remove_if : public algorithm, FwdIter> { constexpr remove_if() noexcept @@ -373,7 +374,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::remove_if - inline constexpr struct remove_if_t final + HPX_CXX_EXPORT inline constexpr struct remove_if_t final : hpx::detail::tag_parallel_algorithm { template @@ -420,7 +421,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::remove - inline constexpr struct remove_t final + HPX_CXX_EXPORT inline constexpr struct remove_t final : hpx::detail::tag_parallel_algorithm { private: diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/remove_copy.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/remove_copy.hpp index 8516ba6f2b14..cfccd03297b1 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/remove_copy.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/remove_copy.hpp @@ -285,8 +285,8 @@ namespace hpx::parallel { /// \cond NOINTERNAL // sequential remove_copy - template + HPX_CXX_EXPORT template constexpr util::in_out_result sequential_remove_copy( InIter first, Sent last, OutIter dest, T const& value, Proj&& proj) { @@ -300,7 +300,7 @@ namespace hpx::parallel { return util::in_out_result{first, dest}; } - template + HPX_CXX_EXPORT template struct remove_copy : public algorithm, IterPair> { constexpr remove_copy() noexcept @@ -340,8 +340,8 @@ namespace hpx::parallel { /// \cond NOINTERNAL // sequential remove_copy_if - template + HPX_CXX_EXPORT template constexpr util::in_out_result sequential_remove_copy_if( InIter first, Sent last, OutIter dest, F p, Proj&& proj) @@ -356,7 +356,7 @@ namespace hpx::parallel { return util::in_out_result{first, dest}; } - template + HPX_CXX_EXPORT template struct remove_copy_if : public algorithm, IterPair> { @@ -401,7 +401,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::remove_copy_if - inline constexpr struct remove_copy_if_t final + HPX_CXX_EXPORT inline constexpr struct remove_copy_if_t final : hpx::detail::tag_parallel_algorithm { template @@ -465,7 +465,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::remove_copy - inline constexpr struct remove_copy_t final + HPX_CXX_EXPORT inline constexpr struct remove_copy_t final : hpx::detail::tag_parallel_algorithm { private: diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/replace.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/replace.hpp index 4bfb3562e7a3..585f359becaa 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/replace.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/replace.hpp @@ -495,7 +495,7 @@ namespace hpx::parallel { namespace detail { /// \cond NOINTERNAL - template + HPX_CXX_EXPORT template struct replace : public algorithm, Iter> { constexpr replace() noexcept @@ -533,7 +533,7 @@ namespace hpx::parallel { namespace detail { /// \cond NOINTERNAL - template + HPX_CXX_EXPORT template struct replace_if : public algorithm, Iter> { constexpr replace_if() noexcept @@ -570,7 +570,7 @@ namespace hpx::parallel { namespace detail { /// \cond NOINTERNAL - template + HPX_CXX_EXPORT template struct replace_copy : public algorithm, IterPair> { constexpr replace_copy() noexcept @@ -610,7 +610,7 @@ namespace hpx::parallel { namespace detail { /// \cond NOINTERNAL - template + HPX_CXX_EXPORT template struct replace_copy_if : public algorithm, IterPair> { @@ -649,7 +649,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::replace_if - inline constexpr struct replace_if_t final + HPX_CXX_EXPORT inline constexpr struct replace_if_t final : hpx::detail::tag_parallel_algorithm { private: @@ -701,7 +701,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::replace - inline constexpr struct replace_t final + HPX_CXX_EXPORT inline constexpr struct replace_t final : hpx::detail::tag_parallel_algorithm { private: @@ -750,7 +750,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::replace_copy_if - inline constexpr struct replace_copy_if_t final + HPX_CXX_EXPORT inline constexpr struct replace_copy_if_t final : hpx::detail::tag_parallel_algorithm { private: @@ -814,7 +814,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::replace_copy - inline constexpr struct replace_copy_t final + HPX_CXX_EXPORT inline constexpr struct replace_copy_t final : hpx::detail::tag_parallel_algorithm { private: diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/reverse.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/reverse.hpp index c20f4ce0636e..4d43d881c31d 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/reverse.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/reverse.hpp @@ -209,7 +209,7 @@ namespace hpx::parallel { namespace detail { /// \cond NOINTERNAL - template + HPX_CXX_EXPORT template struct reverse : public algorithm, Iter> { constexpr reverse() noexcept @@ -270,7 +270,8 @@ namespace hpx::parallel { /// \cond NOINTERNAL // sequential reverse_copy - template + HPX_CXX_EXPORT template constexpr util::in_out_result sequential_reverse_copy( BidirIt first, Sent last, OutIter dest) { @@ -325,7 +326,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::reverse - inline constexpr struct reverse_t final + HPX_CXX_EXPORT inline constexpr struct reverse_t final : hpx::detail::tag_parallel_algorithm { private: @@ -366,7 +367,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::reverse_copy - inline constexpr struct reverse_copy_t final + HPX_CXX_EXPORT inline constexpr struct reverse_copy_t final : hpx::detail::tag_parallel_algorithm { private: diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/rotate.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/rotate.hpp index c2f8e7de19de..b52034de14ee 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/rotate.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/rotate.hpp @@ -213,7 +213,8 @@ namespace hpx::parallel { namespace detail { /// \cond NOINTERNAL - template + HPX_CXX_EXPORT template decltype(auto) rotate_helper( ExPolicy policy, FwdIter first, FwdIter new_first, Sent last) { @@ -318,7 +319,7 @@ namespace hpx::parallel { } } - template + HPX_CXX_EXPORT template struct rotate : algorithm, IterPair> { constexpr rotate() noexcept @@ -351,7 +352,8 @@ namespace hpx::parallel { /// \cond NOINTERNAL // sequential rotate_copy - template + HPX_CXX_EXPORT template constexpr util::in_out_result sequential_rotate_copy( InIter first, InIter new_first, Sent last, OutIter dest_first) { @@ -363,8 +365,8 @@ namespace hpx::parallel { HPX_MOVE(p1.in), HPX_MOVE(p2.out)}; } - template + HPX_CXX_EXPORT template decltype(auto) rotate_copy_helper(ExPolicy policy, FwdIter1 first, FwdIter1 new_first, Sent last, FwdIter2 dest_first) { @@ -404,7 +406,7 @@ namespace hpx::parallel { } } - template + HPX_CXX_EXPORT template struct rotate_copy : algorithm, IterPair> { constexpr rotate_copy() noexcept @@ -440,7 +442,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::rotate - inline constexpr struct rotate_t final + HPX_CXX_EXPORT inline constexpr struct rotate_t final : hpx::detail::tag_parallel_algorithm { template @@ -488,7 +490,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::rotate_copy - inline constexpr struct rotate_copy_t final + HPX_CXX_EXPORT inline constexpr struct rotate_copy_t final : hpx::detail::tag_parallel_algorithm { template diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/search.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/search.hpp index 815516e8cbee..cb83c7e13557 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/search.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/search.hpp @@ -304,7 +304,7 @@ namespace hpx { namespace hpx { - inline constexpr struct search_t final + HPX_CXX_EXPORT inline constexpr struct search_t final : hpx::detail::tag_parallel_algorithm { private: @@ -351,7 +351,7 @@ namespace hpx { } } search{}; - inline constexpr struct search_n_t final + HPX_CXX_EXPORT inline constexpr struct search_n_t final : hpx::detail::tag_parallel_algorithm { private: diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/set_difference.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/set_difference.hpp index 110afb44d0c8..87de37f74d4c 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/set_difference.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/set_difference.hpp @@ -198,11 +198,12 @@ namespace hpx { #include namespace hpx::parallel { + /////////////////////////////////////////////////////////////////////////// // set_difference namespace detail { - template constexpr util::in_out_result sequential_set_difference( @@ -236,7 +237,7 @@ namespace hpx::parallel { } /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct set_difference : public algorithm, Result> { constexpr set_difference() noexcept @@ -323,7 +324,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::set_difference - inline constexpr struct set_difference_t final + HPX_CXX_EXPORT inline constexpr struct set_difference_t final : hpx::detail::tag_parallel_algorithm { private: diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/set_intersection.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/set_intersection.hpp index ce2bd5a6aab3..f3b99589be81 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/set_intersection.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/set_intersection.hpp @@ -204,7 +204,7 @@ namespace hpx::parallel { // set_intersection namespace detail { - template constexpr parallel::util::in_in_out_result @@ -233,7 +233,7 @@ namespace hpx::parallel { } /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct set_intersection : public algorithm, Result> { @@ -307,7 +307,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::set_intersection - inline constexpr struct set_intersection_t final + HPX_CXX_EXPORT inline constexpr struct set_intersection_t final : hpx::detail::tag_parallel_algorithm { private: diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/set_symmetric_difference.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/set_symmetric_difference.hpp index 8e9880a4ca02..e26cae63913a 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/set_symmetric_difference.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/set_symmetric_difference.hpp @@ -210,11 +210,12 @@ namespace hpx { #include namespace hpx::parallel { + /////////////////////////////////////////////////////////////////////////// // set_symmetric_difference namespace detail { - template constexpr util::in_in_out_result @@ -256,7 +257,7 @@ namespace hpx::parallel { } /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct set_symmetric_difference : public algorithm, Result> { @@ -342,7 +343,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::set_symmetric_difference - inline constexpr struct set_symmetric_difference_t final + HPX_CXX_EXPORT inline constexpr struct set_symmetric_difference_t final : hpx::detail::tag_parallel_algorithm { private: diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/set_union.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/set_union.hpp index e568aa51af73..4d89cfc6556f 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/set_union.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/set_union.hpp @@ -200,11 +200,12 @@ namespace hpx { #include namespace hpx::parallel { + /////////////////////////////////////////////////////////////////////////// // set_union namespace detail { - template constexpr util::in_in_out_result @@ -242,7 +243,7 @@ namespace hpx::parallel { } /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct set_union : public algorithm, Result> { constexpr set_union() noexcept @@ -329,7 +330,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::set_union - inline constexpr struct set_union_t final + HPX_CXX_EXPORT inline constexpr struct set_union_t final : hpx::detail::tag_parallel_algorithm { private: diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/shift_left.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/shift_left.hpp index 11e879b4af04..88e7e180b388 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/shift_left.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/shift_left.hpp @@ -130,7 +130,8 @@ namespace hpx::parallel { // shift_left namespace detail { - template + HPX_CXX_EXPORT template hpx::future shift_left_helper( ExPolicy policy, FwdIter first, Sent last, FwdIter new_first) { @@ -159,8 +160,8 @@ namespace hpx::parallel { // Sequential shift_left implementation inspired from // https://github.com/danra/shift_proposal - template - static constexpr FwdIter sequential_shift_left( + HPX_CXX_EXPORT template + constexpr FwdIter sequential_shift_left( FwdIter first, Sent last, Size n, std::size_t dist) { auto mid = std::next(first, n); @@ -177,7 +178,7 @@ namespace hpx::parallel { } } - template + HPX_CXX_EXPORT template struct shift_left : public algorithm, FwdIter2> { constexpr shift_left() noexcept @@ -226,7 +227,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::shift_left - inline constexpr struct shift_left_t final + HPX_CXX_EXPORT inline constexpr struct shift_left_t final : hpx::functional::detail::tag_fallback { private: diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/shift_right.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/shift_right.hpp index 0597e1662461..42730d86ca6f 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/shift_right.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/shift_right.hpp @@ -127,11 +127,13 @@ namespace hpx { #include namespace hpx::parallel { + /////////////////////////////////////////////////////////////////////////// // shift_right namespace detail { - template + HPX_CXX_EXPORT template hpx::future shift_right_helper( ExPolicy policy, FwdIter first, Sent last, FwdIter new_first) { @@ -159,23 +161,23 @@ namespace hpx::parallel { // Sequential shift_right implementation borrowed from // https://github.com/danra/shift_proposal - template + HPX_CXX_EXPORT template using difference_type_t = typename std::iterator_traits::difference_type; - template + HPX_CXX_EXPORT template using iterator_category_t = typename std::iterator_traits::iterator_category; - template + HPX_CXX_EXPORT template inline constexpr bool is_category = false; - template + HPX_CXX_EXPORT template inline constexpr bool is_category, Tag>>> = true; - template + HPX_CXX_EXPORT template constexpr FwdIter sequential_shift_right(FwdIter first, FwdIter last, difference_type_t n, std::size_t dist) { @@ -218,7 +220,7 @@ namespace hpx::parallel { } } - template + HPX_CXX_EXPORT template struct shift_right : public algorithm, FwdIter2> { constexpr shift_right() noexcept @@ -269,7 +271,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::shift_right - inline constexpr struct shift_right_t final + HPX_CXX_EXPORT inline constexpr struct shift_right_t final : hpx::functional::detail::tag_fallback { private: diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/sort.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/sort.hpp index fe99742c88b7..8ee75fcc74f9 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/sort.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/sort.hpp @@ -182,11 +182,13 @@ namespace hpx::parallel { namespace detail { /// \cond NOINTERNAL - inline constexpr std::size_t sort_limit_per_task = 65536ul; + HPX_CXX_EXPORT inline constexpr std::size_t sort_limit_per_task = + 65536ul; // \brief this function is the work assigned to each thread in the // parallel process - template + HPX_CXX_EXPORT template hpx::future sort_thread(ExPolicy&& policy, RandomIt first, RandomIt last, Comp comp, std::size_t chunk_size) { @@ -277,7 +279,8 @@ namespace hpx::parallel { // [in] first iterator to the first element to sort // [in] last iterator to the next element after the last // [in] comp object for to Comp - template + HPX_CXX_EXPORT template hpx::future parallel_sort_async( ExPolicy&& policy, RandomIt first, RandomIt last, Comp&& comp) { @@ -329,7 +332,7 @@ namespace hpx::parallel { /////////////////////////////////////////////////////////////////////// // sort - template + HPX_CXX_EXPORT template struct sort : public algorithm, RandomIt> { constexpr sort() noexcept @@ -382,7 +385,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::sort - inline constexpr struct sort_t final + HPX_CXX_EXPORT inline constexpr struct sort_t final : hpx::detail::tag_parallel_algorithm { template + HPX_CXX_EXPORT template using sort_by_key_result = std::pair; /////////////////////////////////////////////////////////////////////////// @@ -116,7 +116,7 @@ namespace hpx::parallel { namespace detail { /// \cond NOINTERNAL - struct extract_key + HPX_CXX_EXPORT struct extract_key { template auto operator()(Tuple&& t) const @@ -131,11 +131,11 @@ namespace hpx::parallel { namespace hpx::experimental { - template + HPX_CXX_EXPORT template using sort_by_key_result = std::pair; - template + HPX_CXX_EXPORT template hpx::parallel::util::detail::algorithm_result_t> sort_by_key(ExPolicy&& policy, KeyIter key_first, KeyIter key_last, diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/stable_sort.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/stable_sort.hpp index b7b261a83535..82a24473fdd4 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/stable_sort.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/stable_sort.hpp @@ -181,7 +181,7 @@ namespace hpx::parallel { /////////////////////////////////////////////////////////////////////// // stable_sort - template + HPX_CXX_EXPORT template struct stable_sort : public algorithm, RandomIt> { constexpr stable_sort() noexcept @@ -269,7 +269,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::stable_sort - inline constexpr struct stable_sort_t final + HPX_CXX_EXPORT inline constexpr struct stable_sort_t final : hpx::detail::tag_parallel_algorithm { template + + HPX_CXX_EXPORT template constexpr bool get_starts_with_result( util::in_in_result&& p, Sent2 last2) { return p.in2 == last2; } - template + HPX_CXX_EXPORT template hpx::future get_starts_with_result( hpx::future>&& f, Sent2 last2) @@ -189,7 +192,7 @@ namespace hpx::parallel { }); } - struct starts_with : public algorithm + HPX_CXX_EXPORT struct starts_with : public algorithm { constexpr starts_with() noexcept : algorithm("starts_with") @@ -262,7 +265,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::starts_with - inline constexpr struct starts_with_t final + HPX_CXX_EXPORT inline constexpr struct starts_with_t final : hpx::detail::tag_parallel_algorithm { private: diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/swap_ranges.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/swap_ranges.hpp index aeffb9548530..c5603181b1e8 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/swap_ranges.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/swap_ranges.hpp @@ -127,15 +127,15 @@ namespace hpx { namespace hpx::parallel { - template + HPX_CXX_EXPORT template using swap_ranges_result = hpx::parallel::util::in_in_result; /////////////////////////////////////////////////////////////////////////// // swap ranges namespace detail { - template + HPX_CXX_EXPORT template decltype(auto) parallel_swap_ranges( ExPolicy&& policy, FwdIter1 first1, FwdIter2 first2, Size n) { diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/transform.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/transform.hpp index 713bdc1110d9..bde6ef074cf5 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/transform.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/transform.hpp @@ -308,7 +308,7 @@ namespace hpx::parallel { namespace detail { /// \cond NOINTERNAL - template + HPX_CXX_EXPORT template struct transform_projected { std::decay_t f_; @@ -330,7 +330,7 @@ namespace hpx::parallel { } }; - template + HPX_CXX_EXPORT template struct transform_projected { std::decay_t f_{}; @@ -350,7 +350,7 @@ namespace hpx::parallel { } }; - template + HPX_CXX_EXPORT template struct transform_iteration { using execution_policy_type = std::decay_t; @@ -404,7 +404,7 @@ namespace hpx::parallel { } }; - template + HPX_CXX_EXPORT template struct transform_iteration { using execution_policy_type = std::decay_t; @@ -453,7 +453,7 @@ namespace hpx::parallel { }; /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct transform : public algorithm, IterPair> { constexpr transform() noexcept @@ -527,7 +527,7 @@ namespace hpx::parallel { namespace detail { /// \cond NOINTERNAL - template + HPX_CXX_EXPORT template struct transform_binary_projected { std::decay_t f_; @@ -552,7 +552,8 @@ namespace hpx::parallel { } }; - template + HPX_CXX_EXPORT template struct transform_binary_iteration { using execution_policy_type = std::decay_t; @@ -620,7 +621,7 @@ namespace hpx::parallel { } }; - template + HPX_CXX_EXPORT template struct transform_binary_iteration { @@ -678,7 +679,7 @@ namespace hpx::parallel { }; /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct transform_binary : public algorithm, IterTuple> { @@ -758,7 +759,7 @@ namespace hpx::parallel { namespace detail { /// \cond NOINTERNAL - template + HPX_CXX_EXPORT template struct transform_binary2 : public algorithm, IterTuple> { @@ -841,7 +842,7 @@ namespace hpx::parallel { #if defined(HPX_HAVE_THREAD_DESCRIPTION) namespace hpx::traits { - template + HPX_CXX_EXPORT template struct get_function_address< parallel::detail::transform_iteration> { @@ -853,7 +854,7 @@ namespace hpx::traits { } }; - template + HPX_CXX_EXPORT template struct get_function_annotation< parallel::detail::transform_iteration> { @@ -865,7 +866,8 @@ namespace hpx::traits { } }; - template + HPX_CXX_EXPORT template struct get_function_address< parallel::detail::transform_binary_iteration> { @@ -877,7 +879,8 @@ namespace hpx::traits { } }; - template + HPX_CXX_EXPORT template struct get_function_annotation< parallel::detail::transform_binary_iteration> { @@ -890,7 +893,7 @@ namespace hpx::traits { }; #if HPX_HAVE_ITTNOTIFY != 0 && !defined(HPX_HAVE_APEX) - template + HPX_CXX_EXPORT template struct get_function_annotation_itt< parallel::detail::transform_iteration> { @@ -902,7 +905,8 @@ namespace hpx::traits { } }; - template + HPX_CXX_EXPORT template struct get_function_annotation_itt< parallel::detail::transform_binary_iteration> { @@ -922,7 +926,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::transform - inline constexpr struct transform_t final + HPX_CXX_EXPORT inline constexpr struct transform_t final : hpx::detail::tag_parallel_algorithm { private: diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/transform_exclusive_scan.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/transform_exclusive_scan.hpp index 1bdf8ed49d21..73f933d6f69e 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/transform_exclusive_scan.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/transform_exclusive_scan.hpp @@ -206,9 +206,9 @@ namespace hpx::parallel { /// \cond NOINTERNAL // Our own version of the sequential transform_exclusive_scan. - template - static constexpr util::in_out_result + HPX_CXX_EXPORT template + constexpr util::in_out_result sequential_transform_exclusive_scan( InIter first, Sent last, OutIter dest, Conv&& conv, T init, Op&& op) { @@ -222,9 +222,9 @@ namespace hpx::parallel { return util::in_out_result{first, dest}; } - template - static constexpr T sequential_transform_exclusive_scan_n(InIter first, + HPX_CXX_EXPORT template + constexpr T sequential_transform_exclusive_scan_n(InIter first, std::size_t count, OutIter dest, Conv&& conv, T init, Op&& op) { T temp = init; @@ -238,7 +238,7 @@ namespace hpx::parallel { } /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct transform_exclusive_scan : public algorithm, IterPair> { @@ -339,7 +339,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::transform_exclusive_scan - inline constexpr struct transform_exclusive_scan_t final + HPX_CXX_EXPORT inline constexpr struct transform_exclusive_scan_t final : hpx::detail::tag_parallel_algorithm { template - static constexpr util::in_out_result + HPX_CXX_EXPORT template + constexpr util::in_out_result sequential_transform_inclusive_scan( InIter first, Sent last, OutIter dest, Conv&& conv, T init, Op&& op) { @@ -348,9 +348,9 @@ namespace hpx::parallel { return util::in_out_result{first, dest}; } - template - static constexpr util::in_out_result + HPX_CXX_EXPORT template + constexpr util::in_out_result sequential_transform_inclusive_scan_noinit( InIter first, Sent last, OutIter dest, Conv&& conv, Op&& op) { @@ -366,9 +366,9 @@ namespace hpx::parallel { return util::in_out_result{first, dest}; } - template - static constexpr T sequential_transform_inclusive_scan_n(InIter first, + HPX_CXX_EXPORT template + constexpr T sequential_transform_inclusive_scan_n(InIter first, std::size_t count, OutIter dest, Conv&& conv, T init, Op&& op) { for (/**/; count-- != 0; (void) ++first, ++dest) @@ -380,7 +380,7 @@ namespace hpx::parallel { } /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct transform_inclusive_scan : public algorithm, IterPair> { @@ -513,7 +513,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::transform_inclusive_scan - inline constexpr struct transform_inclusive_scan_t final + HPX_CXX_EXPORT inline constexpr struct transform_inclusive_scan_t final : hpx::detail::tag_parallel_algorithm { template + HPX_CXX_EXPORT template struct transform_reduce : public algorithm, T> { constexpr transform_reduce() noexcept @@ -509,7 +509,7 @@ namespace hpx::parallel { // transform_reduce_binary namespace detail { - template + HPX_CXX_EXPORT template struct transform_reduce_binary : public algorithm, T> { @@ -592,7 +592,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::transform_reduce - inline constexpr struct transform_reduce_t final + HPX_CXX_EXPORT inline constexpr struct transform_reduce_t final : hpx::detail::tag_parallel_algorithm { private: diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/uninitialized_copy.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/uninitialized_copy.hpp index a1204addd8d7..d567d1c2bc75 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/uninitialized_copy.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/uninitialized_copy.hpp @@ -227,8 +227,8 @@ namespace hpx::parallel { /// \cond NOINTERNAL /////////////////////////////////////////////////////////////////////// - - template + HPX_CXX_EXPORT template decltype(auto) parallel_uninitialized_copy_n( ExPolicy&& policy, Iter first, std::size_t count, FwdIter2 dest) { @@ -287,7 +287,7 @@ namespace hpx::parallel { } /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct uninitialized_copy : public algorithm, IterPair> { @@ -324,7 +324,7 @@ namespace hpx::parallel { namespace detail { /// \cond NOINTERNAL - template + HPX_CXX_EXPORT template struct uninitialized_copy_sent : public algorithm, IterPair> { @@ -369,7 +369,7 @@ namespace hpx::parallel { namespace detail { /// \cond NOINTERNAL - template + HPX_CXX_EXPORT template struct uninitialized_copy_n : public algorithm, IterPair> { @@ -406,7 +406,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::uninitialized_copy - inline constexpr struct uninitialized_copy_t final + HPX_CXX_EXPORT inline constexpr struct uninitialized_copy_t final : hpx::detail::tag_parallel_algorithm { template @@ -455,7 +455,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::uninitialized_copy_n - inline constexpr struct uninitialized_copy_n_t final + HPX_CXX_EXPORT inline constexpr struct uninitialized_copy_n_t final : hpx::detail::tag_parallel_algorithm { template diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/uninitialized_default_construct.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/uninitialized_default_construct.hpp index 00c795866130..b44d5704c2bf 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/uninitialized_default_construct.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/uninitialized_default_construct.hpp @@ -195,7 +195,8 @@ namespace hpx::parallel { /// \cond NOINTERNAL /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template Iter sequential_uninitialized_default_construct( ExPolicy&& policy, Iter first, Sent last) { @@ -207,7 +208,7 @@ namespace hpx::parallel { [](Iter it) -> void { std::destroy_at(std::addressof(*it)); }); } - template + HPX_CXX_EXPORT template InIter sequential_uninitialized_default_construct_n( ExPolicy&& policy, InIter first, std::size_t count) { @@ -225,7 +226,7 @@ namespace hpx::parallel { } /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template decltype(auto) parallel_uninitialized_default_construct_n( ExPolicy&& policy, FwdIter first, std::size_t count) { @@ -273,7 +274,7 @@ namespace hpx::parallel { }); } /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct uninitialized_default_construct : public algorithm, FwdIter> { @@ -308,7 +309,7 @@ namespace hpx::parallel { namespace detail { /// \cond NOINTERNAL - template + HPX_CXX_EXPORT template struct uninitialized_default_construct_n : public algorithm, FwdIter> @@ -343,7 +344,8 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::uninitialized_default_construct - inline constexpr struct uninitialized_default_construct_t final + HPX_CXX_EXPORT inline constexpr struct uninitialized_default_construct_t + final : hpx::detail::tag_parallel_algorithm { template @@ -387,12 +389,12 @@ namespace hpx { FwdIter>() .call(HPX_FORWARD(ExPolicy, policy), first, last); } - } uninitialized_default_construct{}; /////////////////////////////////////////////////////////////////////////// // CPO for hpx::uninitialized_default_construct_n - inline constexpr struct uninitialized_default_construct_n_t final + HPX_CXX_EXPORT inline constexpr struct uninitialized_default_construct_n_t + final : hpx::detail::tag_parallel_algorithm { template diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/uninitialized_fill.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/uninitialized_fill.hpp index f28da3046113..65e71f6f1c11 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/uninitialized_fill.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/uninitialized_fill.hpp @@ -196,7 +196,8 @@ namespace hpx::parallel { // provide our own implementation of std::uninitialized_fill as some // versions of MSVC horribly fail at compiling it for some types T - template + HPX_CXX_EXPORT template InIter sequential_uninitialized_fill( ExPolicy&& policy, InIter first, Sent last, T const& value) { @@ -210,7 +211,7 @@ namespace hpx::parallel { }); } - template + HPX_CXX_EXPORT template InIter sequential_uninitialized_fill_n( ExPolicy&& policy, InIter first, std::size_t count, T const& value) { @@ -225,7 +226,7 @@ namespace hpx::parallel { } /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template decltype(auto) parallel_uninitialized_fill_n( ExPolicy&& policy, Iter first, std::size_t count, T const& value) { @@ -275,7 +276,7 @@ namespace hpx::parallel { } /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct uninitialized_fill : public algorithm, Iter> { @@ -319,8 +320,9 @@ namespace hpx::parallel { ///////////////////////////////////////////////////////////////////////////// // uninitialized_fill_n namespace detail { + /// \cond NOINTERNAL - template + HPX_CXX_EXPORT template struct uninitialized_fill_n : public algorithm, Iter> { @@ -353,7 +355,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::uninitialized_fill - inline constexpr struct uninitialized_fill_t final + HPX_CXX_EXPORT inline constexpr struct uninitialized_fill_t final : hpx::detail::tag_parallel_algorithm { template @@ -398,7 +400,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::uninitialized_fill_n - inline constexpr struct uninitialized_fill_n_t final + HPX_CXX_EXPORT inline constexpr struct uninitialized_fill_n_t final : hpx::detail::tag_parallel_algorithm { template diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/uninitialized_move.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/uninitialized_move.hpp index 2b80a2c49a93..f5f85ad6af14 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/uninitialized_move.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/uninitialized_move.hpp @@ -225,9 +225,10 @@ namespace hpx::parallel { /////////////////////////////////////////////////////////////////////////// // uninitialized_move namespace detail { + /// \cond NOINTERNAL /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template util::in_out_result sequential_uninitialized_move_n( InIter1 first, std::size_t count, InIter2 dest) { @@ -244,11 +245,12 @@ namespace hpx::parallel { } /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template decltype(auto) parallel_uninitialized_move_n( ExPolicy&& policy, Iter first, std::size_t count, FwdIter2 dest) { - const bool has_scheduler_executor = + bool const has_scheduler_executor = hpx::execution_policy_has_scheduler_executor_v; if constexpr (!has_scheduler_executor) @@ -303,7 +305,7 @@ namespace hpx::parallel { } /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct uninitialized_move : public algorithm, IterPair> { @@ -340,7 +342,7 @@ namespace hpx::parallel { namespace detail { /// \cond NOINTERNAL - template + HPX_CXX_EXPORT template struct uninitialized_move_sent : public algorithm, IterPair> { @@ -383,8 +385,9 @@ namespace hpx::parallel { ///////////////////////////////////////////////////////////////////////////// // uninitialized_move_n namespace detail { + /// \cond NOINTERNAL - template + HPX_CXX_EXPORT template struct uninitialized_move_n : public algorithm, IterPair> { @@ -418,7 +421,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::uninitialized_move - inline constexpr struct uninitialized_move_t final + HPX_CXX_EXPORT inline constexpr struct uninitialized_move_t final : hpx::detail::tag_parallel_algorithm { template @@ -467,7 +470,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::uninitialized_move_n - inline constexpr struct uninitialized_move_n_t final + HPX_CXX_EXPORT inline constexpr struct uninitialized_move_n_t final : hpx::detail::tag_parallel_algorithm { template diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/uninitialized_relocate.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/uninitialized_relocate.hpp index b85f1d3f4e0e..352f1defc3ea 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/uninitialized_relocate.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/uninitialized_relocate.hpp @@ -414,14 +414,11 @@ namespace hpx::parallel { /// \cond NOINTERNAL /////////////////////////////////////////////////////////////////////// - - template - // clang-format off + HPX_CXX_EXPORT template requires(hpx::traits::is_input_iterator_v && hpx::traits::is_forward_iterator_v && std::is_integral_v) - // clang-format on decltype(auto) parallel_uninitialized_relocate_n( ExPolicy&& policy, InIter first, Size count, FwdIter dest) { @@ -485,7 +482,7 @@ namespace hpx::parallel { // uninitialized_relocate_n /// \cond NOINTERNAL - template + HPX_CXX_EXPORT template struct uninitialized_relocate_n : public algorithm, IterPair> { @@ -540,7 +537,7 @@ namespace hpx::parallel { ///////////////////////////////////////////////////////////////////////////// // uninitialized_relocate /// \cond NOINTERNAL - template + HPX_CXX_EXPORT template struct uninitialized_relocate : public algorithm, IterPair> { @@ -600,7 +597,7 @@ namespace hpx::parallel { ///////////////////////////////////////////////////////////////////////////// // uninitialized_relocate_backward /// \cond NOINTERNAL - template + HPX_CXX_EXPORT template struct uninitialized_relocate_backward : public algorithm, IterPair> @@ -655,7 +652,6 @@ namespace hpx::parallel { } }; /// \endcond - } // namespace detail } // namespace hpx::parallel @@ -663,7 +659,7 @@ namespace hpx::experimental { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::uninitialized_relocate_n - inline constexpr struct uninitialized_relocate_n_t final + HPX_CXX_EXPORT inline constexpr struct uninitialized_relocate_n_t final : hpx::detail::tag_parallel_algorithm { template @@ -810,7 +806,7 @@ namespace hpx::experimental { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::uninitialized_relocate - inline constexpr struct uninitialized_relocate_t final + HPX_CXX_EXPORT inline constexpr struct uninitialized_relocate_t final : hpx::detail::tag_parallel_algorithm { template @@ -956,7 +952,8 @@ namespace hpx::experimental { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::uninitialized_relocate_backward - inline constexpr struct uninitialized_relocate_backward_t final + HPX_CXX_EXPORT inline constexpr struct uninitialized_relocate_backward_t + final : hpx::detail::tag_parallel_algorithm { template @@ -1099,4 +1096,5 @@ namespace hpx::experimental { } } uninitialized_relocate_backward{}; } // namespace hpx::experimental + #endif // DOXYGEN diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/uninitialized_value_construct.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/uninitialized_value_construct.hpp index 8945932bd5f4..0d8f6d433918 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/uninitialized_value_construct.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/uninitialized_value_construct.hpp @@ -193,7 +193,8 @@ namespace hpx::parallel { // provide our own implementation of std::uninitialized_value_construct // as some versions of MSVC horribly fail at compiling it for some types // T - template + HPX_CXX_EXPORT template InIter sequential_uninitialized_value_construct( ExPolicy&& policy, InIter first, Sent last) { @@ -208,7 +209,7 @@ namespace hpx::parallel { } /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template InIter sequential_uninitialized_value_construct_n( ExPolicy&& policy, InIter first, std::size_t count) { @@ -223,7 +224,7 @@ namespace hpx::parallel { } /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template decltype(auto) parallel_uninitialized_value_construct_n( ExPolicy&& policy, FwdIter first, std::size_t count) { @@ -272,7 +273,7 @@ namespace hpx::parallel { } /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct uninitialized_value_construct : public algorithm, FwdIter> { @@ -304,8 +305,9 @@ namespace hpx::parallel { /////////////////////////////////////////////////////////////////////////// // uninitialized_value_construct_n namespace detail { + /// \cond NOINTERNAL - template + HPX_CXX_EXPORT template struct uninitialized_value_construct_n : public algorithm, FwdIter> { @@ -339,7 +341,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::uninitialized_value_construct - inline constexpr struct uninitialized_value_construct_t final + HPX_CXX_EXPORT inline constexpr struct uninitialized_value_construct_t final : hpx::detail::tag_parallel_algorithm { template @@ -381,12 +383,12 @@ namespace hpx { FwdIter>() .call(HPX_FORWARD(ExPolicy, policy), first, last); } - } uninitialized_value_construct{}; /////////////////////////////////////////////////////////////////////////// // CPO for hpx::uninitialized_value_construct_n - inline constexpr struct uninitialized_value_construct_n_t final + HPX_CXX_EXPORT inline constexpr struct uninitialized_value_construct_n_t + final : hpx::detail::tag_parallel_algorithm { template @@ -451,7 +453,6 @@ namespace hpx { .call(HPX_FORWARD(ExPolicy, policy), first, static_cast(count)); } - } uninitialized_value_construct_n{}; } // namespace hpx diff --git a/libs/core/algorithms/include/hpx/parallel/algorithms/unique.hpp b/libs/core/algorithms/include/hpx/parallel/algorithms/unique.hpp index 8c4c9d9f6336..b1544368255a 100644 --- a/libs/core/algorithms/include/hpx/parallel/algorithms/unique.hpp +++ b/libs/core/algorithms/include/hpx/parallel/algorithms/unique.hpp @@ -335,7 +335,8 @@ namespace hpx::parallel { /// \cond NOINTERNAL // sequential unique with projection function - template + HPX_CXX_EXPORT template constexpr FwdIter sequential_unique( FwdIter first, Sent last, Pred&& pred, Proj&& proj) { @@ -362,7 +363,7 @@ namespace hpx::parallel { return ++result; } - template + HPX_CXX_EXPORT template struct unique : public algorithm, Iter> { constexpr unique() noexcept @@ -492,8 +493,8 @@ namespace hpx::parallel { /// \cond NOINTERNAL // sequential unique_copy with projection function - template + HPX_CXX_EXPORT template constexpr unique_copy_result sequential_unique_copy( FwdIter first, Sent last, OutIter dest, Pred&& pred, Proj&& proj, std::true_type) @@ -525,8 +526,8 @@ namespace hpx::parallel { } // sequential unique_copy with projection function - template + HPX_CXX_EXPORT template constexpr unique_copy_result sequential_unique_copy( InIter first, Sent last, OutIter dest, Pred&& pred, Proj&& proj, std::false_type) @@ -555,7 +556,7 @@ namespace hpx::parallel { HPX_MOVE(first), HPX_MOVE(dest)}; } - template + HPX_CXX_EXPORT template struct unique_copy : public algorithm, IterPair> { constexpr unique_copy() noexcept @@ -692,7 +693,7 @@ namespace hpx { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::unique - inline constexpr struct unique_t final + HPX_CXX_EXPORT inline constexpr struct unique_t final : hpx::detail::tag_parallel_algorithm { template { template { private: diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/adjacent_find.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/adjacent_find.hpp index 4ce6d9023ff7..05adf0153d6c 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/adjacent_find.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/adjacent_find.hpp @@ -275,7 +275,7 @@ namespace hpx { namespace ranges { namespace hpx::ranges { - inline constexpr struct adjacent_find_t final + HPX_CXX_EXPORT inline constexpr struct adjacent_find_t final : hpx::detail::tag_parallel_algorithm { private: diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/all_any_none.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/all_any_none.hpp index 127d2b58bf0c..7c6665b588a8 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/all_any_none.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/all_any_none.hpp @@ -722,7 +722,7 @@ namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::none_of - inline constexpr struct none_of_t final + HPX_CXX_EXPORT inline constexpr struct none_of_t final : hpx::detail::tag_parallel_algorithm { private: @@ -762,8 +762,8 @@ namespace hpx::ranges { hpx::parallel::traits::is_projected_v && hpx::parallel::traits::is_indirect_callable_v - > - ) + > + ) // clang-format on friend hpx::parallel::util::detail::algorithm_result_t tag_fallback_invoke(none_of_t, ExPolicy&& policy, Iter first, Sent last, @@ -827,7 +827,7 @@ namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::any_of - inline constexpr struct any_of_t final + HPX_CXX_EXPORT inline constexpr struct any_of_t final : hpx::detail::tag_parallel_algorithm { private: @@ -838,7 +838,9 @@ namespace hpx::ranges { hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && hpx::parallel::traits::is_indirect_callable_v>) + hpx::parallel::traits::projected_range + > + ) // clang-format on friend hpx::parallel::util::detail::algorithm_result_t tag_fallback_invoke( @@ -929,7 +931,7 @@ namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::all_of - inline constexpr struct all_of_t final + HPX_CXX_EXPORT inline constexpr struct all_of_t final : hpx::detail::tag_parallel_algorithm { private: diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/contains.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/contains.hpp index 9b886b48fcb7..17e58204dda4 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/contains.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/contains.hpp @@ -26,8 +26,9 @@ #include #include -namespace hpx::parallel { namespace detail { - struct contains : public algorithm +namespace hpx::parallel::detail { + + HPX_CXX_EXPORT struct contains : public algorithm { constexpr contains() noexcept : algorithm("contains") @@ -80,10 +81,11 @@ namespace hpx::parallel { namespace detail { } }; - template + HPX_CXX_EXPORT template struct contains_subrange_helper; - template + HPX_CXX_EXPORT template struct contains_subrange_helper>> { @@ -93,7 +95,7 @@ namespace hpx::parallel { namespace detail { } }; - template + HPX_CXX_EXPORT template struct contains_subrange_helper>> { @@ -104,7 +106,8 @@ namespace hpx::parallel { namespace detail { } }; - struct contains_subrange : public algorithm + HPX_CXX_EXPORT struct contains_subrange + : public algorithm { constexpr contains_subrange() noexcept : algorithm("contains_subrange") @@ -141,12 +144,11 @@ namespace hpx::parallel { namespace detail { itr, last1); } }; - -}} // namespace hpx::parallel::detail +} // namespace hpx::parallel::detail namespace hpx::ranges { - inline constexpr struct contains_t final + HPX_CXX_EXPORT inline constexpr struct contains_t final : hpx::functional::detail::tag_fallback { private: @@ -156,8 +158,8 @@ namespace hpx::ranges { requires(hpx::traits::is_iterator_v && hpx::traits::is_iterator_v && hpx::is_invocable_v::value_type>) - + typename std::iterator_traits::value_type> + ) // clang-format on friend bool tag_fallback_invoke(hpx::ranges::contains_t, Iterator first, Sentinel last, const T& val, Proj&& proj = Proj()) @@ -177,8 +179,7 @@ namespace hpx::ranges { requires ( hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v - ) - + ) // clang-format on friend bool tag_fallback_invoke( hpx::ranges::contains_t, Rng&& rng, const T& t, Proj proj = Proj()) @@ -196,8 +197,7 @@ namespace hpx::ranges { is_iterator_v && hpx::is_invocable_v::value_type> - ) - + ) // clang-format on friend typename parallel::util::detail::algorithm_result::type @@ -222,8 +222,7 @@ namespace hpx::ranges { hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v - ) - + ) // clang-format on friend typename parallel::util::detail::algorithm_result::type @@ -234,10 +233,9 @@ namespace hpx::ranges { HPX_FORWARD(ExPolicy, policy), hpx::util::begin(rng), hpx::util::end(rng), t, HPX_MOVE(proj)); } - } contains{}; - inline constexpr struct contains_subrange_t final + HPX_CXX_EXPORT inline constexpr struct contains_subrange_t final : hpx::functional::detail::tag_fallback { private: @@ -257,8 +255,7 @@ namespace hpx::ranges { typename std::iterator_traits::value_type> && hpx::is_invocable_v::value_type> - ) - + ) // clang-format on friend bool tag_fallback_invoke(hpx::ranges::contains_subrange_t, FwdIter1 first1, Sent1 last1, FwdIter2 first2, Sent2 last2, @@ -281,7 +278,7 @@ namespace hpx::ranges { typename Pred = hpx::ranges::equal_to, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && hpx::traits::is_range_v && @@ -290,9 +287,8 @@ namespace hpx::ranges { hpx::execution::sequenced_policy, Pred, hpx::parallel::traits::projected_range, hpx::parallel::traits::projected_range - > - ) - + > + ) // clang-format on friend bool tag_fallback_invoke(hpx::ranges::contains_subrange_t, Rng1&& rng1, Rng2&& rng2, Pred pred = Pred(), Proj1 proj1 = Proj1(), @@ -319,8 +315,7 @@ namespace hpx::ranges { hpx::is_invocable_v::value_type, typename std::iterator_traits::value_type> - ) - + ) // clang-format on friend typename parallel::util::detail::algorithm_result::type @@ -353,9 +348,8 @@ namespace hpx::ranges { hpx::parallel::traits::is_indirect_callable_v, hpx::parallel::traits::projected_range - > - ) - + > + ) // clang-format on friend typename parallel::util::detail::algorithm_result::type @@ -369,6 +363,5 @@ namespace hpx::ranges { hpx::util::end(rng2), HPX_MOVE(pred), HPX_MOVE(proj1), HPX_MOVE(proj2)); } - } contains_subrange{}; } // namespace hpx::ranges diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/copy.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/copy.hpp index 7381d6b8a30e..c71b08a626d3 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/copy.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/copy.hpp @@ -526,18 +526,18 @@ namespace hpx { namespace ranges { namespace hpx::ranges { - template + HPX_CXX_EXPORT template using copy_result = parallel::util::in_out_result; - template + HPX_CXX_EXPORT template using copy_n_result = parallel::util::in_out_result; - template + HPX_CXX_EXPORT template using copy_if_result = parallel::util::in_out_result; /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::copy - inline constexpr struct copy_t final + HPX_CXX_EXPORT inline constexpr struct copy_t final : hpx::detail::tag_parallel_algorithm { private: @@ -628,7 +628,7 @@ namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::copy_n - inline constexpr struct copy_n_t final + HPX_CXX_EXPORT inline constexpr struct copy_n_t final : hpx::detail::tag_parallel_algorithm { private: @@ -698,7 +698,7 @@ namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::copy_if - inline constexpr struct copy_if_t final + HPX_CXX_EXPORT inline constexpr struct copy_if_t final : hpx::detail::tag_parallel_algorithm { private: diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/count.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/count.hpp index ef077b6a8af7..1b9fea215be1 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/count.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/count.hpp @@ -455,7 +455,7 @@ namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::count - inline constexpr struct count_t final + HPX_CXX_EXPORT inline constexpr struct count_t final : hpx::detail::tag_parallel_algorithm { private: @@ -569,7 +569,7 @@ namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::count_if - inline constexpr struct count_if_t final + HPX_CXX_EXPORT inline constexpr struct count_if_t final : hpx::detail::tag_parallel_algorithm { private: diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/destroy.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/destroy.hpp index 9a02cb5259e0..3560008a2ade 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/destroy.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/destroy.hpp @@ -224,13 +224,13 @@ namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::destroy - inline constexpr struct destroy_t final + HPX_CXX_EXPORT inline constexpr struct destroy_t final : hpx::detail::tag_parallel_algorithm { private: template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v ) @@ -251,7 +251,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_sentinel_for_v ) @@ -295,13 +295,13 @@ namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::destroy_n - inline constexpr struct destroy_n_t final + HPX_CXX_EXPORT inline constexpr struct destroy_n_t final : hpx::detail::tag_parallel_algorithm { private: template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_iterator_v && std::is_integral_v @@ -329,7 +329,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && std::is_integral_v ) diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/ends_with.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/ends_with.hpp index aa9f779cd712..27c3c6d8ccfa 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/ends_with.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/ends_with.hpp @@ -296,7 +296,7 @@ namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::copy - inline constexpr struct ends_with_t final + HPX_CXX_EXPORT inline constexpr struct ends_with_t final : hpx::functional::detail::tag_fallback { private: diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/equal.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/equal.hpp index 8f69ce3b3db0..a61ebbc9a545 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/equal.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/equal.hpp @@ -371,7 +371,7 @@ namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::equal - inline constexpr struct equal_t final + HPX_CXX_EXPORT inline constexpr struct equal_t final : hpx::detail::tag_parallel_algorithm { private: @@ -379,7 +379,7 @@ namespace hpx::ranges { typename Iter2, typename Sent2, typename Pred = equal_to, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_sentinel_for_v && hpx::traits::is_sentinel_for_v && @@ -408,7 +408,7 @@ namespace hpx::ranges { typename Pred = equal_to, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::parallel::traits::is_projected_range_v && hpx::parallel::traits::is_projected_range_v && @@ -445,7 +445,7 @@ namespace hpx::ranges { typename Sent2, typename Pred = equal_to, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::traits::is_sentinel_for_v && hpx::traits::is_sentinel_for_v && hpx::parallel::traits::is_indirect_callable_v< @@ -472,7 +472,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::parallel::traits::is_projected_range_v && hpx::parallel::traits::is_projected_range_v && hpx::parallel::traits::is_indirect_callable_v< diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/exclusive_scan.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/exclusive_scan.hpp index 6f0c1ee85ce7..5047577f83b2 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/exclusive_scan.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/exclusive_scan.hpp @@ -343,10 +343,10 @@ namespace hpx { namespace ranges { namespace hpx::ranges { - template + HPX_CXX_EXPORT template using exclusive_scan_result = parallel::util::in_out_result; - inline constexpr struct exclusive_scan_t final + HPX_CXX_EXPORT inline constexpr struct exclusive_scan_t final : hpx::detail::tag_parallel_algorithm { private: @@ -354,14 +354,14 @@ namespace hpx::ranges { typename T = typename std::iterator_traits::value_type, typename Op = std::plus<>> // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && hpx::traits::is_iterator_v && hpx::is_invocable_v::value_type, typename std::iterator_traits::value_type> - ) + ) // clang-format on friend exclusive_scan_result tag_fallback_invoke( hpx::ranges::exclusive_scan_t, InIter first, Sent last, @@ -384,7 +384,7 @@ namespace hpx::ranges { typename T = typename std::iterator_traits::value_type, typename Op = std::plus<>> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && @@ -417,7 +417,7 @@ namespace hpx::ranges { hpx::traits::range_iterator_t>::value_type, typename Op = std::plus<>> // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::is_invocable_v::value_type, @@ -446,7 +446,7 @@ namespace hpx::ranges { hpx::traits::range_iterator_t>::value_type, typename Op = std::plus<>> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::is_invocable_v { private: @@ -310,7 +310,7 @@ namespace hpx::ranges { typename T = typename std::iterator_traits< hpx::traits::range_iterator_t>::value_type> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v ) @@ -334,7 +334,7 @@ namespace hpx::ranges { template ::value_type> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_sentinel_for_v ) @@ -353,11 +353,7 @@ namespace hpx::ranges { template >::value_type> - // clang-format off - requires ( - hpx::traits::is_range_v - ) - // clang-format on + requires(hpx::traits::is_range_v) friend hpx::traits::range_iterator_t tag_fallback_invoke( fill_t, Rng&& rng, T const& value) { @@ -374,11 +370,7 @@ namespace hpx::ranges { template ::value_type> - // clang-format off - requires ( - hpx::traits::is_sentinel_for_v - ) - // clang-format on + requires(hpx::traits::is_sentinel_for_v) friend Iter tag_fallback_invoke( fill_t, Iter first, Sent last, T const& value) { @@ -392,7 +384,7 @@ namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::fill_n - inline constexpr struct fill_n_t final + HPX_CXX_EXPORT inline constexpr struct fill_n_t final : hpx::detail::tag_parallel_algorithm { private: @@ -400,7 +392,7 @@ namespace hpx::ranges { typename T = typename std::iterator_traits< hpx::traits::range_iterator_t>::value_type> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v ) @@ -432,7 +424,7 @@ namespace hpx::ranges { template ::value_type> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_iterator_v && std::is_integral_v @@ -461,11 +453,7 @@ namespace hpx::ranges { template >::value_type> - // clang-format off - requires ( - hpx::traits::is_range_v - ) - // clang-format on + requires(hpx::traits::is_range_v) friend typename hpx::traits::range_traits::iterator_type tag_fallback_invoke(fill_n_t, Rng&& rng, T const& value) { @@ -488,10 +476,8 @@ namespace hpx::ranges { template ::value_type> - // clang-format off requires( hpx::traits::is_iterator_v && std::is_integral_v) - // clang-format on friend FwdIter tag_fallback_invoke( fill_n_t, FwdIter first, Size count, T const& value) { diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/find.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/find.hpp index 7d7664ed15b6..50e4ba72bf1a 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/find.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/find.hpp @@ -1410,7 +1410,7 @@ namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::find - inline constexpr struct find_t final + HPX_CXX_EXPORT inline constexpr struct find_t final : hpx::detail::tag_parallel_algorithm { private: @@ -1419,7 +1419,7 @@ namespace hpx::ranges { typename T = typename hpx::parallel::traits::projected::value_type> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_sentinel_for_v && hpx::parallel::traits::is_projected_v @@ -1442,7 +1442,7 @@ namespace hpx::ranges { typename T = typename hpx::parallel::traits::projected< hpx::traits::range_iterator_t, Proj>::value_type> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v @@ -1467,7 +1467,7 @@ namespace hpx::ranges { typename T = typename hpx::parallel::traits::projected::value_type> // clang-format off - requires ( + requires( hpx::traits::is_sentinel_for_v && hpx::parallel::traits::is_projected_v ) @@ -1486,7 +1486,7 @@ namespace hpx::ranges { typename T = typename hpx::parallel::traits::projected< hpx::traits::range_iterator_t, Proj>::value_type> // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v ) @@ -1507,14 +1507,14 @@ namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::find_if - inline constexpr struct find_if_t final + HPX_CXX_EXPORT inline constexpr struct find_if_t final : hpx::detail::tag_parallel_algorithm { private: template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_sentinel_for_v && hpx::parallel::traits::is_projected_v && @@ -1539,7 +1539,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && @@ -1568,7 +1568,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_sentinel_for_v && hpx::parallel::traits::is_projected_v && hpx::is_invocable_v - requires(hpx::traits::is_range_v && + // clang-format off + requires( + hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && hpx::is_invocable_v>::value_type>) + hpx::traits::range_iterator_t + >::value_type> + ) // clang-format on friend hpx::traits::range_iterator_t tag_fallback_invoke( find_if_t, Rng&& rng, Pred pred, Proj proj = Proj()) @@ -1610,14 +1614,14 @@ namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::find_if_not - inline constexpr struct find_if_not_t final + HPX_CXX_EXPORT inline constexpr struct find_if_not_t final : hpx::detail::tag_parallel_algorithm { private: template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_sentinel_for_v && hpx::parallel::traits::is_projected_v && @@ -1641,7 +1645,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && @@ -1670,7 +1674,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_sentinel_for_v && hpx::parallel::traits::is_projected_v && hpx::is_invocable_v // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && hpx::is_invocable_v { private: @@ -1725,7 +1729,7 @@ namespace hpx::ranges { typename Pred = equal_to, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::parallel::traits::is_projected_range_v && hpx::parallel::traits::is_projected_range_v && @@ -1760,7 +1764,7 @@ namespace hpx::ranges { typename Iter2, typename Sent2, typename Pred = equal_to, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_sentinel_for_v && hpx::traits::is_sentinel_for_v && @@ -1788,7 +1792,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::parallel::traits::is_projected_range_v && hpx::parallel::traits::is_projected_range_v && hpx::parallel::traits::is_indirect_callable_v< @@ -1821,7 +1825,7 @@ namespace hpx::ranges { typename Sent2, typename Pred = equal_to, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::traits::is_sentinel_for_v && hpx::traits::is_sentinel_for_v && hpx::parallel::traits::is_indirect_callable_v< @@ -1848,7 +1852,7 @@ namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::find_first_of - inline constexpr struct find_first_of_t final + HPX_CXX_EXPORT inline constexpr struct find_first_of_t final : hpx::detail::tag_parallel_algorithm { private: @@ -1856,7 +1860,7 @@ namespace hpx::ranges { typename Pred = equal_to, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::parallel::traits::is_projected_range_v && hpx::parallel::traits::is_projected_range_v && @@ -1891,7 +1895,7 @@ namespace hpx::ranges { typename Iter2, typename Sent2, typename Pred = equal_to, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_sentinel_for_v && hpx::traits::is_sentinel_for_v && @@ -1919,7 +1923,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::parallel::traits::is_projected_range_v && hpx::parallel::traits::is_projected_range_v && hpx::parallel::traits::is_indirect_callable_v< @@ -1952,7 +1956,7 @@ namespace hpx::ranges { typename Sent2, typename Pred = equal_to, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::traits::is_sentinel_for_v && hpx::traits::is_sentinel_for_v && hpx::parallel::traits::is_indirect_callable_v< diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/for_each.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/for_each.hpp index 06a2636fd668..82ae086ee0a1 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/for_each.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/for_each.hpp @@ -426,21 +426,21 @@ namespace hpx { namespace ranges { namespace hpx::ranges { - template + HPX_CXX_EXPORT template using for_each_result = in_fun_result; - template + HPX_CXX_EXPORT template using for_each_n_result = in_fun_result; /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::for_each - inline constexpr struct for_each_t final + HPX_CXX_EXPORT inline constexpr struct for_each_t final : hpx::detail::tag_parallel_algorithm { template // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && hpx::parallel::traits::is_projected_v && @@ -464,7 +464,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && hpx::parallel::traits::is_indirect_callable_v< @@ -492,7 +492,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && @@ -518,7 +518,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && @@ -545,13 +545,13 @@ namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::for_each_n - inline constexpr struct for_each_n_t final + HPX_CXX_EXPORT inline constexpr struct for_each_n_t final : hpx::detail::tag_parallel_algorithm { template // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && std::is_integral_v && hpx::parallel::traits::is_projected_v && @@ -582,7 +582,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_iterator_v && std::is_integral_v && diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/for_loop.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/for_loop.hpp index 062e729061f7..9923d1cde57d 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/for_loop.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/for_loop.hpp @@ -739,14 +739,14 @@ namespace hpx { namespace ranges { namespace experimental { namespace hpx::ranges::experimental { - inline constexpr struct for_loop_t final + HPX_CXX_EXPORT inline constexpr struct for_loop_t final : hpx::detail::tag_parallel_algorithm { private: template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v @@ -768,7 +768,7 @@ namespace hpx::ranges::experimental { template // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v ) @@ -787,10 +787,10 @@ namespace hpx::ranges::experimental { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && (hpx::traits::is_range_v || - hpx::traits::is_range_generator_v) + hpx::traits::is_range_generator_v) ) // clang-format on friend hpx::parallel::util::detail::algorithm_result_t @@ -820,7 +820,7 @@ namespace hpx::ranges::experimental { template // clang-format off - requires ( + requires( hpx::traits::is_range_v || hpx::traits::is_range_generator_v ) @@ -849,14 +849,14 @@ namespace hpx::ranges::experimental { } } for_loop{}; - inline constexpr struct for_loop_strided_t final + HPX_CXX_EXPORT inline constexpr struct for_loop_strided_t final : hpx::detail::tag_parallel_algorithm { private: template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && std::is_integral_v && hpx::traits::is_iterator_v && @@ -880,7 +880,7 @@ namespace hpx::ranges::experimental { template // clang-format off - requires ( + requires( std::is_integral_v && hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v @@ -902,7 +902,7 @@ namespace hpx::ranges::experimental { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && std::is_integral_v && hpx::traits::is_range_v @@ -926,7 +926,7 @@ namespace hpx::ranges::experimental { template // clang-format off - requires ( + requires( std::is_integral_v && hpx::traits::is_range_v ) diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/generate.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/generate.hpp index f25bd042fde1..d71d66f8bdd2 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/generate.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/generate.hpp @@ -301,13 +301,13 @@ namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::generate - inline constexpr struct generate_t final + HPX_CXX_EXPORT inline constexpr struct generate_t final : hpx::detail::tag_parallel_algorithm { private: template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v ) @@ -328,7 +328,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_sentinel_for_v ) @@ -345,11 +345,7 @@ namespace hpx::ranges { } template - // clang-format off - requires ( - hpx::traits::is_range_v - ) - // clang-format on + requires(hpx::traits::is_range_v) friend hpx::traits::range_iterator_t tag_fallback_invoke( generate_t, Rng&& rng, F f) { @@ -364,11 +360,7 @@ namespace hpx::ranges { } template - // clang-format off - requires ( - hpx::traits::is_sentinel_for_v - ) - // clang-format on + requires(hpx::traits::is_sentinel_for_v) friend Iter tag_fallback_invoke(generate_t, Iter first, Sent last, F f) { static_assert(hpx::traits::is_forward_iterator_v, @@ -381,14 +373,14 @@ namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::generate_n - inline constexpr struct generate_n_t final + HPX_CXX_EXPORT inline constexpr struct generate_n_t final : hpx::detail::tag_parallel_algorithm { private: template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_iterator_v && std::is_integral_v @@ -415,7 +407,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && std::is_integral_v ) diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/includes.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/includes.hpp index f6962f3dd2cd..da7eca9d6bee 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/includes.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/includes.hpp @@ -365,7 +365,7 @@ namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::includes - inline constexpr struct includes_t final + HPX_CXX_EXPORT inline constexpr struct includes_t final : hpx::detail::tag_parallel_algorithm { private: @@ -374,7 +374,7 @@ namespace hpx::ranges { typename Pred = hpx::parallel::detail::less, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_sentinel_for_v && hpx::parallel::traits::is_projected_v && @@ -405,7 +405,7 @@ namespace hpx::ranges { typename Sent2, typename Pred = hpx::parallel::detail::less, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::traits::is_sentinel_for_v && hpx::parallel::traits::is_projected_v && hpx::traits::is_sentinel_for_v && @@ -435,7 +435,7 @@ namespace hpx::ranges { typename Pred = hpx::parallel::detail::less, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && @@ -471,7 +471,7 @@ namespace hpx::ranges { typename Pred = hpx::parallel::detail::less, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && hpx::traits::is_range_v && diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/inclusive_scan.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/inclusive_scan.hpp index 1131cb475962..a59f0fccd372 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/inclusive_scan.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/inclusive_scan.hpp @@ -662,17 +662,17 @@ namespace hpx { namespace ranges { namespace hpx::ranges { - template + HPX_CXX_EXPORT template using inclusive_scan_result = parallel::util::in_out_result; - inline constexpr struct inclusive_scan_t final + HPX_CXX_EXPORT inline constexpr struct inclusive_scan_t final : hpx::detail::tag_parallel_algorithm { private: template > // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && hpx::traits::is_iterator_v && @@ -700,7 +700,7 @@ namespace hpx::ranges { template > // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && @@ -729,7 +729,7 @@ namespace hpx::ranges { template > // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::is_invocable_v::value_type, @@ -758,7 +758,7 @@ namespace hpx::ranges { template > // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::is_invocable_v::value_type> // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && hpx::traits::is_iterator_v && @@ -819,7 +819,7 @@ namespace hpx::ranges { typename FwdIter2, typename Op, typename T = typename std::iterator_traits::value_type> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && @@ -851,7 +851,7 @@ namespace hpx::ranges { typename T = typename std::iterator_traits< hpx::traits::range_iterator_t>::value_type> // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::is_invocable_v::value_type, @@ -881,7 +881,7 @@ namespace hpx::ranges { typename T = typename std::iterator_traits< hpx::traits::range_iterator_t>::value_type> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::is_invocable_v { private: @@ -504,7 +504,7 @@ namespace hpx::ranges { typename Comp = hpx::parallel::detail::less, typename Proj = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && @@ -533,7 +533,7 @@ namespace hpx::ranges { typename Comp = hpx::parallel::detail::less, typename Proj = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_sentinel_for_v && hpx::parallel::traits::is_indirect_callable_v // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && hpx::parallel::traits::is_indirect_callable_v< @@ -585,7 +585,7 @@ namespace hpx::ranges { typename Comp = hpx::parallel::detail::less, typename Proj = hpx::identity> // clang-format off - requires ( + requires( hpx::traits::is_sentinel_for_v && hpx::parallel::traits::is_indirect_callable_v< hpx::execution::sequenced_policy, Comp, @@ -608,7 +608,7 @@ namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::is_heap_until - inline constexpr struct is_heap_until_t final + HPX_CXX_EXPORT inline constexpr struct is_heap_until_t final : hpx::detail::tag_parallel_algorithm { private: @@ -616,7 +616,7 @@ namespace hpx::ranges { typename Comp = hpx::parallel::detail::less, typename Proj = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && @@ -647,7 +647,7 @@ namespace hpx::ranges { typename Comp = hpx::parallel::detail::less, typename Proj = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_sentinel_for_v && hpx::parallel::traits::is_indirect_callable_v // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && hpx::parallel::traits::is_indirect_callable_v< @@ -700,7 +700,7 @@ namespace hpx::ranges { typename Comp = hpx::parallel::detail::less, typename Proj = hpx::identity> // clang-format off - requires ( + requires( hpx::traits::is_sentinel_for_v && hpx::parallel::traits::is_indirect_callable_v< hpx::execution::sequenced_policy, Comp, diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/is_partitioned.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/is_partitioned.hpp index 7a61f53a384f..5144d356996b 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/is_partitioned.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/is_partitioned.hpp @@ -257,14 +257,14 @@ namespace hpx { namespace ranges { namespace hpx::ranges { - inline constexpr struct is_partitioned_t final + HPX_CXX_EXPORT inline constexpr struct is_partitioned_t final : hpx::detail::tag_parallel_algorithm { private: template // clang-format off - requires ( + requires( hpx::traits::is_forward_iterator_v && hpx::traits::is_sentinel_for_v && hpx::parallel::traits::is_projected_v && @@ -285,7 +285,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_forward_iterator_v && hpx::parallel::traits::is_projected_v && @@ -307,7 +307,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && hpx::parallel::traits::is_indirect_callable_v< @@ -331,7 +331,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/is_sorted.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/is_sorted.hpp index 0d63e1d5db5a..9a157988a436 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/is_sorted.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/is_sorted.hpp @@ -510,7 +510,7 @@ namespace hpx { namespace ranges { namespace hpx::ranges { - inline constexpr struct is_sorted_t + HPX_CXX_EXPORT inline constexpr struct is_sorted_t : hpx::detail::tag_parallel_algorithm { private: @@ -518,7 +518,7 @@ namespace hpx::ranges { typename Pred = hpx::parallel::detail::less, typename Proj = hpx::identity> // clang-format off - requires ( + requires( hpx::traits::is_forward_iterator_v && hpx::traits::is_sentinel_for_v && hpx::parallel::traits::is_projected_v && @@ -541,7 +541,7 @@ namespace hpx::ranges { typename Pred = hpx::parallel::detail::less, typename Proj = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_forward_iterator_v && hpx::traits::is_sentinel_for_v && @@ -565,7 +565,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && hpx::parallel::traits::is_indirect_callable_v< @@ -589,7 +589,7 @@ namespace hpx::ranges { typename Pred = hpx::parallel::detail::less, typename Proj = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && @@ -612,7 +612,7 @@ namespace hpx::ranges { } } is_sorted{}; - inline constexpr struct is_sorted_until_t final + HPX_CXX_EXPORT inline constexpr struct is_sorted_until_t final : hpx::detail::tag_parallel_algorithm { private: @@ -620,7 +620,7 @@ namespace hpx::ranges { typename Pred = hpx::parallel::detail::less, typename Proj = hpx::identity> // clang-format off - requires ( + requires( hpx::traits::is_forward_iterator_v && hpx::traits::is_sentinel_for_v && hpx::parallel::traits::is_projected_v && @@ -643,7 +643,7 @@ namespace hpx::ranges { typename Pred = hpx::parallel::detail::less, typename Proj = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_forward_iterator_v && hpx::traits::is_sentinel_for_v && @@ -668,7 +668,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && hpx::parallel::traits::is_indirect_callable_v< @@ -693,13 +693,16 @@ namespace hpx::ranges { typename Pred = hpx::parallel::detail::less, typename Proj = hpx::identity> // clang-format off - requires(hpx::is_execution_policy_v && + requires( + hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && hpx::parallel::traits::is_indirect_callable_v< hpx::execution::sequenced_policy, Pred, hpx::parallel::traits::projected_range, - hpx::parallel::traits::projected_range>) + hpx::parallel::traits::projected_range + > + ) // clang-format on friend hpx::parallel::util::detail::algorithm_result_t> diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/lexicographical_compare.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/lexicographical_compare.hpp index f10003b57a17..19a160573bd1 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/lexicographical_compare.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/lexicographical_compare.hpp @@ -356,6 +356,7 @@ namespace hpx { namespace ranges { Pred&& pred = Pred(), Proj1&& proj1 = Proj1(), Proj2&& proj2 = Proj2()); // clang-format on }} // namespace hpx::ranges + #else #include @@ -376,7 +377,7 @@ namespace hpx { namespace ranges { namespace hpx::ranges { - inline constexpr struct lexicographical_compare_t final + HPX_CXX_EXPORT inline constexpr struct lexicographical_compare_t final : hpx::detail::tag_parallel_algorithm { private: @@ -385,7 +386,8 @@ namespace hpx::ranges { typename Proj2 = hpx::identity, typename Pred = hpx::parallel::detail::less> // clang-format off - requires(hpx::traits::is_iterator_v && + requires( + hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && @@ -394,7 +396,9 @@ namespace hpx::ranges { hpx::parallel::traits::is_indirect_callable_v< hpx::execution::sequenced_policy, Pred, hpx::parallel::traits::projected, - hpx::parallel::traits::projected>) + hpx::parallel::traits::projected + > + ) // clang-format on friend bool tag_fallback_invoke(hpx::ranges::lexicographical_compare_t, InIter1 first1, Sent1 last1, InIter2 first2, Sent2 last2, @@ -415,7 +419,7 @@ namespace hpx::ranges { typename Proj2 = hpx::identity, typename Pred = hpx::parallel::detail::less> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_forward_iterator_v && hpx::traits::is_sentinel_for_v && @@ -450,7 +454,7 @@ namespace hpx::ranges { typename Proj2 = hpx::identity, typename Pred = hpx::parallel::detail::less> // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && @@ -487,7 +491,7 @@ namespace hpx::ranges { typename Proj1 = hpx::identity, typename Proj2 = hpx::identity, typename Pred = hpx::parallel::detail::less> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::traits::is_range_v && diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/make_heap.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/make_heap.hpp index 28b551be350a..3ff25138534f 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/make_heap.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/make_heap.hpp @@ -407,14 +407,14 @@ namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::make_heap - inline constexpr struct make_heap_t final + HPX_CXX_EXPORT inline constexpr struct make_heap_t final : hpx::detail::tag_parallel_algorithm { private: template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_sentinel_for_v && hpx::parallel::traits::is_indirect_callable_v // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::parallel::traits::is_projected_range_v && hpx::parallel::traits::is_indirect_callable_v // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_sentinel_for_v && hpx::parallel::traits::is_indirect_callable_v // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::parallel::traits::is_projected_range_v && hpx::parallel::traits::is_indirect_callable_v // clang-format off - requires ( + requires( hpx::traits::is_sentinel_for_v && hpx::parallel::traits::is_indirect_callable_v< hpx::execution::sequenced_policy, Comp, @@ -550,7 +550,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::parallel::traits::is_projected_range_v && hpx::parallel::traits::is_indirect_callable_v< hpx::execution::sequenced_policy, Comp, @@ -575,7 +575,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_sentinel_for_v && hpx::parallel::traits::is_indirect_callable_v< hpx::execution::sequenced_policy, diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/merge.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/merge.hpp index 065c13f3b215..834a643b8953 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/merge.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/merge.hpp @@ -680,12 +680,12 @@ namespace hpx { namespace ranges { namespace hpx::ranges { - template + HPX_CXX_EXPORT template using merge_result = parallel::util::in_in_out_result; /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::merge - inline constexpr struct merge_t final + HPX_CXX_EXPORT inline constexpr struct merge_t final : hpx::detail::tag_parallel_algorithm { private: @@ -693,7 +693,7 @@ namespace hpx::ranges { typename Iter3, typename Comp = hpx::ranges::less, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && @@ -740,7 +740,7 @@ namespace hpx::ranges { typename Comp = hpx::ranges::less, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_sentinel_for_v && hpx::parallel::traits::is_projected_v && @@ -777,7 +777,7 @@ namespace hpx::ranges { typename Comp = hpx::ranges::less, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && hpx::traits::is_range_v && @@ -821,7 +821,7 @@ namespace hpx::ranges { typename Sent2, typename Iter3, typename Comp = hpx::ranges::less, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::traits::is_sentinel_for_v && hpx::parallel::traits::is_projected_v && hpx::traits::is_sentinel_for_v && @@ -856,14 +856,14 @@ namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::inplace_merge - inline constexpr struct inplace_merge_t final + HPX_CXX_EXPORT inline constexpr struct inplace_merge_t final : hpx::detail::tag_parallel_algorithm { private: template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && @@ -895,7 +895,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_sentinel_for_v && hpx::parallel::traits::is_projected_v && @@ -920,7 +920,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && hpx::traits::is_iterator_v && @@ -951,7 +951,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_sentinel_for_v && hpx::parallel::traits::is_projected_v && hpx::parallel::traits::is_indirect_callable_v< diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/minmax.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/minmax.hpp index a23c6bf72662..3346cc9a0ead 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/minmax.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/minmax.hpp @@ -810,12 +810,12 @@ namespace hpx::ranges { /// `minmax_element_result` is equivalent to /// `hpx::parallel::util::min_max_result` - template + HPX_CXX_EXPORT template using minmax_element_result = hpx::parallel::util::min_max_result; /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::min_element - inline constexpr struct min_element_t final + HPX_CXX_EXPORT inline constexpr struct min_element_t final : hpx::detail::tag_parallel_algorithm { private: @@ -823,7 +823,7 @@ namespace hpx::ranges { typename F = hpx::parallel::detail::less, typename Proj = hpx::identity> // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::parallel::traits::is_projected_v && hpx::traits::is_sentinel_for_v && @@ -847,7 +847,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && hpx::parallel::traits::is_indirect_callable_v< @@ -875,7 +875,7 @@ namespace hpx::ranges { typename F = hpx::parallel::detail::less, typename Proj = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_iterator_v && hpx::parallel::traits::is_projected_v && @@ -904,7 +904,7 @@ namespace hpx::ranges { typename F = hpx::parallel::detail::less, typename Proj = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && @@ -933,7 +933,7 @@ namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::max_element - inline constexpr struct max_element_t final + HPX_CXX_EXPORT inline constexpr struct max_element_t final : hpx::detail::tag_parallel_algorithm { private: @@ -941,7 +941,7 @@ namespace hpx::ranges { typename F = hpx::parallel::detail::less, typename Proj = hpx::identity> // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::parallel::traits::is_projected_v && hpx::traits::is_sentinel_for_v && @@ -965,7 +965,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && hpx::parallel::traits::is_indirect_callable_v< @@ -993,7 +993,7 @@ namespace hpx::ranges { typename F = hpx::parallel::detail::less, typename Proj = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_iterator_v && hpx::parallel::traits::is_projected_v && @@ -1022,7 +1022,7 @@ namespace hpx::ranges { typename F = hpx::parallel::detail::less, typename Proj = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && @@ -1051,7 +1051,7 @@ namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::minmax_element - inline constexpr struct minmax_element_t final + HPX_CXX_EXPORT inline constexpr struct minmax_element_t final : hpx::detail::tag_parallel_algorithm { private: @@ -1059,7 +1059,7 @@ namespace hpx::ranges { typename F = hpx::parallel::detail::less, typename Proj = hpx::identity> // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::parallel::traits::is_projected_v && hpx::traits::is_sentinel_for_v && @@ -1084,7 +1084,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && hpx::parallel::traits::is_indirect_callable_v< @@ -1112,7 +1112,7 @@ namespace hpx::ranges { typename F = hpx::parallel::detail::less, typename Proj = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_iterator_v && hpx::parallel::traits::is_projected_v && @@ -1141,7 +1141,7 @@ namespace hpx::ranges { typename F = hpx::parallel::detail::less, typename Proj = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/mismatch.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/mismatch.hpp index 657c9f96fbab..332eda2e644c 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/mismatch.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/mismatch.hpp @@ -381,12 +381,12 @@ namespace hpx { namespace ranges { namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template using mismatch_result = hpx::parallel::util::in_in_result; /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::mismatch - inline constexpr struct mismatch_t final + HPX_CXX_EXPORT inline constexpr struct mismatch_t final : hpx::detail::tag_parallel_algorithm { private: @@ -394,7 +394,7 @@ namespace hpx::ranges { typename Iter2, typename Sent2, typename Pred = equal_to, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_sentinel_for_v && hpx::traits::is_sentinel_for_v && @@ -425,7 +425,7 @@ namespace hpx::ranges { typename Pred = equal_to, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::parallel::traits::is_projected_range_v && hpx::parallel::traits::is_projected_range_v && @@ -469,7 +469,7 @@ namespace hpx::ranges { typename Sent2, typename Pred = equal_to, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::traits::is_sentinel_for_v && hpx::traits::is_sentinel_for_v && hpx::parallel::traits::is_indirect_callable_v< @@ -497,7 +497,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::parallel::traits::is_projected_range_v && hpx::parallel::traits::is_projected_range_v && hpx::parallel::traits::is_indirect_callable_v< diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/move.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/move.hpp index 6ab8a570daff..ef13d3a0e56d 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/move.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/move.hpp @@ -205,19 +205,19 @@ namespace hpx { namespace ranges { namespace hpx::ranges { - template + HPX_CXX_EXPORT template using move_result = parallel::util::in_out_result; /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::move - inline constexpr struct move_t final + HPX_CXX_EXPORT inline constexpr struct move_t final : hpx::detail::tag_parallel_algorithm { private: template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_sentinel_for_v && hpx::traits::is_iterator_v @@ -235,7 +235,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::traits::is_iterator_v @@ -255,7 +255,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_sentinel_for_v && hpx::traits::is_iterator_v ) @@ -270,7 +270,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::traits::is_iterator_v ) diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/nth_element.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/nth_element.hpp index 04cf161f2fca..b0ad4bb1b415 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/nth_element.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/nth_element.hpp @@ -308,7 +308,7 @@ namespace hpx { namespace ranges { namespace hpx::ranges { - inline constexpr struct nth_element_t final + HPX_CXX_EXPORT inline constexpr struct nth_element_t final : hpx::detail::tag_parallel_algorithm { private: @@ -316,7 +316,7 @@ namespace hpx::ranges { typename Pred = hpx::parallel::detail::less, typename Proj = hpx::identity> // clang-format off - requires ( + requires( hpx::traits::is_random_access_iterator_v && hpx::traits::is_sentinel_for_v && hpx::parallel::traits::is_projected_v && @@ -343,7 +343,7 @@ namespace hpx::ranges { typename Pred = hpx::parallel::detail::less, typename Proj = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_random_access_iterator_v && hpx::traits::is_sentinel_for_v && @@ -371,7 +371,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && hpx::parallel::traits::is_indirect_callable_v< @@ -401,7 +401,7 @@ namespace hpx::ranges { typename Pred = hpx::parallel::detail::less, typename Proj = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/partial_sort.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/partial_sort.hpp index 759b803a5a26..166ec2a294db 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/partial_sort.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/partial_sort.hpp @@ -283,14 +283,14 @@ namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::partial_sort - inline constexpr struct partial_sort_t final + HPX_CXX_EXPORT inline constexpr struct partial_sort_t final : hpx::detail::tag_parallel_algorithm { private: template // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && parallel::traits::is_projected_v && @@ -316,7 +316,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && @@ -343,7 +343,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_range_v && parallel::traits::is_projected_range_v && parallel::traits::is_indirect_callable_v< @@ -372,7 +372,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && parallel::traits::is_projected_range_v && diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/partial_sort_copy.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/partial_sort_copy.hpp index cd120fbebfc2..9d4632254ef2 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/partial_sort_copy.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/partial_sort_copy.hpp @@ -344,12 +344,12 @@ namespace hpx { namespace ranges { namespace hpx::ranges { - template + HPX_CXX_EXPORT template using partial_sort_copy_result = parallel::util::in_out_result; /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::partial_sort_copy - inline constexpr struct partial_sort_copy_t final + HPX_CXX_EXPORT inline constexpr struct partial_sort_copy_t final : hpx::detail::tag_parallel_algorithm { private: @@ -357,7 +357,7 @@ namespace hpx::ranges { typename Sent2, typename Comp = ranges::less, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && hpx::traits::is_iterator_v && @@ -393,7 +393,7 @@ namespace hpx::ranges { typename RandIter, typename Sent2, typename Comp = ranges::less, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && @@ -430,7 +430,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::traits::is_range_v && parallel::traits::is_projected_range_v && @@ -471,7 +471,7 @@ namespace hpx::ranges { typename Comp = ranges::less, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::traits::is_range_v && diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/partition.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/partition.hpp index 38ace3418f68..c6e978c488e3 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/partition.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/partition.hpp @@ -928,23 +928,23 @@ namespace hpx { namespace ranges { namespace hpx::ranges { - template + HPX_CXX_EXPORT template using partition_copy_result = parallel::util::in_out_out_result; - inline constexpr struct partition_t final + HPX_CXX_EXPORT inline constexpr struct partition_t final : hpx::detail::tag_parallel_algorithm { private: template // clang-format off - requires ( + requires( hpx::traits::is_range_v && parallel::traits::is_projected_range_v && parallel::traits::is_indirect_callable_v< hpx::execution::sequenced_policy, Pred, parallel::traits::projected_range > - ) + ) // clang-format on friend subrange_t> tag_fallback_invoke( @@ -967,14 +967,14 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && parallel::traits::is_projected_range_v && parallel::traits::is_indirect_callable_v > - ) + ) // clang-format on friend parallel::util::detail::algorithm_result_t>> @@ -998,14 +998,14 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && parallel::traits::is_indirect_callable_v< hpx::execution::sequenced_policy, Pred, parallel::traits::projected > - ) + ) // clang-format on friend subrange_t tag_fallback_invoke(hpx::ranges::partition_t, FwdIter first, Sent last, Pred pred, Proj proj = Proj()) @@ -1023,14 +1023,14 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && parallel::traits::is_indirect_callable_v > - ) + ) // clang-format on friend typename parallel::util::detail::algorithm_result>::type @@ -1048,13 +1048,13 @@ namespace hpx::ranges { } } partition{}; - inline constexpr struct stable_partition_t final + HPX_CXX_EXPORT inline constexpr struct stable_partition_t final : hpx::detail::tag_parallel_algorithm { private: template // clang-format off - requires ( + requires( hpx::traits::is_range_v && parallel::traits::is_projected_range_v && parallel::traits::is_indirect_callable_v< @@ -1085,14 +1085,14 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && parallel::traits::is_projected_range_v && parallel::traits::is_indirect_callable_v > - ) + ) // clang-format on friend parallel::util::detail::algorithm_result_t>> @@ -1121,14 +1121,14 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && parallel::traits::is_indirect_callable_v< hpx::execution::sequenced_policy, Pred, parallel::traits::projected > - ) + ) // clang-format on friend subrange_t tag_fallback_invoke( hpx::ranges::stable_partition_t, BidirIter first, Sent last, @@ -1147,14 +1147,14 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && parallel::traits::is_indirect_callable_v > - ) + ) // clang-format on friend parallel::util::detail::algorithm_result_t> @@ -1175,14 +1175,14 @@ namespace hpx::ranges { } } stable_partition{}; - inline constexpr struct partition_copy_t final + HPX_CXX_EXPORT inline constexpr struct partition_copy_t final : hpx::detail::tag_parallel_algorithm { private: template // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::traits::is_iterator_v && hpx::traits::is_iterator_v && @@ -1215,7 +1215,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::traits::is_iterator_v && @@ -1249,7 +1249,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && hpx::traits::is_iterator_v && @@ -1281,7 +1281,7 @@ namespace hpx::ranges { typename OutIter2, typename OutIter3, typename Pred, typename Proj = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/reduce.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/reduce.hpp index a903039fb065..e8fd6d85dc9e 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/reduce.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/reduce.hpp @@ -692,14 +692,14 @@ namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::reduce - inline constexpr struct reduce_t final + HPX_CXX_EXPORT inline constexpr struct reduce_t final : hpx::detail::tag_parallel_algorithm { template ::value_type> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_sentinel_for_v ) @@ -721,7 +721,7 @@ namespace hpx::ranges { typename T = typename std::iterator_traits< hpx::traits::range_iterator_t>::value_type> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v ) @@ -744,7 +744,7 @@ namespace hpx::ranges { template ::value_type> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_sentinel_for_v ) @@ -766,7 +766,7 @@ namespace hpx::ranges { typename T = typename std::iterator_traits< hpx::traits::range_iterator_t>::value_type> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v ) @@ -788,7 +788,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_sentinel_for_v ) @@ -811,7 +811,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v ) @@ -838,11 +838,7 @@ namespace hpx::ranges { template ::value_type> - // clang-format off - requires ( - hpx::traits::is_sentinel_for_v - ) - // clang-format on + requires(hpx::traits::is_sentinel_for_v) friend T tag_fallback_invoke( hpx::ranges::reduce_t, FwdIter first, Sent last, T init, F f) { @@ -856,11 +852,7 @@ namespace hpx::ranges { template >::value_type> - // clang-format off - requires ( - hpx::traits::is_range_v - ) - // clang-format on + requires(hpx::traits::is_range_v) friend T tag_fallback_invoke( hpx::ranges::reduce_t, Rng&& rng, T init, F f) { @@ -875,11 +867,7 @@ namespace hpx::ranges { template ::value_type> - // clang-format off - requires ( - hpx::traits::is_sentinel_for_v - ) - // clang-format on + requires(hpx::traits::is_sentinel_for_v) friend T tag_fallback_invoke( hpx::ranges::reduce_t, FwdIter first, Sent last, T init) { @@ -893,11 +881,7 @@ namespace hpx::ranges { template >::value_type> - // clang-format off - requires ( - hpx::traits::is_range_v - ) - // clang-format on + requires(hpx::traits::is_range_v) friend T tag_fallback_invoke(hpx::ranges::reduce_t, Rng&& rng, T init) { static_assert(hpx::traits::is_input_iterator - // clang-format off - requires ( - hpx::traits::is_sentinel_for_v - ) - // clang-format on + requires(hpx::traits::is_sentinel_for_v) friend typename std::iterator_traits::value_type tag_fallback_invoke(hpx::ranges::reduce_t, FwdIter first, Sent last) { @@ -930,11 +910,7 @@ namespace hpx::ranges { } template - // clang-format off - requires ( - hpx::traits::is_range_v - ) - // clang-format on + requires(hpx::traits::is_range_v) friend typename std::iterator_traits< typename hpx::traits::range_traits::iterator_type>::value_type tag_fallback_invoke(hpx::ranges::reduce_t, Rng&& rng) diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/remove.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/remove.hpp index 7b049abdcaf8..e6c1cb4f9c02 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/remove.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/remove.hpp @@ -489,14 +489,14 @@ namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::remove_if - inline constexpr struct remove_if_t final + HPX_CXX_EXPORT inline constexpr struct remove_if_t final : hpx::detail::tag_parallel_algorithm { private: template // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::parallel::traits::is_projected_v && hpx::traits::is_sentinel_for_v && @@ -521,7 +521,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && hpx::is_invocable_v // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && @@ -580,7 +580,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && @@ -611,7 +611,7 @@ namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::remove - inline constexpr struct remove_t final + HPX_CXX_EXPORT inline constexpr struct remove_t final : hpx::detail::tag_parallel_algorithm { private: @@ -619,7 +619,7 @@ namespace hpx::ranges { typename T = typename hpx::parallel::traits::projected::value_type> // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::parallel::traits::is_projected_v && hpx::traits::is_sentinel_for_v @@ -643,7 +643,7 @@ namespace hpx::ranges { typename T = typename hpx::parallel::traits::projected< hpx::traits::range_iterator_t, Proj>::value_type> // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v ) @@ -670,7 +670,7 @@ namespace hpx::ranges { typename T = typename hpx::parallel::traits::projected::value_type> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && @@ -698,7 +698,7 @@ namespace hpx::ranges { typename T = typename hpx::parallel::traits::projected< hpx::traits::range_iterator_t, Proj>::value_type> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/remove_copy.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/remove_copy.hpp index 38a048c64ff4..853797d65630 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/remove_copy.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/remove_copy.hpp @@ -593,21 +593,21 @@ namespace hpx { namespace ranges { namespace hpx::ranges { - template + HPX_CXX_EXPORT template using remove_copy_result = hpx::parallel::util::in_out_result; - template + HPX_CXX_EXPORT template using remove_copy_if_result = hpx::parallel::util::in_out_result; /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::remove_copy_if - inline constexpr struct remove_copy_if_t final + HPX_CXX_EXPORT inline constexpr struct remove_copy_if_t final : hpx::detail::tag_parallel_algorithm { template // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::parallel::traits::is_projected_v && hpx::traits::is_sentinel_for_v && @@ -636,7 +636,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_range_v&& hpx::parallel::traits::is_projected_range_v && hpx::is_invocable_v // clang-format off - requires ( + requires( hpx::is_execution_policy_v&& hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && @@ -694,7 +694,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && @@ -723,7 +723,7 @@ namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::remove_copy - inline constexpr struct remove_copy_t final + HPX_CXX_EXPORT inline constexpr struct remove_copy_t final : hpx::detail::tag_parallel_algorithm { private: @@ -732,7 +732,7 @@ namespace hpx::ranges { typename T = typename hpx::parallel::traits::projected::value_type> // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && hpx::traits::is_iterator_v && @@ -758,7 +758,7 @@ namespace hpx::ranges { typename T = typename hpx::parallel::traits::projected< hpx::traits::range_iterator_t, Proj>::value_type> // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v ) @@ -785,7 +785,7 @@ namespace hpx::ranges { typename T = typename hpx::parallel::traits::projected::value_type> // clang-format off - requires ( + requires( hpx::is_execution_policy_v&& hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && @@ -814,7 +814,7 @@ namespace hpx::ranges { typename T = typename hpx::parallel::traits::projected< hpx::traits::range_iterator_t, Proj>::value_type> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/replace.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/replace.hpp index 515bae932cbd..398ba295444b 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/replace.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/replace.hpp @@ -1095,17 +1095,17 @@ namespace hpx::ranges { /// `replace_copy_if_result` is equivalent to /// `hpx::parallel::util::in_out_result` - template + HPX_CXX_EXPORT template using replace_copy_if_result = hpx::parallel::util::in_out_result; /// `replace_copy_result` is equivalent to /// `hpx::parallel::util::in_out_result` - template + HPX_CXX_EXPORT template using replace_copy_result = hpx::parallel::util::in_out_result; /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::replace_if - inline constexpr struct replace_if_t final + HPX_CXX_EXPORT inline constexpr struct replace_if_t final : hpx::detail::tag_parallel_algorithm { private: @@ -1114,7 +1114,7 @@ namespace hpx::ranges { typename T = typename hpx::parallel::traits::projected::value_type> // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::parallel::traits::is_projected_v && hpx::traits::is_sentinel_for_v && @@ -1138,7 +1138,7 @@ namespace hpx::ranges { typename T = typename hpx::parallel::traits::projected< hpx::traits::range_iterator_t, Proj>::value_type> // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && hpx::is_invocable_v::value_type> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_iterator_v && hpx::parallel::traits::is_projected_v && @@ -1196,12 +1196,13 @@ namespace hpx::ranges { typename T = typename hpx::parallel::traits::projected< hpx::traits::range_iterator_t, Proj>::value_type> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && hpx::parallel::traits::is_indirect_callable>::value + Pred, hpx::parallel::traits::projected_range + >::value ) // clang-format on friend parallel::util::detail::algorithm_result_t { private: @@ -1232,7 +1233,7 @@ namespace hpx::ranges { Proj>::value_type, typename T2 = T1> // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::parallel::traits::is_projected_v && hpx::traits::is_sentinel_for_v @@ -1258,7 +1259,7 @@ namespace hpx::ranges { hpx::traits::range_iterator_t, Proj>::value_type, typename T2 = T1> // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v ) @@ -1286,7 +1287,7 @@ namespace hpx::ranges { Proj>::value_type, typename T2 = T1> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && @@ -1316,7 +1317,7 @@ namespace hpx::ranges { hpx::traits::range_iterator_t, Proj>::value_type, typename T2 = T1> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v @@ -1344,7 +1345,7 @@ namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::replace_copy_if - inline constexpr struct replace_copy_if_t final + HPX_CXX_EXPORT inline constexpr struct replace_copy_if_t final : hpx::detail::tag_parallel_algorithm { private: @@ -1353,7 +1354,7 @@ namespace hpx::ranges { typename T = typename std::iterator_traits::value_type, typename Proj = hpx::identity> // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::traits::is_iterator_v && hpx::parallel::traits::is_projected_v && @@ -1383,12 +1384,15 @@ namespace hpx::ranges { typename T = typename std::iterator_traits::value_type, typename Proj = hpx::identity> // clang-format off - requires(hpx::traits::is_range_v && + requires( + hpx::traits::is_range_v && hpx::traits::is_iterator_v && hpx::parallel::traits::is_projected_range_v && hpx::is_invocable_v>::value_type>) + hpx::traits::range_iterator_t>::value_type + > + ) // clang-format on friend replace_copy_if_result, OutIter> @@ -1415,7 +1419,7 @@ namespace hpx::ranges { typename T = typename std::iterator_traits::value_type, typename Proj = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_iterator_v && hpx::traits::is_iterator_v && @@ -1449,7 +1453,7 @@ namespace hpx::ranges { typename T = typename std::iterator_traits::value_type, typename Proj = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::traits::is_iterator_v && @@ -1483,7 +1487,7 @@ namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::replace_copy - inline constexpr struct replace_copy_t final + HPX_CXX_EXPORT inline constexpr struct replace_copy_t final : hpx::detail::tag_parallel_algorithm { private: @@ -1493,7 +1497,7 @@ namespace hpx::ranges { Proj>::value_type, typename T2 = T1> // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::parallel::traits::is_projected_v && hpx::traits::is_sentinel_for_v @@ -1522,7 +1526,7 @@ namespace hpx::ranges { hpx::traits::range_iterator_t, Proj>::value_type, typename T2 = T1> // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v ) @@ -1555,7 +1559,7 @@ namespace hpx::ranges { Proj>::value_type, typename T2 = T1> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_iterator_v && hpx::traits::is_iterator_v && @@ -1589,7 +1593,7 @@ namespace hpx::ranges { hpx::traits::range_iterator_t, Proj>::value_type, typename T2 = T1> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/reverse.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/reverse.hpp index ec103b6e11ff..97b72b158126 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/reverse.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/reverse.hpp @@ -379,21 +379,21 @@ namespace hpx::ranges { /// `reverse_copy_result` is equivalent to /// `hpx::parallel::util::in_out_result` - template + HPX_CXX_EXPORT template using reverse_copy_result = hpx::parallel::util::in_out_result; /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::reverse - inline constexpr struct reverse_t final + HPX_CXX_EXPORT inline constexpr struct reverse_t final : hpx::detail::tag_parallel_algorithm { private: template // clang-format off - requires ( - hpx::traits::is_iterator_v && - hpx::traits::is_sentinel_for_v - ) + requires( + hpx::traits::is_iterator_v && + hpx::traits::is_sentinel_for_v + ) // clang-format on friend Iter tag_fallback_invoke( hpx::ranges::reverse_t, Iter first, Sent sent) @@ -406,11 +406,7 @@ namespace hpx::ranges { } template - // clang-format off - requires ( - hpx::traits::is_range_v - ) - // clang-format on + requires(hpx::traits::is_range_v) friend hpx::traits::range_iterator_t tag_fallback_invoke( hpx::ranges::reverse_t, Rng&& rng) { @@ -426,9 +422,11 @@ namespace hpx::ranges { template // clang-format off - requires(hpx::is_execution_policy_v && + requires( + hpx::is_execution_policy_v && hpx::traits::is_iterator_v && - hpx::traits::is_sentinel_for_v) + hpx::traits::is_sentinel_for_v + ) // clang-format on friend typename parallel::util::detail::algorithm_result::type @@ -444,10 +442,10 @@ namespace hpx::ranges { template // clang-format off - requires ( - hpx::is_execution_policy_v && - hpx::traits::is_range_v - ) + requires( + hpx::is_execution_policy_v && + hpx::traits::is_range_v + ) // clang-format on friend parallel::util::detail::algorithm_result_t> @@ -467,17 +465,17 @@ namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::reverse_copy - inline constexpr struct reverse_copy_t final + HPX_CXX_EXPORT inline constexpr struct reverse_copy_t final : hpx::detail::tag_parallel_algorithm { private: template // clang-format off - requires ( - hpx::traits::is_iterator_v && - hpx::traits::is_sentinel_for_v && - hpx::traits::is_iterator_v - ) + requires( + hpx::traits::is_iterator_v && + hpx::traits::is_sentinel_for_v && + hpx::traits::is_iterator_v + ) // clang-format on friend reverse_copy_result tag_fallback_invoke( hpx::ranges::reverse_copy_t, Iter first, Sent last, OutIter result) @@ -495,10 +493,10 @@ namespace hpx::ranges { template // clang-format off - requires ( - hpx::traits::is_range_v && - hpx::traits::is_iterator_v - ) + requires( + hpx::traits::is_range_v && + hpx::traits::is_iterator_v + ) // clang-format on friend reverse_copy_result, OutIter> tag_fallback_invoke( @@ -521,12 +519,12 @@ namespace hpx::ranges { template // clang-format off - requires ( - hpx::is_execution_policy_v && - hpx::traits::is_iterator_v && - hpx::traits::is_sentinel_for_v && - hpx::traits::is_iterator_v - ) + requires( + hpx::is_execution_policy_v && + hpx::traits::is_iterator_v && + hpx::traits::is_sentinel_for_v && + hpx::traits::is_iterator_v + ) // clang-format on friend parallel::util::detail::algorithm_result_t> @@ -546,11 +544,11 @@ namespace hpx::ranges { template // clang-format off - requires ( - hpx::is_execution_policy_v && - hpx::traits::is_range_v && - hpx::traits::is_iterator_v - ) + requires( + hpx::is_execution_policy_v && + hpx::traits::is_range_v && + hpx::traits::is_iterator_v + ) // clang-format on friend parallel::util::detail::algorithm_result_t, OutIter>> diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/rotate.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/rotate.hpp index f031441f6258..9b64cfefe478 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/rotate.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/rotate.hpp @@ -416,13 +416,13 @@ namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::rotate - inline constexpr struct rotate_t final + HPX_CXX_EXPORT inline constexpr struct rotate_t final : hpx::detail::tag_parallel_algorithm { private: template // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v ) @@ -441,7 +441,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v @@ -467,9 +467,7 @@ namespace hpx::ranges { } template - // clang-format off - requires (hpx::traits::is_range_v) - // clang-format on + requires(hpx::traits::is_range_v) friend subrange_t, hpx::traits::range_iterator_t> tag_fallback_invoke(hpx::ranges::rotate_t, Rng&& rng, @@ -487,7 +485,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v ) @@ -516,16 +514,16 @@ namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::rotate_copy - template + HPX_CXX_EXPORT template using rotate_copy_result = hpx::parallel::util::in_out_result; - inline constexpr struct rotate_copy_t final + HPX_CXX_EXPORT inline constexpr struct rotate_copy_t final : hpx::detail::tag_parallel_algorithm { private: template // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && hpx::traits::is_iterator_v @@ -548,7 +546,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::is_execution_policy_v && hpx::traits::is_sentinel_for_v && @@ -577,7 +575,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::traits::is_iterator_v ) @@ -594,7 +592,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::traits::is_iterator_v diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/search.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/search.hpp index e484ace62041..f0cc384b26f4 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/search.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/search.hpp @@ -700,7 +700,7 @@ namespace hpx { namespace ranges { namespace hpx::ranges { - inline constexpr struct search_t final + HPX_CXX_EXPORT inline constexpr struct search_t final : hpx::detail::tag_parallel_algorithm { private: @@ -708,7 +708,7 @@ namespace hpx::ranges { typename Sent2, typename Pred = hpx::ranges::equal_to, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::traits::is_forward_iterator_v && hpx::traits::is_sentinel_for_v && parallel::traits::is_projected_v && @@ -736,7 +736,7 @@ namespace hpx::ranges { typename Pred = hpx::ranges::equal_to, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_forward_iterator_v && hpx::traits::is_sentinel_for_v && @@ -765,7 +765,7 @@ namespace hpx::ranges { typename Pred = hpx::ranges::equal_to, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && hpx::traits::is_range_v && @@ -795,7 +795,7 @@ namespace hpx::ranges { typename Pred = hpx::ranges::equal_to, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && @@ -824,7 +824,7 @@ namespace hpx::ranges { } } search{}; - inline constexpr struct search_n_t final + HPX_CXX_EXPORT inline constexpr struct search_n_t final : hpx::detail::tag_parallel_algorithm { private: @@ -832,7 +832,7 @@ namespace hpx::ranges { typename Pred = hpx::ranges::equal_to, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::traits::is_forward_iterator_v && parallel::traits::is_projected_v && hpx::traits::is_forward_iterator_v && @@ -858,7 +858,7 @@ namespace hpx::ranges { typename Sent2, typename Pred = hpx::ranges::equal_to, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_forward_iterator_v && parallel::traits::is_projected_v && @@ -887,7 +887,7 @@ namespace hpx::ranges { typename Pred = hpx::ranges::equal_to, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && hpx::traits::is_range_v && @@ -917,7 +917,7 @@ namespace hpx::ranges { typename Pred = hpx::ranges::equal_to, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/set_difference.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/set_difference.hpp index 56a29ca8eb51..c163ccc2be4d 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/set_difference.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/set_difference.hpp @@ -433,12 +433,12 @@ namespace hpx { namespace ranges { namespace hpx::ranges { - template + HPX_CXX_EXPORT template using set_difference_result = parallel::util::in_out_result; /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::set_difference - inline constexpr struct set_difference_t final + HPX_CXX_EXPORT inline constexpr struct set_difference_t final : hpx::detail::tag_parallel_algorithm { private: @@ -447,7 +447,7 @@ namespace hpx::ranges { typename Pred = hpx::parallel::detail::less, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_sentinel_for_v && hpx::parallel::traits::is_projected_v && @@ -492,7 +492,7 @@ namespace hpx::ranges { typename Iter3, typename Pred = hpx::parallel::detail::less, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && @@ -543,7 +543,7 @@ namespace hpx::ranges { typename Pred = hpx::parallel::detail::less, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::traits::is_sentinel_for_v && hpx::parallel::traits::is_projected_v && hpx::traits::is_sentinel_for_v && @@ -579,7 +579,7 @@ namespace hpx::ranges { typename Pred = hpx::parallel::detail::less, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && hpx::traits::is_range_v && diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/set_intersection.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/set_intersection.hpp index 7ede7583414a..d1c84be33eb1 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/set_intersection.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/set_intersection.hpp @@ -436,12 +436,12 @@ namespace hpx { namespace ranges { namespace hpx::ranges { - template + HPX_CXX_EXPORT template using set_intersection_result = parallel::util::in_in_out_result; /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::set_intersection - inline constexpr struct set_intersection_t final + HPX_CXX_EXPORT inline constexpr struct set_intersection_t final : hpx::detail::tag_parallel_algorithm { private: @@ -450,7 +450,7 @@ namespace hpx::ranges { typename Pred = hpx::parallel::detail::less, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_sentinel_for_v && hpx::parallel::traits::is_projected_v && @@ -495,7 +495,7 @@ namespace hpx::ranges { typename Iter3, typename Pred = hpx::parallel::detail::less, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && @@ -548,7 +548,7 @@ namespace hpx::ranges { typename Pred = hpx::parallel::detail::less, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::traits::is_sentinel_for_v && hpx::parallel::traits::is_projected_v && hpx::traits::is_sentinel_for_v && @@ -584,7 +584,7 @@ namespace hpx::ranges { typename Pred = hpx::parallel::detail::less, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && hpx::traits::is_range_v && diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/set_symmetric_difference.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/set_symmetric_difference.hpp index 884c65672ea1..271960638159 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/set_symmetric_difference.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/set_symmetric_difference.hpp @@ -450,13 +450,13 @@ namespace hpx { namespace ranges { namespace hpx::ranges { - template + HPX_CXX_EXPORT template using set_symmetric_difference_result = parallel::util::in_in_out_result; /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::set_symmetric_difference - inline constexpr struct set_symmetric_difference_t final + HPX_CXX_EXPORT inline constexpr struct set_symmetric_difference_t final : hpx::detail::tag_parallel_algorithm { private: @@ -465,7 +465,7 @@ namespace hpx::ranges { typename Pred = hpx::parallel::detail::less, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_sentinel_for_v && hpx::parallel::traits::is_projected_v && @@ -513,7 +513,7 @@ namespace hpx::ranges { typename Iter3, typename Pred = hpx::parallel::detail::less, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && @@ -567,7 +567,7 @@ namespace hpx::ranges { typename Pred = hpx::parallel::detail::less, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::traits::is_sentinel_for_v && hpx::parallel::traits::is_projected_v && hpx::traits::is_sentinel_for_v && @@ -605,7 +605,7 @@ namespace hpx::ranges { typename Pred = hpx::parallel::detail::less, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && hpx::traits::is_range_v && diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/set_union.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/set_union.hpp index 1cccb67d4325..91b92973b621 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/set_union.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/set_union.hpp @@ -436,12 +436,12 @@ namespace hpx { namespace ranges { namespace hpx::ranges { - template + HPX_CXX_EXPORT template using set_union_result = parallel::util::in_in_out_result; /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::set_union - inline constexpr struct set_union_t final + HPX_CXX_EXPORT inline constexpr struct set_union_t final : hpx::detail::tag_parallel_algorithm { private: @@ -450,7 +450,7 @@ namespace hpx::ranges { typename Pred = hpx::parallel::detail::less, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_sentinel_for_v && hpx::parallel::traits::is_projected_v && @@ -495,7 +495,7 @@ namespace hpx::ranges { typename Iter3, typename Pred = hpx::parallel::detail::less, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && @@ -548,7 +548,7 @@ namespace hpx::ranges { typename Pred = hpx::parallel::detail::less, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::traits::is_sentinel_for_v && hpx::parallel::traits::is_projected_v && hpx::traits::is_sentinel_for_v && @@ -584,7 +584,7 @@ namespace hpx::ranges { typename Pred = hpx::parallel::detail::less, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && hpx::traits::is_range_v && diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/shift_left.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/shift_left.hpp index 3b6b001e03ad..c88cb04d85f2 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/shift_left.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/shift_left.hpp @@ -205,13 +205,13 @@ namespace hpx { namespace ranges { namespace hpx::ranges { - inline constexpr struct shift_left_t final + HPX_CXX_EXPORT inline constexpr struct shift_left_t final : hpx::functional::detail::tag_fallback { private: template // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && std::is_integral_v @@ -230,7 +230,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && @@ -251,7 +251,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_range_v && std::is_integral_v ) @@ -270,7 +270,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && std::is_integral_v diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/shift_right.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/shift_right.hpp index 5eb089b9a59f..446bf2c23ab8 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/shift_right.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/shift_right.hpp @@ -205,13 +205,13 @@ namespace hpx { namespace ranges { namespace hpx::ranges { - inline constexpr struct shift_right_t final + HPX_CXX_EXPORT inline constexpr struct shift_right_t final : hpx::functional::detail::tag_fallback { private: template // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && std::is_integral_v @@ -230,7 +230,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && @@ -251,7 +251,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_range_v && std::is_integral_v ) @@ -270,7 +270,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && std::is_integral_v diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/sort.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/sort.hpp index c4b0566ef102..bba26ba96c7d 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/sort.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/sort.hpp @@ -293,14 +293,14 @@ namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::sort - inline constexpr struct sort_t final + HPX_CXX_EXPORT inline constexpr struct sort_t final : hpx::detail::tag_parallel_algorithm { private: template // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && parallel::traits::is_projected_v && @@ -325,7 +325,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && @@ -351,7 +351,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_range_v && parallel::traits::is_projected_range_v && parallel::traits::is_indirect_callable_v< @@ -380,7 +380,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && parallel::traits::is_projected_range_v && diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/stable_sort.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/stable_sort.hpp index e5e208c66e3f..f961b8df9ce4 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/stable_sort.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/stable_sort.hpp @@ -295,14 +295,14 @@ namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::stable_sort - inline constexpr struct stable_sort_t final + HPX_CXX_EXPORT inline constexpr struct stable_sort_t final : hpx::detail::tag_parallel_algorithm { private: template // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && parallel::traits::is_projected_v && @@ -328,7 +328,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && @@ -356,7 +356,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_range_v && parallel::traits::is_projected_range_v && parallel::traits::is_indirect_callable< @@ -385,7 +385,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && parallel::traits::is_projected_range_v && diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/starts_with.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/starts_with.hpp index 21d0d1ce41f3..f7ad51abeec9 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/starts_with.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/starts_with.hpp @@ -297,7 +297,7 @@ namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::copy - inline constexpr struct starts_with_t final + HPX_CXX_EXPORT inline constexpr struct starts_with_t final : hpx::functional::detail::tag_fallback { private: @@ -305,7 +305,7 @@ namespace hpx::ranges { typename Sent2, typename Pred = ranges::equal_to, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && hpx::traits::is_iterator_v && @@ -336,7 +336,7 @@ namespace hpx::ranges { typename FwdIter2, typename Sent2, typename Pred = ranges::equal_to, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && @@ -369,7 +369,7 @@ namespace hpx::ranges { typename Pred = ranges::equal_to, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && hpx::traits::is_range_v && @@ -408,7 +408,7 @@ namespace hpx::ranges { typename Pred = ranges::equal_to, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && hpx::traits::is_range_v && diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/swap_ranges.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/swap_ranges.hpp index 35490f4606aa..fe1532b61eca 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/swap_ranges.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/swap_ranges.hpp @@ -226,19 +226,19 @@ namespace hpx { namespace ranges { namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template using swap_ranges_result = hpx::parallel::util::in_in_result; /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::swap_ranges - inline constexpr struct swap_ranges_t final + HPX_CXX_EXPORT inline constexpr struct swap_ranges_t final : hpx::detail::tag_parallel_algorithm { private: template // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && hpx::traits::is_iterator_v && @@ -262,7 +262,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && @@ -288,7 +288,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::traits::is_range_v ) @@ -314,7 +314,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::traits::is_range_v diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/transform.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/transform.hpp index fd8b87a53043..c73922aed1a3 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/transform.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/transform.hpp @@ -698,22 +698,22 @@ namespace hpx { namespace ranges { namespace hpx::ranges { - template + HPX_CXX_EXPORT template using unary_transform_result = parallel::util::in_out_result; - template + HPX_CXX_EXPORT template using binary_transform_result = parallel::util::in_in_out_result; /////////////////////////////////////////////////////////////////////////// // a for hpx::ranges::transform - inline constexpr struct transform_t final + HPX_CXX_EXPORT inline constexpr struct transform_t final : hpx::detail::tag_parallel_algorithm { private: template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && @@ -736,7 +736,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::traits::is_iterator_v @@ -761,7 +761,7 @@ namespace hpx::ranges { typename FwdIter2, typename Sent2, typename FwdIter3, typename F, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && @@ -789,7 +789,7 @@ namespace hpx::ranges { typename FwdIter, typename F, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::traits::is_range_v && @@ -820,7 +820,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && hpx::traits::is_iterator_v @@ -842,7 +842,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::traits::is_iterator_v ) @@ -868,7 +868,7 @@ namespace hpx::ranges { typename Sent2, typename FwdIter3, typename F, typename Proj1 = hpx::identity, typename Proj2 = hpx::identity> // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && hpx::traits::is_iterator_v && @@ -894,9 +894,11 @@ namespace hpx::ranges { template // clang-format off - requires(hpx::traits::is_range_v && + requires( + hpx::traits::is_range_v && hpx::traits::is_range_v && - hpx::traits::is_iterator_v) + hpx::traits::is_iterator_v + ) // clang-format on friend ranges::binary_transform_result< hpx::traits::range_iterator_t, diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/transform_exclusive_scan.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/transform_exclusive_scan.hpp index 99a96aa63703..208e46166d38 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/transform_exclusive_scan.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/transform_exclusive_scan.hpp @@ -443,10 +443,10 @@ namespace hpx { namespace ranges { namespace hpx::ranges { - template + HPX_CXX_EXPORT template using transform_exclusive_scan_result = parallel::util::in_out_result; - inline constexpr struct transform_exclusive_scan_t final + HPX_CXX_EXPORT inline constexpr struct transform_exclusive_scan_t final : hpx::detail::tag_parallel_algorithm { private: @@ -454,7 +454,7 @@ namespace hpx::ranges { typename BinOp, typename UnOp, typename T = typename std::iterator_traits::value_type> // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && hpx::traits::is_iterator_v && @@ -491,7 +491,7 @@ namespace hpx::ranges { typename FwdIter2, typename BinOp, typename UnOp, typename T = typename std::iterator_traits::value_type> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && @@ -530,7 +530,7 @@ namespace hpx::ranges { typename T = typename std::iterator_traits< hpx::traits::range_iterator_t>::value_type> // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::is_invocable_v::value_type> && @@ -566,7 +566,7 @@ namespace hpx::ranges { typename T = typename std::iterator_traits< hpx::traits::range_iterator_t>::value_type> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::is_invocable_v + HPX_CXX_EXPORT template using transform_inclusive_scan_result = parallel::util::in_out_result; - inline constexpr struct transform_inclusive_scan_t final + HPX_CXX_EXPORT inline constexpr struct transform_inclusive_scan_t final : hpx::detail::tag_parallel_algorithm { private: template // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && hpx::traits::is_iterator_v && @@ -876,7 +876,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && @@ -913,7 +913,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::is_invocable_v::value_type> && @@ -948,7 +948,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::is_invocable_v::value_type> // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && hpx::traits::is_iterator_v && @@ -1025,7 +1025,7 @@ namespace hpx::ranges { typename FwdIter2, typename BinOp, typename UnOp, typename T = typename std::iterator_traits::value_type> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && @@ -1064,7 +1064,7 @@ namespace hpx::ranges { typename T = typename std::iterator_traits< hpx::traits::range_iterator_t>::value_type> // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::is_invocable_v::value_type> && @@ -1101,7 +1101,7 @@ namespace hpx::ranges { typename T = typename std::iterator_traits< hpx::traits::range_iterator_t>::value_type> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::is_invocable_v { private: template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_sentinel_for_v && hpx::is_invocable_v // clang-format off - requires ( + requires( hpx::traits::is_sentinel_for_v && hpx::is_invocable_v::value_type @@ -971,7 +971,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_sentinel_for_v && hpx::traits::is_iterator_v @@ -994,7 +994,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_sentinel_for_v && hpx::traits::is_iterator_v ) @@ -1016,7 +1016,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_sentinel_for_v && hpx::traits::is_iterator_v && @@ -1053,7 +1053,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_sentinel_for_v && hpx::traits::is_iterator_v && hpx::is_invocable_v // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::is_invocable_v // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::is_invocable_v::value_type @@ -1153,7 +1153,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::traits::is_iterator_v @@ -1179,7 +1179,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::traits::is_iterator_v ) @@ -1203,7 +1203,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::traits::is_iterator_v && @@ -1243,7 +1243,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::traits::is_iterator_v && hpx::is_invocable_v namespace hpx::ranges { - inline constexpr struct uninitialized_copy_t final + + HPX_CXX_EXPORT inline constexpr struct uninitialized_copy_t final : hpx::detail::tag_parallel_algorithm { private: template // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && hpx::traits::is_forward_iterator_v && @@ -355,7 +356,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_forward_iterator_v && hpx::traits::is_sentinel_for_v && @@ -382,7 +383,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::traits::is_range_v ) @@ -412,7 +413,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::traits::is_range_v @@ -443,14 +444,14 @@ namespace hpx::ranges { } } uninitialized_copy{}; - inline constexpr struct uninitialized_copy_n_t final + HPX_CXX_EXPORT inline constexpr struct uninitialized_copy_n_t final : hpx::detail::tag_parallel_algorithm { private: template // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::traits::is_forward_iterator_v && hpx::traits::is_sentinel_for_v && @@ -476,7 +477,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_forward_iterator_v && hpx::traits::is_forward_iterator_v && diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/uninitialized_default_construct.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/uninitialized_default_construct.hpp index bf530ec98287..48ff35e72c96 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/uninitialized_default_construct.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/uninitialized_default_construct.hpp @@ -269,13 +269,14 @@ namespace hpx { namespace ranges { namespace hpx::ranges { - inline constexpr struct uninitialized_default_construct_t final + HPX_CXX_EXPORT inline constexpr struct uninitialized_default_construct_t + final : hpx::detail::tag_parallel_algorithm { private: template // clang-format off - requires ( + requires( hpx::traits::is_forward_iterator_v && hpx::traits::is_sentinel_for_v ) @@ -294,7 +295,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_forward_iterator_v && hpx::traits::is_sentinel_for_v @@ -313,11 +314,7 @@ namespace hpx::ranges { } template - // clang-format off - requires ( - hpx::traits::is_range_v - ) - // clang-format on + requires(hpx::traits::is_range_v) friend typename hpx::traits::range_traits::iterator_type tag_fallback_invoke( hpx::ranges::uninitialized_default_construct_t, Rng&& rng) @@ -335,7 +332,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v ) @@ -358,13 +355,14 @@ namespace hpx::ranges { } } uninitialized_default_construct{}; - inline constexpr struct uninitialized_default_construct_n_t final + HPX_CXX_EXPORT inline constexpr struct uninitialized_default_construct_n_t + final : hpx::detail::tag_parallel_algorithm { private: template // clang-format off - requires ( + requires( hpx::traits::is_forward_iterator_v && std::is_integral_v ) @@ -383,7 +381,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_forward_iterator_v && std::is_integral_v diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/uninitialized_fill.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/uninitialized_fill.hpp index 24951145ec30..ba2e05b93ea9 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/uninitialized_fill.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/uninitialized_fill.hpp @@ -272,13 +272,13 @@ namespace hpx { namespace ranges { namespace hpx::ranges { - inline constexpr struct uninitialized_fill_t final + HPX_CXX_EXPORT inline constexpr struct uninitialized_fill_t final : hpx::detail::tag_parallel_algorithm { private: template // clang-format off - requires ( + requires( hpx::traits::is_forward_iterator_v && hpx::traits::is_sentinel_for_v ) @@ -296,7 +296,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_forward_iterator_v && hpx::traits::is_sentinel_for_v @@ -315,11 +315,7 @@ namespace hpx::ranges { } template - // clang-format off - requires ( - hpx::traits::is_range_v - ) - // clang-format on + requires(hpx::traits::is_range_v) friend typename hpx::traits::range_traits::iterator_type tag_fallback_invoke( hpx::ranges::uninitialized_fill_t, Rng&& rng, T const& value) @@ -337,7 +333,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v ) @@ -359,13 +355,13 @@ namespace hpx::ranges { } } uninitialized_fill{}; - inline constexpr struct uninitialized_fill_n_t final + HPX_CXX_EXPORT inline constexpr struct uninitialized_fill_n_t final : hpx::detail::tag_parallel_algorithm { private: template // clang-format off - requires ( + requires( hpx::traits::is_forward_iterator_v && std::is_integral_v ) @@ -383,7 +379,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_forward_iterator_v && std::is_integral_v diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/uninitialized_move.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/uninitialized_move.hpp index 037f7d40058b..848c5ee98ddf 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/uninitialized_move.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/uninitialized_move.hpp @@ -336,14 +336,14 @@ namespace hpx { namespace ranges { namespace hpx::ranges { - inline constexpr struct uninitialized_move_t final + HPX_CXX_EXPORT inline constexpr struct uninitialized_move_t final : hpx::detail::tag_parallel_algorithm { private: template // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && hpx::traits::is_forward_iterator_v && @@ -367,7 +367,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_forward_iterator_v && hpx::traits::is_sentinel_for_v && @@ -394,7 +394,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::traits::is_range_v ) @@ -424,7 +424,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::traits::is_range_v @@ -455,14 +455,14 @@ namespace hpx::ranges { } } uninitialized_move{}; - inline constexpr struct uninitialized_move_n_t final + HPX_CXX_EXPORT inline constexpr struct uninitialized_move_n_t final : hpx::detail::tag_parallel_algorithm { private: template // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::traits::is_forward_iterator_v && hpx::traits::is_sentinel_for_v && @@ -488,7 +488,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_forward_iterator_v && hpx::traits::is_forward_iterator_v && diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/uninitialized_value_construct.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/uninitialized_value_construct.hpp index f6b63b849011..026e226ef3f7 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/uninitialized_value_construct.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/uninitialized_value_construct.hpp @@ -267,13 +267,13 @@ namespace hpx { namespace ranges { namespace hpx::ranges { - inline constexpr struct uninitialized_value_construct_t final + HPX_CXX_EXPORT inline constexpr struct uninitialized_value_construct_t final : hpx::detail::tag_parallel_algorithm { private: template // clang-format off - requires ( + requires( hpx::traits::is_forward_iterator_v && hpx::traits::is_sentinel_for_v ) @@ -292,7 +292,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_forward_iterator_v && hpx::traits::is_sentinel_for_v @@ -311,11 +311,7 @@ namespace hpx::ranges { } template - // clang-format off - requires ( - hpx::traits::is_range_v - ) - // clang-format on + requires(hpx::traits::is_range_v) friend typename hpx::traits::range_traits::iterator_type tag_fallback_invoke( hpx::ranges::uninitialized_value_construct_t, Rng&& rng) @@ -333,7 +329,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v ) @@ -356,13 +352,14 @@ namespace hpx::ranges { } } uninitialized_value_construct{}; - inline constexpr struct uninitialized_value_construct_n_t final + HPX_CXX_EXPORT inline constexpr struct uninitialized_value_construct_n_t + final : hpx::detail::tag_parallel_algorithm { private: template // clang-format off - requires ( + requires( hpx::traits::is_forward_iterator_v && std::is_integral_v ) @@ -381,7 +378,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_forward_iterator_v && std::is_integral_v diff --git a/libs/core/algorithms/include/hpx/parallel/container_algorithms/unique.hpp b/libs/core/algorithms/include/hpx/parallel/container_algorithms/unique.hpp index 4afface68e8e..72a0930e6dc7 100644 --- a/libs/core/algorithms/include/hpx/parallel/container_algorithms/unique.hpp +++ b/libs/core/algorithms/include/hpx/parallel/container_algorithms/unique.hpp @@ -612,19 +612,19 @@ namespace hpx { namespace ranges { namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template using subrange_t = hpx::util::iterator_range; /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::unique - inline constexpr struct unique_t final + HPX_CXX_EXPORT inline constexpr struct unique_t final : hpx::detail::tag_parallel_algorithm { private: template // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && parallel::traits::is_projected_v && @@ -652,7 +652,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && @@ -682,7 +682,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && hpx::parallel::traits::is_indirect_callable_v< @@ -715,7 +715,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && @@ -748,19 +748,19 @@ namespace hpx::ranges { } } unique{}; - template + HPX_CXX_EXPORT template using unique_copy_result = parallel::util::in_out_result; /////////////////////////////////////////////////////////////////////////// // CPO for hpx::ranges::unique_copy - inline constexpr struct unique_copy_t final + HPX_CXX_EXPORT inline constexpr struct unique_copy_t final : hpx::detail::tag_parallel_algorithm { private: template // clang-format off - requires ( + requires( hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && parallel::traits::is_projected_v && @@ -789,7 +789,7 @@ namespace hpx::ranges { typename O, typename Pred = ranges::equal_to, typename Proj = hpx::identity> // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_iterator_v && hpx::traits::is_sentinel_for_v && @@ -820,7 +820,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && hpx::parallel::traits::is_indirect_callable_v< @@ -849,7 +849,7 @@ namespace hpx::ranges { template // clang-format off - requires ( + requires( hpx::is_execution_policy_v && hpx::traits::is_range_v && hpx::parallel::traits::is_projected_range_v && diff --git a/libs/core/algorithms/include/hpx/parallel/datapar/adjacent_difference.hpp b/libs/core/algorithms/include/hpx/parallel/datapar/adjacent_difference.hpp index 8c2895110281..5d7e2fa9b9c2 100644 --- a/libs/core/algorithms/include/hpx/parallel/datapar/adjacent_difference.hpp +++ b/libs/core/algorithms/include/hpx/parallel/datapar/adjacent_difference.hpp @@ -26,7 +26,7 @@ namespace hpx::parallel::detail { /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct datapar_adjacent_difference { template @@ -61,7 +61,8 @@ namespace hpx::parallel::detail { } }; - template + HPX_CXX_EXPORT template // clang-format off requires ( hpx::is_vectorpack_execution_policy_v && diff --git a/libs/core/algorithms/include/hpx/parallel/datapar/adjacent_find.hpp b/libs/core/algorithms/include/hpx/parallel/datapar/adjacent_find.hpp index 06986b9406b1..12df0abc8a0d 100644 --- a/libs/core/algorithms/include/hpx/parallel/datapar/adjacent_find.hpp +++ b/libs/core/algorithms/include/hpx/parallel/datapar/adjacent_find.hpp @@ -24,7 +24,7 @@ namespace hpx::parallel::detail { /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct datapar_adjacent_find { template @@ -68,13 +68,9 @@ namespace hpx::parallel::detail { } }; - template - // clang-format off - requires ( - hpx::is_vectorpack_execution_policy_v - ) - // clang-format on + requires(hpx::is_vectorpack_execution_policy_v) constexpr InIter tag_invoke(sequential_adjacent_find_t, InIter first, Sent_ last, PredProj&& pred_projected) { @@ -96,13 +92,9 @@ namespace hpx::parallel::detail { } } - template - // clang-format off - requires ( - hpx::is_vectorpack_execution_policy_v - ) - // clang-format on + HPX_CXX_EXPORT template + requires(hpx::is_vectorpack_execution_policy_v) constexpr void tag_invoke(sequential_adjacent_find_t, std::size_t base_idx, ZipIter part_begin, std::size_t part_count, Token& tok, PredProj&& pred_projected) diff --git a/libs/core/algorithms/include/hpx/parallel/datapar/equal.hpp b/libs/core/algorithms/include/hpx/parallel/datapar/equal.hpp index 53214e43cdcd..8dfb30d60609 100644 --- a/libs/core/algorithms/include/hpx/parallel/datapar/equal.hpp +++ b/libs/core/algorithms/include/hpx/parallel/datapar/equal.hpp @@ -24,10 +24,10 @@ #include #include -namespace hpx { namespace parallel { namespace detail { +namespace hpx::parallel::detail { /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct datapar_equal { template @@ -57,11 +57,9 @@ namespace hpx { namespace parallel { namespace detail { } }; - template - // clang-format off - requires (hpx::is_vectorpack_execution_policy_v) - // clang-format on + HPX_CXX_EXPORT template + requires(hpx::is_vectorpack_execution_policy_v) HPX_HOST_DEVICE HPX_FORCEINLINE void tag_invoke( sequential_equal_t, ZipIterator it, std::size_t part_count, Token& tok, F&& f) @@ -82,7 +80,8 @@ namespace hpx { namespace parallel { namespace detail { } } - template + HPX_CXX_EXPORT template requires(hpx::is_vectorpack_execution_policy_v) HPX_HOST_DEVICE HPX_FORCEINLINE bool tag_invoke( sequential_equal_t, InIter1 first1, InIter1 last1, @@ -107,7 +106,7 @@ namespace hpx { namespace parallel { namespace detail { } /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct datapar_equal_binary { template + HPX_CXX_EXPORT template requires(hpx::is_vectorpack_execution_policy_v) HPX_HOST_DEVICE HPX_FORCEINLINE void tag_invoke( sequential_equal_binary_t, ZipIterator it, @@ -167,9 +166,9 @@ namespace hpx { namespace parallel { namespace detail { } } - template + HPX_CXX_EXPORT template requires(hpx::is_vectorpack_execution_policy_v) HPX_HOST_DEVICE HPX_FORCEINLINE bool tag_invoke( sequential_equal_binary_t, InIter1 first1, Sent1 last1, @@ -194,5 +193,6 @@ namespace hpx { namespace parallel { namespace detail { HPX_FORWARD(Proj2, proj2)); } } -}}} // namespace hpx::parallel::detail +} // namespace hpx::parallel::detail + #endif diff --git a/libs/core/algorithms/include/hpx/parallel/datapar/fill.hpp b/libs/core/algorithms/include/hpx/parallel/datapar/fill.hpp index 2971adf3bc81..0d2c3c175caf 100644 --- a/libs/core/algorithms/include/hpx/parallel/datapar/fill.hpp +++ b/libs/core/algorithms/include/hpx/parallel/datapar/fill.hpp @@ -20,10 +20,10 @@ #include #include -namespace hpx { namespace parallel { namespace detail { +namespace hpx::parallel::detail { /////////////////////////////////////////////////////////////////////////// - struct datapar_fill + HPX_CXX_EXPORT struct datapar_fill { template HPX_HOST_DEVICE HPX_FORCEINLINE static typename std::enable_if< @@ -36,11 +36,13 @@ namespace hpx { namespace parallel { namespace detail { } }; - template + HPX_CXX_EXPORT template // clang-format off requires ( - hpx::is_vectorpack_execution_policy_v&& hpx::parallel:: - util::detail::iterator_datapar_compatible::value) + hpx::is_vectorpack_execution_policy_v && + hpx::parallel::util::detail::iterator_datapar_compatible::value + ) // clang-format on HPX_HOST_DEVICE HPX_FORCEINLINE Iter tag_invoke(sequential_fill_t, ExPolicy&& policy, Iter first, Sent last, T const& value) @@ -50,7 +52,7 @@ namespace hpx { namespace parallel { namespace detail { } /////////////////////////////////////////////////////////////////////////// - struct datapar_fill_n + HPX_CXX_EXPORT struct datapar_fill_n { template HPX_HOST_DEVICE HPX_FORCEINLINE static typename std::enable_if< @@ -63,7 +65,7 @@ namespace hpx { namespace parallel { namespace detail { } }; - template + HPX_CXX_EXPORT template // clang-format off requires ( hpx::is_vectorpack_execution_policy_v && @@ -76,6 +78,6 @@ namespace hpx { namespace parallel { namespace detail { return datapar_fill_n::call( HPX_FORWARD(ExPolicy, policy), first, count, value); } -}}} // namespace hpx::parallel::detail +} // namespace hpx::parallel::detail #endif diff --git a/libs/core/algorithms/include/hpx/parallel/datapar/find.hpp b/libs/core/algorithms/include/hpx/parallel/datapar/find.hpp index 3fa11849ffdb..7f692d3db5ba 100644 --- a/libs/core/algorithms/include/hpx/parallel/datapar/find.hpp +++ b/libs/core/algorithms/include/hpx/parallel/datapar/find.hpp @@ -24,10 +24,10 @@ #include #include -namespace hpx { namespace parallel { namespace detail { +namespace hpx::parallel::detail { /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct datapar_find { template + HPX_CXX_EXPORT template requires(hpx::is_vectorpack_execution_policy_v) HPX_HOST_DEVICE HPX_FORCEINLINE Iterator tag_invoke( sequential_find_t, Iterator first, Sentinel last, @@ -79,8 +79,8 @@ namespace hpx { namespace parallel { namespace detail { } } - template + HPX_CXX_EXPORT template requires(hpx::is_vectorpack_execution_policy_v) HPX_HOST_DEVICE HPX_FORCEINLINE void tag_invoke(sequential_find_t, std::size_t base_idx, FwdIter part_begin, std::size_t part_count, @@ -91,7 +91,7 @@ namespace hpx { namespace parallel { namespace detail { } /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct datapar_find_if { template + HPX_CXX_EXPORT template requires(hpx::is_vectorpack_execution_policy_v) HPX_HOST_DEVICE HPX_FORCEINLINE Iterator tag_invoke( sequential_find_if_t, Iterator first, Sentinel last, @@ -158,8 +158,8 @@ namespace hpx { namespace parallel { namespace detail { } } - template + HPX_CXX_EXPORT template requires(hpx::is_vectorpack_execution_policy_v) HPX_HOST_DEVICE HPX_FORCEINLINE void tag_invoke( sequential_find_if_t, FwdIter part_begin, @@ -169,8 +169,8 @@ namespace hpx { namespace parallel { namespace detail { HPX_FORWARD(F, op), HPX_FORWARD(Proj, proj)); } - template + HPX_CXX_EXPORT template requires(hpx::is_vectorpack_execution_policy_v) HPX_HOST_DEVICE HPX_FORCEINLINE void tag_invoke( sequential_find_if_t, std::size_t base_idx, @@ -182,7 +182,7 @@ namespace hpx { namespace parallel { namespace detail { } /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct datapar_find_if_not { template + HPX_CXX_EXPORT template requires(hpx::is_vectorpack_execution_policy_v) HPX_HOST_DEVICE HPX_FORCEINLINE Iterator tag_invoke( sequential_find_if_not_t, Iterator first, Sentinel last, @@ -249,8 +249,8 @@ namespace hpx { namespace parallel { namespace detail { } } - template + HPX_CXX_EXPORT template requires(hpx::is_vectorpack_execution_policy_v) HPX_HOST_DEVICE HPX_FORCEINLINE void tag_invoke( sequential_find_if_not_t, FwdIter part_begin, @@ -260,8 +260,8 @@ namespace hpx { namespace parallel { namespace detail { HPX_FORWARD(F, op), HPX_FORWARD(Proj, proj)); } - template + HPX_CXX_EXPORT template requires(hpx::is_vectorpack_execution_policy_v) HPX_HOST_DEVICE HPX_FORCEINLINE void tag_invoke( sequential_find_if_not_t, std::size_t base_idx, @@ -273,7 +273,7 @@ namespace hpx { namespace parallel { namespace detail { } /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct datapar_find_end_t { template + HPX_CXX_EXPORT template requires(hpx::is_vectorpack_execution_policy_v) HPX_HOST_DEVICE HPX_FORCEINLINE Iter1 tag_invoke( sequential_find_end_t, Iter1 first1, Sent1 last1, @@ -360,8 +361,8 @@ namespace hpx { namespace parallel { namespace detail { } } - template + HPX_CXX_EXPORT template requires(hpx::is_vectorpack_execution_policy_v) HPX_HOST_DEVICE HPX_FORCEINLINE void tag_invoke( sequential_find_end_t, Iter1 it, Iter2 first2, @@ -389,7 +390,7 @@ namespace hpx { namespace parallel { namespace detail { } /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct datapar_find_first_of { template + HPX_CXX_EXPORT template requires(hpx::is_vectorpack_execution_policy_v) HPX_HOST_DEVICE HPX_FORCEINLINE InIter1 tag_invoke( sequential_find_first_of_t, InIter1 first, InIter1 last, @@ -476,8 +477,9 @@ namespace hpx { namespace parallel { namespace detail { } } - template + HPX_CXX_EXPORT template requires(hpx::is_vectorpack_execution_policy_v) HPX_HOST_DEVICE HPX_FORCEINLINE void tag_invoke( sequential_find_first_of_t, FwdIter it, FwdIter2 s_first, @@ -503,6 +505,6 @@ namespace hpx { namespace parallel { namespace detail { HPX_FORWARD(Proj1, proj1), HPX_FORWARD(Proj2, proj2)); } } -}}} // namespace hpx::parallel::detail +} // namespace hpx::parallel::detail #endif diff --git a/libs/core/algorithms/include/hpx/parallel/datapar/generate.hpp b/libs/core/algorithms/include/hpx/parallel/datapar/generate.hpp index fa4b2003d389..11701367b86f 100644 --- a/libs/core/algorithms/include/hpx/parallel/datapar/generate.hpp +++ b/libs/core/algorithms/include/hpx/parallel/datapar/generate.hpp @@ -22,9 +22,9 @@ #include #include -namespace hpx { namespace parallel { namespace detail { +namespace hpx::parallel::detail { - template + HPX_CXX_EXPORT template struct datapar_generate_helper { using iterator_type = std::decay_t; @@ -81,7 +81,7 @@ namespace hpx { namespace parallel { namespace detail { }; /////////////////////////////////////////////////////////////////////////// - struct datapar_generate + HPX_CXX_EXPORT struct datapar_generate { template HPX_HOST_DEVICE HPX_FORCEINLINE static Iter call( @@ -93,7 +93,8 @@ namespace hpx { namespace parallel { namespace detail { } }; - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE typename std::enable_if, Iter>::type @@ -105,7 +106,7 @@ namespace hpx { namespace parallel { namespace detail { } /////////////////////////////////////////////////////////////////////////// - struct datapar_generate_n + HPX_CXX_EXPORT struct datapar_generate_n { template HPX_HOST_DEVICE HPX_FORCEINLINE static Iter call( @@ -116,7 +117,7 @@ namespace hpx { namespace parallel { namespace detail { } }; - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE typename std::enable_if, Iter>::type @@ -126,5 +127,6 @@ namespace hpx { namespace parallel { namespace detail { return datapar_generate_n::call( HPX_FORWARD(ExPolicy, policy), first, count, HPX_FORWARD(F, f)); } -}}} // namespace hpx::parallel::detail +} // namespace hpx::parallel::detail + #endif diff --git a/libs/core/algorithms/include/hpx/parallel/datapar/handle_local_exceptions.hpp b/libs/core/algorithms/include/hpx/parallel/datapar/handle_local_exceptions.hpp index a4619517ea4f..bc0c399a4fa0 100644 --- a/libs/core/algorithms/include/hpx/parallel/datapar/handle_local_exceptions.hpp +++ b/libs/core/algorithms/include/hpx/parallel/datapar/handle_local_exceptions.hpp @@ -13,15 +13,11 @@ #include /////////////////////////////////////////////////////////////////////////////// -namespace hpx::parallel::util::detail { - - // simd et.al. need to terminate on exceptions - template - struct handle_local_exceptions>> - : terminate_on_local_exceptions - { - }; -} // namespace hpx::parallel::util::detail +template +struct hpx::parallel::util::detail::handle_local_exceptions>> + : hpx::parallel::util::detail::terminate_on_local_exceptions +{ +}; #endif diff --git a/libs/core/algorithms/include/hpx/parallel/datapar/iterator_helpers.hpp b/libs/core/algorithms/include/hpx/parallel/datapar/iterator_helpers.hpp index 10e58602f029..0e987f360df3 100644 --- a/libs/core/algorithms/include/hpx/parallel/datapar/iterator_helpers.hpp +++ b/libs/core/algorithms/include/hpx/parallel/datapar/iterator_helpers.hpp @@ -24,7 +24,7 @@ namespace hpx::parallel::util::detail { /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct is_data_aligned_impl { static HPX_FORCEINLINE bool call(Iter& it) noexcept @@ -39,14 +39,14 @@ namespace hpx::parallel::util::detail { } }; - template + HPX_CXX_EXPORT template HPX_FORCEINLINE bool is_data_aligned(Iter& it) noexcept { return is_data_aligned_impl::call(it); } /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct iterators_datapar_compatible_impl { using iterator1_type = std::decay_t; @@ -67,41 +67,41 @@ namespace hpx::parallel::util::detail { traits::vector_pack_alignment_v>; }; - template + HPX_CXX_EXPORT template struct iterators_datapar_compatible : iterators_datapar_compatible_impl::type { }; - template + HPX_CXX_EXPORT template inline constexpr bool iterators_datapar_compatible_v = iterators_datapar_compatible::value; /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct iterator_datapar_compatible_impl : std::is_arithmetic::value_type> { }; - template + HPX_CXX_EXPORT template struct iterator_datapar_compatible : std::false_type { }; - template + HPX_CXX_EXPORT template struct iterator_datapar_compatible>> : iterator_datapar_compatible_impl>::type { }; - template + HPX_CXX_EXPORT template inline constexpr bool iterator_datapar_compatible_v = iterator_datapar_compatible::value; /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct datapar_loop_step { using value_type = typename std::iterator_traits::value_type; @@ -130,7 +130,7 @@ namespace hpx::parallel::util::detail { } }; - template + HPX_CXX_EXPORT template struct datapar_loop_step>> { using V1 = traits::vector_pack_type_t; @@ -156,7 +156,7 @@ namespace hpx::parallel::util::detail { }; /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct datapar_loop_pred_step { using value_type = typename std::iterator_traits::value_type; @@ -192,7 +192,7 @@ namespace hpx::parallel::util::detail { }; /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct datapar_loop_step_ind { using value_type = typename std::iterator_traits::value_type; @@ -222,7 +222,7 @@ namespace hpx::parallel::util::detail { }; /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct datapar_loop_idx_step { using value_type = typename std::iterator_traits::value_type; @@ -250,7 +250,7 @@ namespace hpx::parallel::util::detail { }; /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct datapar_loop_step_tok { using value_type = typename std::iterator_traits::value_type; @@ -279,7 +279,7 @@ namespace hpx::parallel::util::detail { }; /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct invoke_vectorized_in2 { template @@ -328,7 +328,7 @@ namespace hpx::parallel::util::detail { }; /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct invoke_vectorized_in2_ind { template @@ -374,7 +374,7 @@ namespace hpx::parallel::util::detail { } }; - template + HPX_CXX_EXPORT template struct datapar_loop_step2 { using value1_type = typename std::iterator_traits::value_type; @@ -408,7 +408,7 @@ namespace hpx::parallel::util::detail { } }; - template + HPX_CXX_EXPORT template struct datapar_loop_step2_ind { using value1_type = typename std::iterator_traits::value_type; @@ -438,7 +438,7 @@ namespace hpx::parallel::util::detail { }; /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct invoke_vectorized_inout1 { template @@ -476,7 +476,7 @@ namespace hpx::parallel::util::detail { } }; - template + HPX_CXX_EXPORT template struct invoke_vectorized_inout1_ind { template @@ -514,7 +514,7 @@ namespace hpx::parallel::util::detail { } }; - template + HPX_CXX_EXPORT template struct invoke_vectorized_inout2 { template + HPX_CXX_EXPORT template struct invoke_vectorized_inout2_ind { template HPX_HOST_DEVICE HPX_FORCEINLINE static constexpr void call1( @@ -693,7 +693,7 @@ namespace hpx::parallel::util::detail { } }; - struct datapar_transform_loop_step_ind + HPX_CXX_EXPORT struct datapar_transform_loop_step_ind { template HPX_HOST_DEVICE HPX_FORCEINLINE static constexpr void call1( diff --git a/libs/core/algorithms/include/hpx/parallel/datapar/loop.hpp b/libs/core/algorithms/include/hpx/parallel/datapar/loop.hpp index b1538152ae41..aa956f051fc3 100644 --- a/libs/core/algorithms/include/hpx/parallel/datapar/loop.hpp +++ b/libs/core/algorithms/include/hpx/parallel/datapar/loop.hpp @@ -30,7 +30,7 @@ namespace hpx::parallel::util { /////////////////////////////////////////////////////////////////////// // Helper class to repeatedly call a function starting from a given // iterator position. - template + HPX_CXX_EXPORT template struct datapar_loop { using iterator_type = std::decay_t; @@ -94,7 +94,7 @@ namespace hpx::parallel::util { /////////////////////////////////////////////////////////////////////// // Helper class to repeatedly call a function starting from a given // iterator position till the predicate returns true. - template + HPX_CXX_EXPORT template struct datapar_loop_pred { using iterator_type = std::decay_t; @@ -142,7 +142,7 @@ namespace hpx::parallel::util { }; /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct datapar_loop_ind { using iterator_type = std::decay_t; @@ -192,7 +192,7 @@ namespace hpx::parallel::util { }; /////////////////////////////////////////////////////////////////////// - struct datapar_loop2 + HPX_CXX_EXPORT struct datapar_loop2 { template HPX_HOST_DEVICE HPX_FORCEINLINE static constexpr std::enable_if_t< @@ -235,10 +235,10 @@ namespace hpx::parallel::util { }; /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct datapar_loop_n; - template + HPX_CXX_EXPORT template struct datapar_loop_n>> { @@ -306,7 +306,7 @@ namespace hpx::parallel::util { } }; - template + HPX_CXX_EXPORT template struct datapar_loop_n>> { using V = traits::vector_pack_type_t; @@ -352,7 +352,7 @@ namespace hpx::parallel::util { }; /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct datapar_loop_n_ind { using iterator_type = std::decay_t; @@ -408,7 +408,7 @@ namespace hpx::parallel::util { }; /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct datapar_loop_idx_n { using iterator_type = std::decay_t; @@ -466,7 +466,7 @@ namespace hpx::parallel::util { } // namespace detail /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr Begin tag_invoke( hpx::parallel::util::loop_t, hpx::execution::simd_policy, Begin begin, End end, F&& f) @@ -474,7 +474,7 @@ namespace hpx::parallel::util { return detail::datapar_loop::call(begin, end, HPX_FORWARD(F, f)); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr Begin tag_invoke( hpx::parallel::util::loop_t, hpx::execution::simd_task_policy, Begin begin, End end, F&& f) @@ -482,7 +482,8 @@ namespace hpx::parallel::util { return detail::datapar_loop::call(begin, end, HPX_FORWARD(F, f)); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr Begin tag_invoke( hpx::parallel::util::loop_t, hpx::execution::simd_policy, Begin begin, End end, CancelToken& tok, F&& f) @@ -491,7 +492,8 @@ namespace hpx::parallel::util { begin, end, tok, HPX_FORWARD(F, f)); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr Begin tag_invoke( hpx::parallel::util::loop_t, hpx::execution::simd_task_policy, Begin begin, End end, CancelToken& tok, F&& f) @@ -501,7 +503,8 @@ namespace hpx::parallel::util { } /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr std::enable_if_t< hpx::is_vectorpack_execution_policy_v, Begin> tag_invoke(hpx::parallel::util::loop_pred_t, Begin first, End end, @@ -527,7 +530,7 @@ namespace hpx::parallel::util { } /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE Begin tag_invoke( hpx::parallel::util::loop_ind_t, Begin begin, End end, F&& f) @@ -536,7 +539,7 @@ namespace hpx::parallel::util { begin, end, HPX_FORWARD(F, f)); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE Begin tag_invoke( hpx::parallel::util::loop_ind_t, Begin begin, End end, F&& f) @@ -546,7 +549,8 @@ namespace hpx::parallel::util { } /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE std::enable_if_t, std::pair> @@ -571,7 +575,7 @@ namespace hpx::parallel::util { } /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr std::enable_if_t< hpx::is_vectorpack_execution_policy_v, Iter> tag_invoke(hpx::parallel::util::loop_n_t, Iter it, @@ -581,8 +585,8 @@ namespace hpx::parallel::util { it, count, HPX_FORWARD(F, f)); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr std::enable_if_t< hpx::is_vectorpack_execution_policy_v, Iter> tag_invoke(hpx::parallel::util::loop_n_t, Iter it, @@ -593,7 +597,7 @@ namespace hpx::parallel::util { } /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr std::enable_if_t< hpx::is_vectorpack_execution_policy_v, Iter> tag_invoke(hpx::parallel::util::loop_n_ind_t, Iter it, @@ -604,7 +608,7 @@ namespace hpx::parallel::util { } /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr std::enable_if_t< hpx::is_vectorpack_execution_policy_v, Iter> tag_invoke(hpx::parallel::util::loop_idx_n_t, @@ -614,8 +618,8 @@ namespace hpx::parallel::util { base_idx, it, count, HPX_FORWARD(F, f)); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr std::enable_if_t< hpx::is_vectorpack_execution_policy_v, Iter> tag_invoke(hpx::parallel::util::loop_idx_n_t, diff --git a/libs/core/algorithms/include/hpx/parallel/datapar/mismatch.hpp b/libs/core/algorithms/include/hpx/parallel/datapar/mismatch.hpp index af56eaa7567f..adcda6b8647b 100644 --- a/libs/core/algorithms/include/hpx/parallel/datapar/mismatch.hpp +++ b/libs/core/algorithms/include/hpx/parallel/datapar/mismatch.hpp @@ -26,10 +26,10 @@ #include #include -namespace hpx { namespace parallel { namespace detail { +namespace hpx::parallel::detail { /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct datapar_mismatch { template @@ -67,8 +67,8 @@ namespace hpx { namespace parallel { namespace detail { } }; - template + HPX_CXX_EXPORT template requires(hpx::is_vectorpack_execution_policy_v) HPX_HOST_DEVICE HPX_FORCEINLINE void tag_invoke( sequential_mismatch_t, std::size_t base_idx, ZipIterator it, @@ -90,8 +90,8 @@ namespace hpx { namespace parallel { namespace detail { } } - template + HPX_CXX_EXPORT template requires(hpx::is_vectorpack_execution_policy_v) HPX_HOST_DEVICE HPX_FORCEINLINE auto tag_invoke( sequential_mismatch_t, Iter1 first1, Sent last1, Iter2 first2, @@ -116,7 +116,7 @@ namespace hpx { namespace parallel { namespace detail { } ///////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct datapar_mismatch_binary { template + HPX_CXX_EXPORT template requires(hpx::is_vectorpack_execution_policy_v) HPX_HOST_DEVICE HPX_FORCEINLINE void tag_invoke( sequential_mismatch_binary_t, std::size_t base_idx, @@ -193,8 +193,9 @@ namespace hpx { namespace parallel { namespace detail { } } - template + HPX_CXX_EXPORT template requires(hpx::is_vectorpack_execution_policy_v) HPX_HOST_DEVICE HPX_FORCEINLINE util::in_in_result tag_invoke( sequential_mismatch_binary_t, Iter1 first1, Sent1 last1, @@ -219,6 +220,6 @@ namespace hpx { namespace parallel { namespace detail { HPX_FORWARD(Proj2, proj2)); } } -}}} // namespace hpx::parallel::detail +} // namespace hpx::parallel::detail #endif diff --git a/libs/core/algorithms/include/hpx/parallel/datapar/reduce.hpp b/libs/core/algorithms/include/hpx/parallel/datapar/reduce.hpp index 335ed02e0def..d6e429f9e9e1 100644 --- a/libs/core/algorithms/include/hpx/parallel/datapar/reduce.hpp +++ b/libs/core/algorithms/include/hpx/parallel/datapar/reduce.hpp @@ -23,10 +23,10 @@ #include #include -namespace hpx { namespace parallel { namespace detail { +namespace hpx::parallel::detail { /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct datapar_reduce { template + HPX_CXX_EXPORT template requires(hpx::is_vectorpack_execution_policy_v) HPX_HOST_DEVICE HPX_FORCEINLINE T tag_invoke(sequential_reduce_t, ExPolicy&& policy, InIterB first, InIterE last, T init, Reduce&& r) @@ -119,7 +119,8 @@ namespace hpx { namespace parallel { namespace detail { } } - template + HPX_CXX_EXPORT template requires(hpx::is_vectorpack_execution_policy_v) HPX_HOST_DEVICE HPX_FORCEINLINE T tag_invoke(sequential_reduce_t, FwdIter part_begin, std::size_t part_size, T init, Reduce r) @@ -140,8 +141,8 @@ namespace hpx { namespace parallel { namespace detail { } } - template + HPX_CXX_EXPORT template requires(hpx::is_vectorpack_execution_policy_v) HPX_HOST_DEVICE HPX_FORCEINLINE T tag_invoke(sequential_reduce_t, ExPolicy&& policy, Iter first, Sent last, T init, Reduce&& r, @@ -167,8 +168,8 @@ namespace hpx { namespace parallel { namespace detail { } } - template + HPX_CXX_EXPORT template requires(hpx::is_vectorpack_execution_policy_v) HPX_HOST_DEVICE HPX_FORCEINLINE T tag_invoke(sequential_reduce_t, Iter part_begin, std::size_t part_size, T init, Reduce r, Convert conv) @@ -189,8 +190,8 @@ namespace hpx { namespace parallel { namespace detail { } } - template + HPX_CXX_EXPORT template requires(hpx::is_vectorpack_execution_policy_v) HPX_HOST_DEVICE HPX_FORCEINLINE T tag_invoke(sequential_reduce_t, Iter1 first1, Sent last1, Iter2 first2, T init, Reduce&& r, @@ -213,6 +214,6 @@ namespace hpx { namespace parallel { namespace detail { init, HPX_FORWARD(Reduce, r), HPX_FORWARD(Convert, conv)); } } -}}} // namespace hpx::parallel::detail +} // namespace hpx::parallel::detail #endif diff --git a/libs/core/algorithms/include/hpx/parallel/datapar/replace.hpp b/libs/core/algorithms/include/hpx/parallel/datapar/replace.hpp index 83b0264b189b..0cb6d9e66748 100644 --- a/libs/core/algorithms/include/hpx/parallel/datapar/replace.hpp +++ b/libs/core/algorithms/include/hpx/parallel/datapar/replace.hpp @@ -26,7 +26,7 @@ namespace hpx { namespace parallel { namespace detail { /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct datapar_replace { template @@ -60,8 +60,8 @@ namespace hpx { namespace parallel { namespace detail { } }; - template + HPX_CXX_EXPORT template requires(hpx::is_vectorpack_execution_policy_v) HPX_HOST_DEVICE HPX_FORCEINLINE auto tag_invoke( sequential_replace_t, ExPolicy&& policy, InIter first, @@ -86,7 +86,7 @@ namespace hpx { namespace parallel { namespace detail { } /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct datapar_replace_if { template + HPX_CXX_EXPORT template requires(hpx::is_vectorpack_execution_policy_v) HPX_HOST_DEVICE HPX_FORCEINLINE auto tag_invoke( sequential_replace_if_t, ExPolicy&& policy, InIter first, @@ -148,7 +148,7 @@ namespace hpx { namespace parallel { namespace detail { } /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct datapar_replace_copy { template requires(hpx::is_vectorpack_execution_policy_v) HPX_HOST_DEVICE HPX_FORCEINLINE auto tag_invoke( @@ -222,7 +222,7 @@ namespace hpx { namespace parallel { namespace detail { } /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct datapar_replace_copy_if { template requires(hpx::is_vectorpack_execution_policy_v) HPX_HOST_DEVICE HPX_FORCEINLINE auto tag_invoke( diff --git a/libs/core/algorithms/include/hpx/parallel/datapar/transfer.hpp b/libs/core/algorithms/include/hpx/parallel/datapar/transfer.hpp index 857036f671c0..05f52126b186 100644 --- a/libs/core/algorithms/include/hpx/parallel/datapar/transfer.hpp +++ b/libs/core/algorithms/include/hpx/parallel/datapar/transfer.hpp @@ -20,11 +20,12 @@ #include #include -namespace hpx { namespace parallel { namespace util { +namespace hpx::parallel::util { /////////////////////////////////////////////////////////////////////////// namespace detail { - template + + HPX_CXX_EXPORT template struct datapar_copy_n { template @@ -57,7 +58,8 @@ namespace hpx { namespace parallel { namespace util { }; } // namespace detail - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE typename std::enable_if, in_out_result>::type @@ -66,5 +68,6 @@ namespace hpx { namespace parallel { namespace util { { return detail::datapar_copy_n::call(first, count, dest); } -}}} // namespace hpx::parallel::util +} // namespace hpx::parallel::util + #endif diff --git a/libs/core/algorithms/include/hpx/parallel/datapar/transform_loop.hpp b/libs/core/algorithms/include/hpx/parallel/datapar/transform_loop.hpp index d5212c19a379..aff42cf410a6 100644 --- a/libs/core/algorithms/include/hpx/parallel/datapar/transform_loop.hpp +++ b/libs/core/algorithms/include/hpx/parallel/datapar/transform_loop.hpp @@ -28,7 +28,7 @@ namespace hpx::parallel::util { namespace detail { /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct datapar_transform_loop_n { using iterator_type = std::decay_t; @@ -84,7 +84,8 @@ namespace hpx::parallel::util { }; } // namespace detail - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr std::enable_if_t< hpx::is_vectorpack_execution_policy_v, std::pair> @@ -98,7 +99,7 @@ namespace hpx::parallel::util { namespace detail { /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct datapar_transform_loop_n_ind { using iterator_type = std::decay_t; @@ -154,7 +155,8 @@ namespace hpx::parallel::util { }; } // namespace detail - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr std::enable_if_t< hpx::is_vectorpack_execution_policy_v, std::pair> @@ -168,7 +170,7 @@ namespace hpx::parallel::util { namespace detail { /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct datapar_transform_loop { using iterator_type = std::decay_t; @@ -203,7 +205,8 @@ namespace hpx::parallel::util { }; } // namespace detail - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr util::in_out_result tag_invoke(hpx::parallel::util::transform_loop_t, @@ -217,7 +220,8 @@ namespace hpx::parallel::util { HPX_MOVE(ret.first), HPX_MOVE(ret.second)}; } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr util::in_out_result tag_invoke(hpx::parallel::util::transform_loop_t, @@ -234,7 +238,7 @@ namespace hpx::parallel::util { namespace detail { /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct datapar_transform_loop_ind { using iterator_type = std::decay_t; @@ -271,7 +275,8 @@ namespace hpx::parallel::util { }; } // namespace detail - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr util::in_out_result tag_invoke(hpx::parallel::util::transform_loop_ind_t, @@ -285,7 +290,8 @@ namespace hpx::parallel::util { HPX_MOVE(ret.first), HPX_MOVE(ret.second)}; } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr util::in_out_result tag_invoke(hpx::parallel::util::transform_loop_ind_t, @@ -302,7 +308,7 @@ namespace hpx::parallel::util { namespace detail { /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct datapar_transform_binary_loop_n { using iterator1_type = std::decay_t; @@ -369,8 +375,8 @@ namespace hpx::parallel::util { }; } // namespace detail - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr std::enable_if_t< hpx::is_vectorpack_execution_policy_v, hpx::tuple> @@ -384,7 +390,7 @@ namespace hpx::parallel::util { namespace detail { /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct datapar_transform_binary_loop { using iterator1_type = std::decay_t; @@ -475,8 +481,8 @@ namespace hpx::parallel::util { }; } // namespace detail - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr std::enable_if_t< hpx::is_vectorpack_execution_policy_v, util::in_in_out_result> @@ -487,8 +493,8 @@ namespace hpx::parallel::util { first1, last1, first2, dest, HPX_FORWARD(F, f)); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr std::enable_if_t< hpx::is_vectorpack_execution_policy_v, util::in_in_out_result> @@ -503,7 +509,7 @@ namespace hpx::parallel::util { namespace detail { /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct datapar_transform_binary_loop_ind_n { using iterator1_type = std::decay_t; @@ -570,8 +576,8 @@ namespace hpx::parallel::util { }; } // namespace detail - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr std::enable_if_t< hpx::is_vectorpack_execution_policy_v, hpx::tuple> @@ -585,7 +591,7 @@ namespace hpx::parallel::util { namespace detail { /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct datapar_transform_binary_loop_ind { using iterator1_type = std::decay_t; @@ -682,8 +688,8 @@ namespace hpx::parallel::util { }; } // namespace detail - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr std::enable_if_t< hpx::is_vectorpack_execution_policy_v, util::in_in_out_result> @@ -694,8 +700,8 @@ namespace hpx::parallel::util { InIter2>::call(first1, last1, first2, dest, HPX_FORWARD(F, f)); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr std::enable_if_t< hpx::is_vectorpack_execution_policy_v, util::in_in_out_result> diff --git a/libs/core/algorithms/include/hpx/parallel/datapar/zip_iterator.hpp b/libs/core/algorithms/include/hpx/parallel/datapar/zip_iterator.hpp index 78bc27e770eb..e3d0c29b59f9 100644 --- a/libs/core/algorithms/include/hpx/parallel/datapar/zip_iterator.hpp +++ b/libs/core/algorithms/include/hpx/parallel/datapar/zip_iterator.hpp @@ -23,7 +23,7 @@ namespace hpx::parallel::util::detail { /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct is_data_aligned_impl> { template @@ -43,7 +43,7 @@ namespace hpx::parallel::util::detail { }; /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct iterator_datapar_compatible_impl> : hpx::util::all_of::value_type>...> @@ -57,7 +57,8 @@ namespace hpx::parallel::traits { /////////////////////////////////////////////////////////////////////////// namespace detail { - template + HPX_CXX_EXPORT template constexpr Tuple aligned_pack( hpx::util::zip_iterator const& iter, hpx::util::index_pack) @@ -69,7 +70,8 @@ namespace hpx::parallel::traits { aligned(hpx::get(t))...); } - template + HPX_CXX_EXPORT template constexpr Tuple unaligned_pack( hpx::util::zip_iterator const& iter, hpx::util::index_pack) @@ -82,7 +84,7 @@ namespace hpx::parallel::traits { } } // namespace detail - template + HPX_CXX_EXPORT template struct vector_pack_load, ValueType> { using value_type = hpx::tuple; @@ -107,7 +109,8 @@ namespace hpx::parallel::traits { /////////////////////////////////////////////////////////////////////////// namespace detail { - template + HPX_CXX_EXPORT template constexpr void aligned_pack(Tuple& value, hpx::util::zip_iterator const& iter, hpx::util::index_pack) @@ -119,7 +122,8 @@ namespace hpx::parallel::traits { ...); } - template + HPX_CXX_EXPORT template constexpr void unaligned_pack(Tuple& value, hpx::util::zip_iterator const& iter, hpx::util::index_pack) @@ -132,7 +136,7 @@ namespace hpx::parallel::traits { } } // namespace detail - template + HPX_CXX_EXPORT template struct vector_pack_store, ValueType> { template diff --git a/libs/core/algorithms/include/hpx/parallel/run_on_all.hpp b/libs/core/algorithms/include/hpx/parallel/run_on_all.hpp index a234690719a0..1ae3e499dba1 100644 --- a/libs/core/algorithms/include/hpx/parallel/run_on_all.hpp +++ b/libs/core/algorithms/include/hpx/parallel/run_on_all.hpp @@ -30,7 +30,8 @@ namespace hpx::experimental { /// \cond NOINTERNAL namespace detail { - template + HPX_CXX_EXPORT template decltype(auto) run_on_all( ExPolicy&& policy, F&& f, Reductions&&... reductions) { @@ -132,7 +133,7 @@ namespace hpx::experimental { /// invoke (last argument) /// \param ts The list of reductions and the function to invoke (last /// argument) - template + HPX_CXX_EXPORT template requires(hpx::is_execution_policy_v) decltype(auto) run_on_all(ExPolicy&& policy, T&& t, Ts&&... ts) { @@ -152,7 +153,7 @@ namespace hpx::experimental { /// invoke (last argument) /// \param ts The list of reductions and the function to invoke (last /// argument) - template + HPX_CXX_EXPORT template requires(!hpx::is_execution_policy_v) decltype(auto) run_on_all(T&& t, Ts&&... ts) { diff --git a/libs/core/algorithms/include/hpx/parallel/spmd_block.hpp b/libs/core/algorithms/include/hpx/parallel/spmd_block.hpp index 420081514d84..f6e4fbd12f49 100644 --- a/libs/core/algorithms/include/hpx/parallel/spmd_block.hpp +++ b/libs/core/algorithms/include/hpx/parallel/spmd_block.hpp @@ -34,7 +34,7 @@ namespace hpx::lcos::local { /// diffused to each image. The constraint for the function (or lambda) /// given to the define_spmd_block function is to accept a spmd_block as /// first parameter. - struct spmd_block + HPX_CXX_EXPORT struct spmd_block { private: using barrier_type = hpx::barrier<>; @@ -140,7 +140,7 @@ namespace hpx::lcos::local { namespace detail { - template + HPX_CXX_EXPORT template struct spmd_block_helper { private: @@ -167,7 +167,7 @@ namespace hpx::lcos::local { } // namespace detail // Asynchronous version - template >> decltype(auto) define_spmd_block( ExPolicy&& policy, std::size_t num_images, F&& f, Args&&... args) @@ -207,7 +207,7 @@ namespace hpx::lcos::local { } // Synchronous version - template >> void define_spmd_block( @@ -246,7 +246,7 @@ namespace hpx::lcos::local { hpx::util::counting_shape(num_images), HPX_FORWARD(Args, args)...); } - template + HPX_CXX_EXPORT template void define_spmd_block(std::size_t num_images, F&& f, Args&&... args) { define_spmd_block(hpx::execution::par, num_images, HPX_FORWARD(F, f), @@ -264,10 +264,10 @@ namespace hpx::parallel { /// diffused to each image. The constraint for the function (or lambda) /// given to the define_spmd_block function is to accept a spmd_block as /// first parameter. - using spmd_block = hpx::lcos::local::spmd_block; + HPX_CXX_EXPORT using spmd_block = hpx::lcos::local::spmd_block; // Asynchronous version - template >> decltype(auto) define_spmd_block( ExPolicy&& policy, std::size_t num_images, F&& f, Args&&... args) @@ -278,7 +278,7 @@ namespace hpx::parallel { } // Synchronous version - template >> void define_spmd_block( @@ -288,7 +288,7 @@ namespace hpx::parallel { num_images, HPX_FORWARD(F, f), HPX_FORWARD(Args, args)...); } - template + HPX_CXX_EXPORT template void define_spmd_block(std::size_t num_images, F&& f, Args&&... args) { hpx::lcos::local::define_spmd_block(hpx::execution::par, num_images, diff --git a/libs/core/algorithms/include/hpx/parallel/task_block.hpp b/libs/core/algorithms/include/hpx/parallel/task_block.hpp index 15605ce2d14d..bdbf479168d4 100644 --- a/libs/core/algorithms/include/hpx/parallel/task_block.hpp +++ b/libs/core/algorithms/include/hpx/parallel/task_block.hpp @@ -31,13 +31,14 @@ namespace hpx::experimental { namespace detail { - struct define_task_block_impl; + HPX_CXX_EXPORT struct define_task_block_impl; } // namespace detail /// The class \a task_canceled_exception defines the type of objects thrown /// by task_block::run or task_block::wait if they detect that an exception /// is pending within the current parallel region. - class HPX_ALWAYS_EXPORT task_canceled_exception : public hpx::exception + HPX_CXX_EXPORT class HPX_ALWAYS_EXPORT task_canceled_exception + : public hpx::exception { public: task_canceled_exception() noexcept @@ -88,7 +89,8 @@ namespace hpx::experimental { /// \tparam ExPolicy The execution policy an instance of a \a task_block was /// created with. This defaults to \a parallel_policy. /// - template + HPX_CXX_EXPORT template class task_block { private: @@ -302,7 +304,7 @@ namespace hpx::experimental { namespace detail { /// \cond NOINTERNAL - struct define_task_block_impl + HPX_CXX_EXPORT struct define_task_block_impl { template void operator()(ExPolicy&& policy, F&& f) const @@ -325,7 +327,8 @@ namespace hpx::experimental { } }; - inline constexpr define_task_block_impl define_task_block{}; + HPX_CXX_EXPORT inline constexpr define_task_block_impl + define_task_block{}; /// \endcond } // namespace detail @@ -354,7 +357,7 @@ namespace hpx::experimental { /// \note It is expected (but not mandated) that f will (directly or /// indirectly) call tr.run(_callable_object_). /// - template + HPX_CXX_EXPORT template requires(hpx::is_execution_policy_v>) decltype(auto) define_task_block(ExPolicy&& policy, F&& f) { @@ -391,7 +394,7 @@ namespace hpx::experimental { /// \note It is expected (but not mandated) that f will (directly or /// indirectly) call tr.run(_callable_object_). /// - template + HPX_CXX_EXPORT template void define_task_block(F&& f) { detail::define_task_block(hpx::execution::par, HPX_FORWARD(F, f)); @@ -422,7 +425,7 @@ namespace hpx::experimental { /// \note It is expected (but not mandated) that f will (directly or /// indirectly) call tr.run(_callable_object_). /// - template + HPX_CXX_EXPORT template hpx::parallel::util::detail::algorithm_result_t define_task_block_restore_thread(ExPolicy&& policy, F&& f) { @@ -458,7 +461,7 @@ namespace hpx::experimental { /// \note It is expected (but not mandated) that f will (directly or /// indirectly) call tr.run(_callable_object_). /// - template + HPX_CXX_EXPORT template void define_task_block_restore_thread(F&& f) { // By design, we always return on the same (HPX-) thread as we started @@ -471,7 +474,7 @@ namespace hpx::experimental { /// \cond NOINTERNAL namespace std { - template + HPX_CXX_EXPORT template hpx::experimental::task_block* addressof( hpx::experimental::task_block&) = delete; } @@ -537,5 +540,4 @@ namespace hpx::parallel { { return hpx::experimental::define_task_block_restore_thread(f); } - } // namespace hpx::parallel diff --git a/libs/core/algorithms/include/hpx/parallel/task_group.hpp b/libs/core/algorithms/include/hpx/parallel/task_group.hpp index 37b9e7d6ce2e..937bb7d1b662 100644 --- a/libs/core/algorithms/include/hpx/parallel/task_group.hpp +++ b/libs/core/algorithms/include/hpx/parallel/task_group.hpp @@ -32,7 +32,7 @@ namespace hpx::experimental { /// A \c task_group represents concurrent execution of a group of tasks. /// Tasks can be dynamically added to the group while it is executing. - class task_group + HPX_CXX_EXPORT class task_group { public: HPX_CORE_EXPORT task_group(); diff --git a/libs/core/algorithms/include/hpx/parallel/unseq/loop.hpp b/libs/core/algorithms/include/hpx/parallel/unseq/loop.hpp index ed98794d46e6..cf9179d53d2d 100644 --- a/libs/core/algorithms/include/hpx/parallel/unseq/loop.hpp +++ b/libs/core/algorithms/include/hpx/parallel/unseq/loop.hpp @@ -23,7 +23,7 @@ namespace hpx::parallel::util { namespace detail { /////////////////////////////////////////////////////////////////////// - struct unseq_loop_n + HPX_CXX_EXPORT struct unseq_loop_n { template HPX_HOST_DEVICE HPX_FORCEINLINE static InIter call( @@ -54,7 +54,7 @@ namespace hpx::parallel::util { } }; - struct unseq_loop_n_ind + HPX_CXX_EXPORT struct unseq_loop_n_ind { template HPX_HOST_DEVICE HPX_FORCEINLINE static InIter call( @@ -74,7 +74,7 @@ namespace hpx::parallel::util { }; /////////////////////////////////////////////////////////////////////// - struct unseq_loop + HPX_CXX_EXPORT struct unseq_loop { template HPX_HOST_DEVICE HPX_FORCEINLINE static constexpr Begin call( @@ -109,7 +109,7 @@ namespace hpx::parallel::util { } }; - struct unseq_loop_ind + HPX_CXX_EXPORT struct unseq_loop_ind { template HPX_HOST_DEVICE HPX_FORCEINLINE static constexpr Begin call( @@ -132,7 +132,7 @@ namespace hpx::parallel::util { }; /////////////////////////////////////////////////////////////////////// - struct unseq_loop2 + HPX_CXX_EXPORT struct unseq_loop2 { template HPX_HOST_DEVICE HPX_FORCEINLINE static std::pair @@ -168,7 +168,7 @@ namespace hpx::parallel::util { }; /////////////////////////////////////////////////////////////////////// - struct unseq_loop_idx_n + HPX_CXX_EXPORT struct unseq_loop_idx_n { template HPX_HOST_DEVICE HPX_FORCEINLINE static Iter call( @@ -200,7 +200,7 @@ namespace hpx::parallel::util { } }; - template + HPX_CXX_EXPORT template struct unseq_loop_with_cleanup_n { /////////////////////////////////////////////////////////////////// @@ -267,7 +267,7 @@ namespace hpx::parallel::util { { HPX_INVOKE(f, it++, dest++); } - //clang-format on + // clang-format on return dest; } @@ -311,7 +311,7 @@ namespace hpx::parallel::util { } // namespace detail /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE Begin tag_invoke( hpx::parallel::util::loop_t, hpx::execution::unsequenced_policy, Begin HPX_RESTRICT begin, End HPX_RESTRICT end, F&& f) @@ -319,7 +319,7 @@ namespace hpx::parallel::util { return detail::unseq_loop::call(begin, end, HPX_FORWARD(F, f)); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE Begin tag_invoke( hpx::parallel::util::loop_t, hpx::execution::unsequenced_task_policy, Begin HPX_RESTRICT begin, End HPX_RESTRICT end, F&& f) @@ -328,7 +328,8 @@ namespace hpx::parallel::util { } /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE Begin tag_invoke( hpx::parallel::util::loop_t, hpx::execution::unsequenced_policy, Begin HPX_RESTRICT begin, End HPX_RESTRICT end, CancelToken& tok, F&& f) @@ -336,7 +337,8 @@ namespace hpx::parallel::util { return detail::unseq_loop::call(begin, end, tok, HPX_FORWARD(F, f)); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE Begin tag_invoke( hpx::parallel::util::loop_t, hpx::execution::unsequenced_task_policy, Begin HPX_RESTRICT begin, End HPX_RESTRICT end, CancelToken& tok, F&& f) @@ -345,7 +347,7 @@ namespace hpx::parallel::util { } /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE Begin tag_invoke( hpx::parallel::util::loop_ind_t, Begin HPX_RESTRICT begin, End HPX_RESTRICT end, F&& f) @@ -353,7 +355,8 @@ namespace hpx::parallel::util { return detail::unseq_loop_ind::call(begin, end, HPX_FORWARD(F, f)); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE Begin tag_invoke( hpx::parallel::util::loop_ind_t< hpx::execution::unsequenced_task_policy>, @@ -363,7 +366,8 @@ namespace hpx::parallel::util { } /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr std::enable_if_t< hpx::is_unsequenced_execution_policy_v, std::pair> @@ -376,7 +380,7 @@ namespace hpx::parallel::util { } /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr std::enable_if_t< hpx::is_unsequenced_execution_policy_v, Iter> tag_invoke(hpx::parallel::util::loop_n_t, Iter HPX_RESTRICT it, @@ -386,8 +390,8 @@ namespace hpx::parallel::util { it, count, HPX_FORWARD(F, f)); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr std::enable_if_t< hpx::is_unsequenced_execution_policy_v, Iter> tag_invoke(hpx::parallel::util::loop_n_t, Iter HPX_RESTRICT it, @@ -398,7 +402,7 @@ namespace hpx::parallel::util { } /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr std::enable_if_t< hpx::is_unsequenced_execution_policy_v, Iter> tag_invoke(hpx::parallel::util::loop_n_ind_t, @@ -409,7 +413,7 @@ namespace hpx::parallel::util { } /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr std::enable_if_t< hpx::is_unsequenced_execution_policy_v, Iter> tag_invoke(hpx::parallel::util::loop_idx_n_t, @@ -419,8 +423,8 @@ namespace hpx::parallel::util { base_idx, it, count, HPX_FORWARD(F, f)); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr std::enable_if_t< hpx::is_unsequenced_execution_policy_v, Iter> tag_invoke(hpx::parallel::util::loop_idx_n_t, diff --git a/libs/core/algorithms/include/hpx/parallel/unseq/reduce.hpp b/libs/core/algorithms/include/hpx/parallel/unseq/reduce.hpp index d2dff3f5c2ce..a833a2439a53 100644 --- a/libs/core/algorithms/include/hpx/parallel/unseq/reduce.hpp +++ b/libs/core/algorithms/include/hpx/parallel/unseq/reduce.hpp @@ -21,13 +21,9 @@ namespace hpx::parallel::detail { /////////////////////////////////////////////////////////////////////////// - template - // clang-format off - requires ( - hpx::is_unsequenced_execution_policy_v - ) - // clang-format on + HPX_CXX_EXPORT template + requires(hpx::is_unsequenced_execution_policy_v) HPX_HOST_DEVICE HPX_FORCEINLINE constexpr T tag_invoke( sequential_reduce_t, ExPolicy&&, InIterB first, InIterE last, T init, Reduce&& r) @@ -46,12 +42,9 @@ namespace hpx::parallel::detail { } } - template - // clang-format off - requires ( - hpx::is_unsequenced_execution_policy_v - ) - // clang-format on + HPX_CXX_EXPORT template + requires(hpx::is_unsequenced_execution_policy_v) HPX_HOST_DEVICE HPX_FORCEINLINE constexpr T tag_invoke( sequential_reduce_t, FwdIter part_begin, std::size_t part_size, T init, Reduce r) @@ -69,13 +62,9 @@ namespace hpx::parallel::detail { } } - template - // clang-format off - requires ( - hpx::is_unsequenced_execution_policy_v - ) - // clang-format on + HPX_CXX_EXPORT template + requires(hpx::is_unsequenced_execution_policy_v) HPX_HOST_DEVICE HPX_FORCEINLINE constexpr T tag_invoke( sequential_reduce_t, ExPolicy&&, Iter first, Sent last, T init, Reduce&& r, Convert&& conv) @@ -95,13 +84,9 @@ namespace hpx::parallel::detail { } } - template - // clang-format off - requires ( - hpx::is_unsequenced_execution_policy_v - ) - // clang-format on + HPX_CXX_EXPORT template + requires(hpx::is_unsequenced_execution_policy_v) HPX_HOST_DEVICE HPX_FORCEINLINE constexpr T tag_invoke( sequential_reduce_t, Iter part_begin, std::size_t part_size, T init, Reduce r, Convert conv) @@ -119,13 +104,9 @@ namespace hpx::parallel::detail { } } - template - // clang-format off - requires ( - hpx::is_unsequenced_execution_policy_v - ) - // clang-format on + HPX_CXX_EXPORT template + requires(hpx::is_unsequenced_execution_policy_v) HPX_HOST_DEVICE HPX_FORCEINLINE constexpr T tag_invoke( sequential_reduce_t, Iter1 first1, Sent last1, Iter2 first2, T init, Reduce&& r, Convert&& conv) diff --git a/libs/core/algorithms/include/hpx/parallel/unseq/reduce_helpers.hpp b/libs/core/algorithms/include/hpx/parallel/unseq/reduce_helpers.hpp index 6fc0f9276314..9e2323dacfd6 100644 --- a/libs/core/algorithms/include/hpx/parallel/unseq/reduce_helpers.hpp +++ b/libs/core/algorithms/include/hpx/parallel/unseq/reduce_helpers.hpp @@ -22,49 +22,47 @@ namespace hpx::parallel::util::detail { /////////////////////////////////////////////////////////////////////////// #if defined(HPX_HAVE_VECTOR_REDUCTION) - // clang-format off - template typename Op> inline constexpr bool is_operation_v = std::is_same_v> || std::is_same_v>; - template + HPX_CXX_EXPORT template inline constexpr bool is_arithmetic_plus_reduction_v = std::is_arithmetic_v && is_operation_v; - template + HPX_CXX_EXPORT template inline constexpr bool is_arithmetic_minus_reduction_v = std::is_arithmetic_v && is_operation_v; - template + HPX_CXX_EXPORT template inline constexpr bool is_arithmetic_multiplies_reduction_v = std::is_arithmetic_v && is_operation_v; - template + HPX_CXX_EXPORT template inline constexpr bool is_arithmetic_bit_and_reduction_v = std::is_arithmetic_v && is_operation_v; - template + HPX_CXX_EXPORT template inline constexpr bool is_arithmetic_bit_or_reduction_v = std::is_arithmetic_v && is_operation_v; - template + HPX_CXX_EXPORT template inline constexpr bool is_arithmetic_bit_xor_reduction_v = std::is_arithmetic_v && is_operation_v; - template + HPX_CXX_EXPORT template inline constexpr bool is_arithmetic_logical_and_reduction_v = std::is_arithmetic_v && is_operation_v; - template + HPX_CXX_EXPORT template inline constexpr bool is_arithmetic_logical_or_reduction_v = std::is_arithmetic_v && is_operation_v; - // clang-format on - template + HPX_CXX_EXPORT template inline constexpr bool is_not_omp_reduction_v = !is_arithmetic_plus_reduction_v && !is_arithmetic_minus_reduction_v && @@ -75,13 +73,13 @@ namespace hpx::parallel::util::detail { !is_arithmetic_logical_and_reduction_v && !is_arithmetic_logical_or_reduction_v; #else - template + HPX_CXX_EXPORT template inline constexpr bool is_not_omp_reduction_v = true; #endif /////////////////////////////////////////////////////////////////////////// // Will only be called when the iterators are all random access - struct unseq_reduce_n + HPX_CXX_EXPORT struct unseq_reduce_n { #if defined(HPX_HAVE_VECTOR_REDUCTION) template @@ -269,7 +267,7 @@ namespace hpx::parallel::util::detail { /////////////////////////////////////////////////////////////////////////// // Will only be called when the iterators are all random access - struct unseq_binary_reduce_n + HPX_CXX_EXPORT struct unseq_binary_reduce_n { #if defined(HPX_HAVE_VECTOR_REDUCTION) template Iter unseq_first_n(Iter const first, IterDiff const n, F&& f) noexcept { - /* - OMP loops can not have ++Iter, only integral types are allowed - Hence perform arthemetic on Iterators - which is O(1) only in case of random access iterators - */ + // OMP loops can not have ++Iter, only integral types are allowed Hence + // perform arithmetic on Iterators which is O(1) only in case of random + // access iterators static_assert(hpx::traits::is_random_access_iterator_v, "algorithm is efficient only in case of Random Access Iterator"); + #if HPX_EARLYEXIT_PRESENT IterDiff i = 0; // clang-format off @@ -51,11 +49,13 @@ namespace hpx::parallel::util { return first + i; #else - // std::int32_t has best support for vectorization from compilers and hardware + // std::int32_t has best support for vectorization from compilers and + // hardware IterDiff i = 0; - static constexpr std::int32_t num_blocks = + constexpr std::int32_t num_blocks = HPX_LANE_SIZE / sizeof(std::int32_t); alignas(HPX_LANE_SIZE) std::int32_t simd_lane[num_blocks] = {0}; + while (i <= n - num_blocks) { std::int32_t found_flag = 0; @@ -85,7 +85,7 @@ namespace hpx::parallel::util { i += num_blocks; } - //Keep remainder scalar + // Keep remainder scalar while (i != n) { if (f(*(first + i))) @@ -95,7 +95,7 @@ namespace hpx::parallel::util { ++i; } return first + i; -#endif //HPX_EARLYEXIT_PRESENT +#endif // HPX_EARLYEXIT_PRESENT } template @@ -105,17 +105,18 @@ namespace hpx::parallel::util { #if HPX_EARLYEXIT_PRESENT IterDiff i = 0; - // clang-format off - HPX_PRAGMA_VECTOR_UNALIGNED HPX_PRAGMA_SIMD_EARLYEXIT - for (; i < n; ++i) + // clang-format offs + HPX_PRAGMA_VECTOR_UNALIGNED HPX_PRAGMA_SIMD_EARLYEXIT for (; i < n; ++i) + { if (f(*(first1 + i), *(first2 + i))) break; + } // clang-format on return std::make_pair(first1 + i, first2 + i); #else - static constexpr std::int32_t num_blocks = + constexpr std::int32_t num_blocks = HPX_LANE_SIZE / sizeof(std::int32_t); alignas(HPX_LANE_SIZE) std::int32_t simd_lane[num_blocks] = {0}; @@ -150,12 +151,14 @@ namespace hpx::parallel::util { outer_loop_ind += num_blocks; } - //Keep remainder scalar + // Keep remainder scalar for (; outer_loop_ind != n; ++outer_loop_ind) + { if (f(*(first1 + outer_loop_ind), *(first2 + outer_loop_ind))) break; + } return std::make_pair(first1 + outer_loop_ind, first2 + outer_loop_ind); -#endif //HPX_EARLYEXIT_PRESENT +#endif // HPX_EARLYEXIT_PRESENT } } // namespace hpx::parallel::util diff --git a/libs/core/algorithms/include/hpx/parallel/unseq/transform_loop.hpp b/libs/core/algorithms/include/hpx/parallel/unseq/transform_loop.hpp index b0cf832b9164..a5e757ffaba1 100644 --- a/libs/core/algorithms/include/hpx/parallel/unseq/transform_loop.hpp +++ b/libs/core/algorithms/include/hpx/parallel/unseq/transform_loop.hpp @@ -22,7 +22,7 @@ namespace hpx::parallel::util { namespace detail { /////////////////////////////////////////////////////////////////////// - struct unseq_transform_loop_n + HPX_CXX_EXPORT struct unseq_transform_loop_n { template HPX_HOST_DEVICE HPX_FORCEINLINE static std::pair @@ -56,7 +56,8 @@ namespace hpx::parallel::util { }; } // namespace detail - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr std::enable_if_t< hpx::is_unsequenced_execution_policy_v, std::pair> @@ -71,7 +72,7 @@ namespace hpx::parallel::util { namespace detail { /////////////////////////////////////////////////////////////////////// - struct unseq_transform_loop_n_ind + HPX_CXX_EXPORT struct unseq_transform_loop_n_ind { template HPX_HOST_DEVICE HPX_FORCEINLINE static std::pair @@ -105,7 +106,8 @@ namespace hpx::parallel::util { }; } // namespace detail - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr std::enable_if_t< hpx::is_unsequenced_execution_policy_v, std::pair> @@ -120,7 +122,7 @@ namespace hpx::parallel::util { namespace detail { /////////////////////////////////////////////////////////////////////// - struct unseq_transform_loop + HPX_CXX_EXPORT struct unseq_transform_loop { template HPX_HOST_DEVICE @@ -152,7 +154,8 @@ namespace hpx::parallel::util { }; } // namespace detail - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr util::in_out_result tag_invoke(hpx::parallel::util::transform_loop_t, @@ -163,7 +166,8 @@ namespace hpx::parallel::util { it, end, dest, HPX_FORWARD(F, f)); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr util::in_out_result tag_invoke(hpx::parallel::util::transform_loop_t, @@ -177,7 +181,7 @@ namespace hpx::parallel::util { namespace detail { /////////////////////////////////////////////////////////////////////// - struct unseq_transform_loop_ind + HPX_CXX_EXPORT struct unseq_transform_loop_ind { template HPX_HOST_DEVICE @@ -209,7 +213,8 @@ namespace hpx::parallel::util { }; } // namespace detail - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr util::in_out_result tag_invoke(hpx::parallel::util::transform_loop_ind_t, @@ -220,7 +225,8 @@ namespace hpx::parallel::util { it, end, dest, HPX_FORWARD(F, f)); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr util::in_out_result tag_invoke(hpx::parallel::util::transform_loop_ind_t, @@ -234,7 +240,7 @@ namespace hpx::parallel::util { namespace detail { /////////////////////////////////////////////////////////////////////// - struct unseq_transform_binary_loop_n + HPX_CXX_EXPORT struct unseq_transform_binary_loop_n { template @@ -273,8 +279,8 @@ namespace hpx::parallel::util { }; } // namespace detail - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE std::enable_if_t, hpx::tuple> @@ -289,7 +295,7 @@ namespace hpx::parallel::util { namespace detail { /////////////////////////////////////////////////////////////////////// - struct unseq_transform_binary_loop + HPX_CXX_EXPORT struct unseq_transform_binary_loop { template @@ -366,8 +372,8 @@ namespace hpx::parallel::util { }; } // namespace detail - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr std::enable_if_t< hpx::is_unsequenced_execution_policy_v, util::in_in_out_result> @@ -379,8 +385,8 @@ namespace hpx::parallel::util { first1, last1, first2, dest, HPX_FORWARD(F, f)); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr std::enable_if_t< hpx::is_unsequenced_execution_policy_v, util::in_in_out_result> @@ -396,7 +402,7 @@ namespace hpx::parallel::util { namespace detail { /////////////////////////////////////////////////////////////////////// - struct unseq_transform_binary_loop_ind_n + HPX_CXX_EXPORT struct unseq_transform_binary_loop_ind_n { template @@ -435,8 +441,8 @@ namespace hpx::parallel::util { }; } // namespace detail - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr std::enable_if_t< hpx::is_unsequenced_execution_policy_v, hpx::tuple> @@ -451,7 +457,7 @@ namespace hpx::parallel::util { namespace detail { /////////////////////////////////////////////////////////////////////// - struct unseq_transform_binary_loop_ind + HPX_CXX_EXPORT struct unseq_transform_binary_loop_ind { template @@ -528,8 +534,8 @@ namespace hpx::parallel::util { }; } // namespace detail - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr std::enable_if_t< hpx::is_unsequenced_execution_policy_v, util::in_in_out_result> @@ -541,8 +547,8 @@ namespace hpx::parallel::util { first1, last1, first2, dest, HPX_FORWARD(F, f)); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr std::enable_if_t< hpx::is_unsequenced_execution_policy_v, util::in_in_out_result> diff --git a/libs/core/algorithms/include/hpx/parallel/util/adapt_placement_mode.hpp b/libs/core/algorithms/include/hpx/parallel/util/adapt_placement_mode.hpp index 7be89e33ff39..f7a6ec6d5c7a 100644 --- a/libs/core/algorithms/include/hpx/parallel/util/adapt_placement_mode.hpp +++ b/libs/core/algorithms/include/hpx/parallel/util/adapt_placement_mode.hpp @@ -8,13 +8,12 @@ #include #include -#include #include #include namespace hpx::execution::experimental { - template + HPX_CXX_EXPORT template requires(hpx::is_execution_policy_v) decltype(auto) adapt_placement_mode( ExPolicy&& policy, hpx::threads::thread_placement_hint placement) @@ -52,13 +51,11 @@ namespace hpx::parallel::util { template requires(hpx::is_execution_policy_v) - // clang-format off HPX_DEPRECATED_V(1, 11, "hpx::parallel::util::adapt_placement_mode is deprecated. Please use " "hpx::execution::experimental::adapt_placement_mode instead.") - // clang-format on - decltype(auto) adapt_placement_mode( - ExPolicy&& policy, hpx::threads::thread_placement_hint placement) + decltype(auto) adapt_placement_mode( + ExPolicy&& policy, hpx::threads::thread_placement_hint placement) { return hpx::execution::experimental::adapt_placement_mode( HPX_FORWARD(ExPolicy, policy), placement); diff --git a/libs/core/algorithms/include/hpx/parallel/util/adapt_sharing_mode.hpp b/libs/core/algorithms/include/hpx/parallel/util/adapt_sharing_mode.hpp index 83cc79a52632..fb8f4604bf89 100644 --- a/libs/core/algorithms/include/hpx/parallel/util/adapt_sharing_mode.hpp +++ b/libs/core/algorithms/include/hpx/parallel/util/adapt_sharing_mode.hpp @@ -14,7 +14,7 @@ namespace hpx::execution::experimental { - template + HPX_CXX_EXPORT template requires(hpx::is_execution_policy_v) decltype(auto) adapt_sharing_mode( ExPolicy&& policy, hpx::threads::thread_sharing_hint sharing) @@ -52,13 +52,11 @@ namespace hpx::parallel::util { template requires(hpx::is_execution_policy_v) - // clang-format off HPX_DEPRECATED_V(1, 11, "hpx::parallel::util::adapt_sharing_mode is deprecated. Please use " "hpx::execution::experimental::adapt_sharing_mode instead.") - // clang-format on - decltype(auto) adapt_sharing_mode( - ExPolicy&& policy, hpx::threads::thread_sharing_hint sharing) + decltype(auto) adapt_sharing_mode( + ExPolicy&& policy, hpx::threads::thread_sharing_hint sharing) { return hpx::execution::experimental::adapt_sharing_mode( HPX_FORWARD(ExPolicy, policy), sharing); diff --git a/libs/core/algorithms/include/hpx/parallel/util/adapt_thread_priority.hpp b/libs/core/algorithms/include/hpx/parallel/util/adapt_thread_priority.hpp index b06eefdd439a..4ef88da9be78 100644 --- a/libs/core/algorithms/include/hpx/parallel/util/adapt_thread_priority.hpp +++ b/libs/core/algorithms/include/hpx/parallel/util/adapt_thread_priority.hpp @@ -14,7 +14,7 @@ namespace hpx::execution::experimental { - template + HPX_CXX_EXPORT template requires(hpx::is_execution_policy_v) decltype(auto) adapt_thread_priority( ExPolicy&& policy, hpx::threads::thread_priority new_priority) @@ -54,7 +54,6 @@ namespace hpx::parallel::util { HPX_DEPRECATED_V(1, 11, "hpx::parallel::util::adapt_thread_priority is deprecated. Please use " "hpx::execution::experimental::adapt_thread_priority instead.") - // clang-format on decltype(auto) adapt_thread_priority( ExPolicy&& policy, hpx::threads::thread_priority new_priority) { diff --git a/libs/core/algorithms/include/hpx/parallel/util/cancellation_token.hpp b/libs/core/algorithms/include/hpx/parallel/util/cancellation_token.hpp index 71a261702f08..f6ae9637ea9e 100644 --- a/libs/core/algorithms/include/hpx/parallel/util/cancellation_token.hpp +++ b/libs/core/algorithms/include/hpx/parallel/util/cancellation_token.hpp @@ -17,12 +17,13 @@ namespace hpx::parallel::util { namespace detail { - struct no_data; + HPX_CXX_EXPORT struct no_data; } // namespace detail /////////////////////////////////////////////////////////////////////////// // cancellation_token is used for premature cancellation of algorithms - template > + HPX_CXX_EXPORT template > class cancellation_token { using flag_type = std::atomic; diff --git a/libs/core/algorithms/include/hpx/parallel/util/compare_projected.hpp b/libs/core/algorithms/include/hpx/parallel/util/compare_projected.hpp index 0a1c5e0e5f09..436a6f88cabf 100644 --- a/libs/core/algorithms/include/hpx/parallel/util/compare_projected.hpp +++ b/libs/core/algorithms/include/hpx/parallel/util/compare_projected.hpp @@ -16,11 +16,11 @@ namespace hpx::parallel::util { /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct compare_projected; /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct compare_projected { template @@ -41,7 +41,7 @@ namespace hpx::parallel::util { Proj proj_; }; - template + HPX_CXX_EXPORT template struct compare_projected { template @@ -60,7 +60,7 @@ namespace hpx::parallel::util { }; /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct compare_projected { template @@ -84,7 +84,7 @@ namespace hpx::parallel::util { Proj2 proj2_; }; - template + HPX_CXX_EXPORT template struct compare_projected { template @@ -106,7 +106,7 @@ namespace hpx::parallel::util { Proj2 proj2_; }; - template + HPX_CXX_EXPORT template struct compare_projected { template @@ -128,7 +128,7 @@ namespace hpx::parallel::util { Proj1 proj1_; }; - template + HPX_CXX_EXPORT template struct compare_projected { template diff --git a/libs/core/algorithms/include/hpx/parallel/util/detail/algorithm_result.hpp b/libs/core/algorithms/include/hpx/parallel/util/detail/algorithm_result.hpp index 4e28940f8c38..68d8bf299f5a 100644 --- a/libs/core/algorithms/include/hpx/parallel/util/detail/algorithm_result.hpp +++ b/libs/core/algorithms/include/hpx/parallel/util/detail/algorithm_result.hpp @@ -26,10 +26,11 @@ namespace hpx::parallel::util::detail { /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct algorithm_result_impl; - template + HPX_CXX_EXPORT template struct algorithm_result_impl && !hpx::execution_policy_has_scheduler_executor_v>> @@ -57,7 +58,7 @@ namespace hpx::parallel::util::detail { } }; - template + HPX_CXX_EXPORT template struct algorithm_result_impl && !hpx::execution_policy_has_scheduler_executor_v>> @@ -82,7 +83,7 @@ namespace hpx::parallel::util::detail { } }; - template + HPX_CXX_EXPORT template struct algorithm_result_impl && !hpx::execution_policy_has_scheduler_executor_v>> @@ -102,7 +103,7 @@ namespace hpx::parallel::util::detail { } }; - template + HPX_CXX_EXPORT template struct algorithm_result_impl && !hpx::execution_policy_has_scheduler_executor_v>> @@ -133,7 +134,7 @@ namespace hpx::parallel::util::detail { } }; - template + HPX_CXX_EXPORT template struct algorithm_result_impl && hpx::execution_policy_has_scheduler_executor_v>> @@ -173,7 +174,7 @@ namespace hpx::parallel::util::detail { } }; - template + HPX_CXX_EXPORT template struct algorithm_result_impl && hpx::execution_policy_has_scheduler_executor_v>> @@ -195,7 +196,7 @@ namespace hpx::parallel::util::detail { } }; - template + HPX_CXX_EXPORT template struct algorithm_result_impl && hpx::execution_policy_has_scheduler_executor_v>> @@ -219,7 +220,7 @@ namespace hpx::parallel::util::detail { } }; - template + HPX_CXX_EXPORT template struct algorithm_result_impl && hpx::execution_policy_has_scheduler_executor_v>> @@ -243,19 +244,19 @@ namespace hpx::parallel::util::detail { }; /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct algorithm_result : algorithm_result_impl, T> { static_assert(!std::is_lvalue_reference_v, "T shouldn't be a lvalue reference"); }; - template + HPX_CXX_EXPORT template using algorithm_result_t = typename algorithm_result::type; /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template // clang-format off requires ( !hpx::execution::experimental::is_sender_v && @@ -268,12 +269,8 @@ namespace hpx::parallel::util::detail { return HPX_INVOKE(conv, val); } - template - // clang-format off - requires ( - hpx::execution::experimental::is_sender_v - ) - // clang-format on + HPX_CXX_EXPORT template + requires(hpx::execution::experimental::is_sender_v) constexpr decltype(auto) convert_to_result(Sender&& sender, Conv&& conv) { return hpx::execution::experimental::then(HPX_FORWARD(Sender, sender), @@ -282,7 +279,7 @@ namespace hpx::parallel::util::detail { }); } - template + HPX_CXX_EXPORT template requires(hpx::is_invocable_v) hpx::future> convert_to_result( hpx::future&& f, Conv&& conv) diff --git a/libs/core/algorithms/include/hpx/parallel/util/detail/chunk_size.hpp b/libs/core/algorithms/include/hpx/parallel/util/detail/chunk_size.hpp index 288e7a68b9c4..768f061e3dea 100644 --- a/libs/core/algorithms/include/hpx/parallel/util/detail/chunk_size.hpp +++ b/libs/core/algorithms/include/hpx/parallel/util/detail/chunk_size.hpp @@ -26,7 +26,7 @@ namespace hpx::parallel::util::detail { /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template // requires traits::is_future void add_ready_future( std::vector& workitems, F&& f, FwdIter first, std::size_t count) @@ -35,7 +35,7 @@ namespace hpx::parallel::util::detail { hpx::make_ready_future(HPX_FORWARD(F, f)(first, count))); } - template + HPX_CXX_EXPORT template void add_ready_future(std::vector>& workitems, F&& f, FwdIter first, std::size_t count) { @@ -43,7 +43,7 @@ namespace hpx::parallel::util::detail { workitems.push_back(hpx::make_ready_future()); } - template + HPX_CXX_EXPORT template void add_ready_future(std::vector>& workitems, F&& f, FwdIter first, std::size_t count) { @@ -52,9 +52,9 @@ namespace hpx::parallel::util::detail { } //////////////////////////////////////////////////////////////////////////// - constexpr void adjust_chunk_size_and_max_chunks(std::size_t const cores, - std::size_t const count, std::size_t& max_chunks, - std::size_t& chunk_size, + HPX_CXX_EXPORT constexpr void adjust_chunk_size_and_max_chunks( + std::size_t const cores, std::size_t const count, + std::size_t& max_chunks, std::size_t& chunk_size, bool const has_variable_chunk_size = false) noexcept { if (max_chunks == 0) @@ -110,7 +110,7 @@ namespace hpx::parallel::util::detail { } //////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template constexpr auto next_or_subrange(IterOrR const& target, std::size_t first, [[maybe_unused]] std::size_t size) { @@ -125,7 +125,7 @@ namespace hpx::parallel::util::detail { } } - template hpx::util::iterator_range> get_bulk_iteration_shape(ExPolicy& policy, IterOrR& it_or_r, @@ -179,8 +179,8 @@ namespace hpx::parallel::util::detail { return hpx::util::iterator_range(shape_begin, shape_end); } - template + HPX_CXX_EXPORT template hpx::util::iterator_range> get_bulk_iteration_shape(ExPolicy& policy, std::vector& workitems, F1&& f1, IterOrR& it_or_r, std::size_t& count, Stride s = Stride(1)) @@ -260,7 +260,7 @@ namespace hpx::parallel::util::detail { return hpx::util::iterator_range(shape_begin, shape_end); } - template std::vector> get_bulk_iteration_shape_variable(ExPolicy& policy, IterOrR& it_or_r, @@ -334,8 +334,8 @@ namespace hpx::parallel::util::detail { return shape; } - template + HPX_CXX_EXPORT template decltype(auto) get_bulk_iteration_shape(std::false_type, ExPolicy& policy, std::vector& workitems, F1&& f1, FwdIter& begin, std::size_t& count, Stride s = Stride(1)) @@ -344,8 +344,8 @@ namespace hpx::parallel::util::detail { policy, workitems, HPX_FORWARD(F1, f1), begin, count, s); } - template + HPX_CXX_EXPORT template decltype(auto) get_bulk_iteration_shape(std::true_type, ExPolicy& policy, std::vector& workitems, F1&& f1, FwdIter& begin, std::size_t& count, Stride s = Stride(1)) @@ -355,7 +355,7 @@ namespace hpx::parallel::util::detail { } /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template void add_ready_future_idx(std::vector& workitems, F&& f, FwdIter first, std::size_t base_idx, std::size_t count) { @@ -363,7 +363,7 @@ namespace hpx::parallel::util::detail { hpx::make_ready_future(HPX_FORWARD(F, f)(first, count, base_idx))); } - template + HPX_CXX_EXPORT template void add_ready_future_idx(std::vector>& workitems, F&& f, FwdIter first, std::size_t base_idx, std::size_t count) { @@ -371,7 +371,7 @@ namespace hpx::parallel::util::detail { workitems.push_back(hpx::make_ready_future()); } - template + HPX_CXX_EXPORT template void add_ready_future_idx(std::vector>& workitems, F&& f, std::size_t base_idx, FwdIter first, std::size_t count) { @@ -379,7 +379,7 @@ namespace hpx::parallel::util::detail { workitems.push_back(hpx::make_ready_future()); } - template hpx::util::iterator_range< parallel::util::detail::chunk_size_idx_iterator> @@ -441,8 +441,8 @@ namespace hpx::parallel::util::detail { return hpx::util::iterator_range(shape_begin, shape_end); } - template + HPX_CXX_EXPORT template hpx::util::iterator_range< parallel::util::detail::chunk_size_idx_iterator> get_bulk_iteration_shape_idx(ExPolicy& policy, @@ -532,7 +532,7 @@ namespace hpx::parallel::util::detail { return hpx::util::iterator_range(shape_begin, shape_end); } - template std::vector> get_bulk_iteration_shape_idx_variable(ExPolicy& policy, FwdIter first, diff --git a/libs/core/algorithms/include/hpx/parallel/util/detail/chunk_size_iterator.hpp b/libs/core/algorithms/include/hpx/parallel/util/detail/chunk_size_iterator.hpp index 6896ef914aa0..4b687ac8926c 100644 --- a/libs/core/algorithms/include/hpx/parallel/util/detail/chunk_size_iterator.hpp +++ b/libs/core/algorithms/include/hpx/parallel/util/detail/chunk_size_iterator.hpp @@ -22,45 +22,45 @@ /////////////////////////////////////////////////////////////////////////////// namespace hpx::parallel::util::detail { - template + HPX_CXX_EXPORT template struct chunk_size_iterator_category; - template + HPX_CXX_EXPORT template struct chunk_size_iterator_category>> { using type = std::random_access_iterator_tag; }; - template + HPX_CXX_EXPORT template struct chunk_size_iterator_category>> { using type = hpx::traits::iter_category_t; }; - template + HPX_CXX_EXPORT template struct chunk_size_iterator_category>> { using type = hpx::traits::range_category_t; }; - template + HPX_CXX_EXPORT template struct chunk_size_iterator_category>> { using type = std::random_access_iterator_tag; }; - template + HPX_CXX_EXPORT template using chunk_size_iterator_category_t = typename chunk_size_iterator_category::type; - template + HPX_CXX_EXPORT template struct iterator_type; - template + HPX_CXX_EXPORT template struct iterator_type || hpx::traits::is_range_generator_v>> @@ -68,25 +68,25 @@ namespace hpx::parallel::util::detail { using type = T; }; - template + HPX_CXX_EXPORT template struct iterator_type>> { using type = Iterator; }; - template + HPX_CXX_EXPORT template struct iterator_type>> { using type = hpx::traits::range_iterator_t; }; - template + HPX_CXX_EXPORT template using iterator_type_t = typename iterator_type::type; /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct chunk_size_iterator : hpx::util::iterator_facade, hpx::tuple const, @@ -317,7 +317,7 @@ namespace hpx::parallel::util::detail { }; /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct chunk_size_idx_iterator : hpx::util::iterator_facade, hpx::tuple const, diff --git a/libs/core/algorithms/include/hpx/parallel/util/detail/clear_container.hpp b/libs/core/algorithms/include/hpx/parallel/util/detail/clear_container.hpp index 5b9597a0a030..218dc0c997a3 100644 --- a/libs/core/algorithms/include/hpx/parallel/util/detail/clear_container.hpp +++ b/libs/core/algorithms/include/hpx/parallel/util/detail/clear_container.hpp @@ -18,25 +18,25 @@ namespace hpx::parallel::util::detail { // make sure iterators embedded in function object that is attached to // futures are invalidated - template + HPX_CXX_EXPORT template constexpr void clear_container(Cont&&) noexcept { } - template + HPX_CXX_EXPORT template constexpr void clear_container(std::vector>& v) noexcept { v.clear(); } - template + HPX_CXX_EXPORT template constexpr void clear_container( std::vector>& v) noexcept { v.clear(); } - template + HPX_CXX_EXPORT template constexpr void clear_container(std::array, N>& arr) noexcept { for (auto& f : arr) @@ -45,7 +45,7 @@ namespace hpx::parallel::util::detail { } } - template + HPX_CXX_EXPORT template constexpr void clear_container( std::array, N>& arr) noexcept { diff --git a/libs/core/algorithms/include/hpx/parallel/util/detail/handle_exception_termination_handler.hpp b/libs/core/algorithms/include/hpx/parallel/util/detail/handle_exception_termination_handler.hpp index 745c7fd7de00..5d3153cb4f58 100644 --- a/libs/core/algorithms/include/hpx/parallel/util/detail/handle_exception_termination_handler.hpp +++ b/libs/core/algorithms/include/hpx/parallel/util/detail/handle_exception_termination_handler.hpp @@ -11,10 +11,13 @@ namespace hpx::parallel::util::detail { - using parallel_exception_termination_handler_type = hpx::function; + HPX_CXX_EXPORT using parallel_exception_termination_handler_type = + hpx::function; - HPX_CORE_EXPORT void set_parallel_exception_termination_handler( + HPX_CXX_EXPORT HPX_CORE_EXPORT void + set_parallel_exception_termination_handler( parallel_exception_termination_handler_type f); - [[noreturn]] HPX_CORE_EXPORT void parallel_exception_termination_handler(); + HPX_CXX_EXPORT [[noreturn]] HPX_CORE_EXPORT void + parallel_exception_termination_handler(); } // namespace hpx::parallel::util::detail diff --git a/libs/core/algorithms/include/hpx/parallel/util/detail/handle_local_exceptions.hpp b/libs/core/algorithms/include/hpx/parallel/util/detail/handle_local_exceptions.hpp index c5a444d797a1..72329e9dedc2 100644 --- a/libs/core/algorithms/include/hpx/parallel/util/detail/handle_local_exceptions.hpp +++ b/libs/core/algorithms/include/hpx/parallel/util/detail/handle_local_exceptions.hpp @@ -29,7 +29,7 @@ namespace hpx::parallel::util::detail { /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct handle_local_exceptions { /////////////////////////////////////////////////////////////////////// @@ -537,7 +537,7 @@ namespace hpx::parallel::util::detail { } }; - struct terminate_on_local_exceptions + HPX_CXX_EXPORT struct terminate_on_local_exceptions { /////////////////////////////////////////////////////////////////////// [[noreturn]] static void call(std::exception_ptr const&) @@ -771,7 +771,7 @@ namespace hpx::parallel::util::detail { }; // unseq et.al. need to terminate on exceptions - template + HPX_CXX_EXPORT template struct handle_local_exceptions>> : terminate_on_local_exceptions diff --git a/libs/core/algorithms/include/hpx/parallel/util/detail/handle_remote_exceptions.hpp b/libs/core/algorithms/include/hpx/parallel/util/detail/handle_remote_exceptions.hpp index 3c48f4bb9863..9fd0484c4f47 100644 --- a/libs/core/algorithms/include/hpx/parallel/util/detail/handle_remote_exceptions.hpp +++ b/libs/core/algorithms/include/hpx/parallel/util/detail/handle_remote_exceptions.hpp @@ -21,7 +21,7 @@ namespace hpx::parallel::util::detail { /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct handle_remote_exceptions { // std::bad_alloc has to be handled separately diff --git a/libs/core/algorithms/include/hpx/parallel/util/detail/partitioner_iteration.hpp b/libs/core/algorithms/include/hpx/parallel/util/detail/partitioner_iteration.hpp index 790e6ad84805..9850e4ad6ef2 100644 --- a/libs/core/algorithms/include/hpx/parallel/util/detail/partitioner_iteration.hpp +++ b/libs/core/algorithms/include/hpx/parallel/util/detail/partitioner_iteration.hpp @@ -18,7 +18,7 @@ namespace hpx::parallel::util::detail { // Hand-crafted function object allowing to replace a more complex // bind(hpx::functional::invoke_fused(), f1, _1) - template + HPX_CXX_EXPORT template struct partitioner_iteration { std::decay_t f_; @@ -60,7 +60,7 @@ namespace hpx::parallel::util::detail { namespace hpx::traits { - template + HPX_CXX_EXPORT template struct get_function_address< parallel::util::detail::partitioner_iteration> { @@ -72,7 +72,7 @@ namespace hpx::traits { } }; - template + HPX_CXX_EXPORT template struct get_function_annotation< parallel::util::detail::partitioner_iteration> { @@ -85,7 +85,7 @@ namespace hpx::traits { }; #if HPX_HAVE_ITTNOTIFY != 0 && !defined(HPX_HAVE_APEX) - template + HPX_CXX_EXPORT template struct get_function_annotation_itt< parallel::util::detail::partitioner_iteration> { @@ -98,4 +98,5 @@ namespace hpx::traits { }; #endif } // namespace hpx::traits + #endif diff --git a/libs/core/algorithms/include/hpx/parallel/util/detail/scoped_executor_parameters.hpp b/libs/core/algorithms/include/hpx/parallel/util/detail/scoped_executor_parameters.hpp index 964ec13ba5b0..d1955c4c5d5e 100644 --- a/libs/core/algorithms/include/hpx/parallel/util/detail/scoped_executor_parameters.hpp +++ b/libs/core/algorithms/include/hpx/parallel/util/detail/scoped_executor_parameters.hpp @@ -12,7 +12,7 @@ namespace hpx::parallel::util::detail { /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct scoped_executor_parameters { public: @@ -41,7 +41,7 @@ namespace hpx::parallel::util::detail { }; /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct scoped_executor_parameters_ref { public: diff --git a/libs/core/algorithms/include/hpx/parallel/util/detail/select_partitioner.hpp b/libs/core/algorithms/include/hpx/parallel/util/detail/select_partitioner.hpp index 7e39f4458d9b..547f7d3f0190 100644 --- a/libs/core/algorithms/include/hpx/parallel/util/detail/select_partitioner.hpp +++ b/libs/core/algorithms/include/hpx/parallel/util/detail/select_partitioner.hpp @@ -14,7 +14,8 @@ /////////////////////////////////////////////////////////////////////////////// namespace hpx::parallel::util::detail { - template class Partitioner, + HPX_CXX_EXPORT template class Partitioner, template class TaskPartitioner, typename Enable = void> struct select_partitioner { @@ -22,7 +23,8 @@ namespace hpx::parallel::util::detail { using apply = Partitioner; }; - template class Partitioner, + HPX_CXX_EXPORT template class Partitioner, template class TaskPartitioner> struct select_partitioner && diff --git a/libs/core/algorithms/include/hpx/parallel/util/detail/sender_util.hpp b/libs/core/algorithms/include/hpx/parallel/util/detail/sender_util.hpp index 569b59ac896c..6952ec3f23c4 100644 --- a/libs/core/algorithms/include/hpx/parallel/util/detail/sender_util.hpp +++ b/libs/core/algorithms/include/hpx/parallel/util/detail/sender_util.hpp @@ -21,7 +21,7 @@ namespace hpx::detail { // algorithm overloads, where one needs to bind an execution policy to an // algorithm for use in execution::then. Typically used together with // then_with_bound_algorithm. - template + HPX_CXX_EXPORT template struct bound_algorithm { std::decay_t policy; @@ -36,17 +36,17 @@ namespace hpx::detail { }; // Detects if the given type is a bound_algorithm. - template + HPX_CXX_EXPORT template struct is_bound_algorithm : std::false_type { }; - template + HPX_CXX_EXPORT template struct is_bound_algorithm> : std::true_type { }; - template + HPX_CXX_EXPORT template inline constexpr bool is_bound_algorithm_v = is_bound_algorithm::value; @@ -54,7 +54,8 @@ namespace hpx::detail { // take senders. Takes an execution policy, a predecessor sender, and an // "algorithm" (i.e. a tag) and applies then with the predecessor sender and // the execution policy bound to the algorithm. - template + HPX_CXX_EXPORT template decltype(auto) then_with_bound_algorithm( Predecessor&& predecessor, ExPolicy&& policy) { @@ -114,7 +115,7 @@ namespace hpx::detail { // of the usual execution policy). These overloads use a scheduler // based executor that is re-wrapped into an execution policy that is // then passed on to the underlying algorithm APIs. - template + HPX_CXX_EXPORT template // NOLINTNEXTLINE(bugprone-crtp-constructor-accessibility) struct tag_parallel_algorithm : hpx::functional::detail::tag_fallback { diff --git a/libs/core/algorithms/include/hpx/parallel/util/foreach_partitioner.hpp b/libs/core/algorithms/include/hpx/parallel/util/foreach_partitioner.hpp index 3b181ac5d8cd..4dae807e6e12 100644 --- a/libs/core/algorithms/include/hpx/parallel/util/foreach_partitioner.hpp +++ b/libs/core/algorithms/include/hpx/parallel/util/foreach_partitioner.hpp @@ -32,8 +32,8 @@ /////////////////////////////////////////////////////////////////////////////// namespace hpx::parallel::util::detail { - template + HPX_CXX_EXPORT template auto foreach_partition(ExPolicy policy, FwdIter first, std::size_t count, F&& f, ReShape&& reshape) { @@ -96,7 +96,7 @@ namespace hpx::parallel::util::detail { /////////////////////////////////////////////////////////////////////// // The static partitioner simply spawns one chunk of iterations for // each available core. - template + HPX_CXX_EXPORT template struct foreach_static_partitioner { using parameters_type = typename ExPolicy::executor_parameters_type; @@ -200,7 +200,7 @@ namespace hpx::parallel::util::detail { }; /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct foreach_task_static_partitioner { using parameters_type = typename ExPolicy::executor_parameters_type; @@ -353,7 +353,7 @@ namespace hpx::parallel::util { /////////////////////////////////////////////////////////////////////////// // ExPolicy: execution policy // Result: intermediate result type of first step (default: void) - template + HPX_CXX_EXPORT template struct foreach_partitioner : detail::select_partitioner, detail::foreach_static_partitioner, diff --git a/libs/core/algorithms/include/hpx/parallel/util/invoke_projected.hpp b/libs/core/algorithms/include/hpx/parallel/util/invoke_projected.hpp index 0a20e590b8f2..e5259f1d071b 100644 --- a/libs/core/algorithms/include/hpx/parallel/util/invoke_projected.hpp +++ b/libs/core/algorithms/include/hpx/parallel/util/invoke_projected.hpp @@ -18,7 +18,7 @@ namespace hpx::parallel::util { /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct invoke_projected { using pred_type = std::decay_t; @@ -51,7 +51,7 @@ namespace hpx::parallel::util { } }; - template + HPX_CXX_EXPORT template struct invoke_projected { using pred_type = std::decay_t; @@ -81,7 +81,7 @@ namespace hpx::parallel::util { }; /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct invoke_projected_ind { using pred_type = std::decay_t; @@ -107,7 +107,7 @@ namespace hpx::parallel::util { } }; - template + HPX_CXX_EXPORT template struct invoke_projected_ind { using pred_type = std::decay_t; diff --git a/libs/core/algorithms/include/hpx/parallel/util/loop.hpp b/libs/core/algorithms/include/hpx/parallel/util/loop.hpp index 61934f198db9..7bf23d79a130 100644 --- a/libs/core/algorithms/include/hpx/parallel/util/loop.hpp +++ b/libs/core/algorithms/include/hpx/parallel/util/loop.hpp @@ -31,7 +31,7 @@ namespace hpx::parallel::util { // Helper class to repeatedly call a function starting from a given // iterator position. - template + HPX_CXX_EXPORT template struct loop { /////////////////////////////////////////////////////////////////// @@ -101,7 +101,8 @@ namespace hpx::parallel::util { }; } // namespace detail - struct loop_t final : hpx::functional::detail::tag_fallback + HPX_CXX_EXPORT struct loop_t final + : hpx::functional::detail::tag_fallback { private: template @@ -125,9 +126,10 @@ namespace hpx::parallel::util { }; #if !defined(HPX_COMPUTE_DEVICE_CODE) - inline constexpr loop_t loop = loop_t{}; + HPX_CXX_EXPORT inline constexpr loop_t loop = loop_t{}; #else - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr decltype(auto) loop( ExPolicy&& policy, Begin begin, End end, F&& f) { @@ -135,7 +137,7 @@ namespace hpx::parallel::util { HPX_FORWARD(ExPolicy, policy), begin, end, HPX_FORWARD(F, f)); } - template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr decltype(auto) loop( ExPolicy&& policy, Begin begin, End end, CancelToken& tok, F&& f) @@ -150,7 +152,7 @@ namespace hpx::parallel::util { // Helper class to repeatedly call a function starting from a given // iterator position till the predicate returns true. - template + HPX_CXX_EXPORT template struct loop_pred { /////////////////////////////////////////////////////////////////// @@ -168,7 +170,7 @@ namespace hpx::parallel::util { }; } // namespace detail - template + HPX_CXX_EXPORT template struct loop_pred_t final : hpx::functional::detail::tag_fallback> { @@ -184,10 +186,11 @@ namespace hpx::parallel::util { }; #if !defined(HPX_COMPUTE_DEVICE_CODE) - template + HPX_CXX_EXPORT template inline constexpr loop_pred_t loop_pred = loop_pred_t{}; #else - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr decltype(auto) loop_pred( Begin begin, End end, Pred&& pred) { @@ -201,7 +204,7 @@ namespace hpx::parallel::util { // Helper class to repeatedly call a function starting from a given // iterator position. - template + HPX_CXX_EXPORT template struct loop_ind { /////////////////////////////////////////////////////////////////// @@ -249,7 +252,7 @@ namespace hpx::parallel::util { }; } // namespace detail - template + HPX_CXX_EXPORT template struct loop_ind_t final : hpx::functional::detail::tag_fallback> { @@ -275,10 +278,11 @@ namespace hpx::parallel::util { }; #if !defined(HPX_COMPUTE_DEVICE_CODE) - template + HPX_CXX_EXPORT template inline constexpr loop_ind_t loop_ind = loop_ind_t{}; #else - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr decltype(auto) loop_ind( Begin begin, End end, F&& f) { @@ -286,7 +290,7 @@ namespace hpx::parallel::util { begin, end, HPX_FORWARD(F, f)); } - template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr Begin loop_ind( Begin begin, End end, CancelToken& tok, F&& f) @@ -301,7 +305,7 @@ namespace hpx::parallel::util { // Helper class to repeatedly call a function starting from a given // iterator position. - template + HPX_CXX_EXPORT template struct loop2 { /////////////////////////////////////////////////////////////////// @@ -320,7 +324,7 @@ namespace hpx::parallel::util { }; } // namespace detail - template + HPX_CXX_EXPORT template struct loop2_t final : hpx::functional::detail::tag_fallback> { @@ -337,10 +341,10 @@ namespace hpx::parallel::util { }; #if !defined(HPX_COMPUTE_DEVICE_CODE) - template + HPX_CXX_EXPORT template inline constexpr loop2_t loop2 = loop2_t{}; #else - template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr decltype(auto) loop2( Begin1 begin1, End1 end1, Begin2 begin2, F&& f) @@ -355,7 +359,7 @@ namespace hpx::parallel::util { // Helper class to repeatedly call a function a given number of times // starting from a given iterator position. - struct loop_n_helper + HPX_CXX_EXPORT struct loop_n_helper { /////////////////////////////////////////////////////////////////// // handle sequences of non-futures @@ -438,7 +442,7 @@ namespace hpx::parallel::util { } // namespace detail /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct loop_n_t final : hpx::functional::detail::tag_fallback> { @@ -471,10 +475,10 @@ namespace hpx::parallel::util { }; #if !defined(HPX_COMPUTE_DEVICE_CODE) - template + HPX_CXX_EXPORT template inline constexpr loop_n_t loop_n = loop_n_t{}; #else - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr decltype(auto) loop_n( Iter it, std::size_t count, F&& f) { @@ -482,8 +486,8 @@ namespace hpx::parallel::util { it, count, HPX_FORWARD(F, f)); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr decltype(auto) loop_n( Iter it, std::size_t count, CancelToken& tok, F&& f) { @@ -497,7 +501,7 @@ namespace hpx::parallel::util { /////////////////////////////////////////////////////////////////////// // Helper class to repeatedly call a function a given number of times // starting from a given iterator position. - struct loop_n_ind_helper + HPX_CXX_EXPORT struct loop_n_ind_helper { /////////////////////////////////////////////////////////////////// // handle sequences of non-futures @@ -605,7 +609,7 @@ namespace hpx::parallel::util { } // namespace detail /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct loop_n_ind_t final : hpx::functional::detail::tag_fallback> { @@ -638,11 +642,11 @@ namespace hpx::parallel::util { }; #if !defined(HPX_COMPUTE_DEVICE_CODE) - template + HPX_CXX_EXPORT template inline constexpr loop_n_ind_t loop_n_ind = loop_n_ind_t{}; #else - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr decltype(auto) loop_n_ind( Iter it, std::size_t count, F&& f) { @@ -650,8 +654,8 @@ namespace hpx::parallel::util { it, count, HPX_FORWARD(F, f)); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr decltype(auto) loop_n_ind( Iter it, std::size_t count, CancelToken& tok, F&& f) { @@ -666,7 +670,7 @@ namespace hpx::parallel::util { // Helper class to repeatedly call a function a given number of times // starting from a given iterator position. If an exception is thrown, // the given cleanup function will be called. - struct loop_with_cleanup final + HPX_CXX_EXPORT struct loop_with_cleanup final : hpx::functional::detail::tag_fallback { /////////////////////////////////////////////////////////////////// @@ -799,11 +803,11 @@ namespace hpx::parallel::util { } // namespace detail #if !defined(HPX_COMPUTE_DEVICE_CODE) - inline constexpr detail::loop_with_cleanup loop_with_cleanup = - detail::loop_with_cleanup{}; + HPX_CXX_EXPORT inline constexpr detail::loop_with_cleanup + loop_with_cleanup = detail::loop_with_cleanup{}; #else - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr decltype(auto) loop_with_cleanup( ExPolicy&& policy, Begin begin, Sent end, F&& f, Cleanup&& cleanup) { @@ -812,8 +816,8 @@ namespace hpx::parallel::util { HPX_FORWARD(Cleanup, cleanup)); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr decltype(auto) loop_with_cleanup( ExPolicy&& policy, Begin begin, Sent end, Begin2 dest, F&& f, Cleanup&& cleanup) @@ -824,7 +828,8 @@ namespace hpx::parallel::util { } #endif - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE Begin tag_invoke( hpx::parallel::util::detail::loop_with_cleanup, hpx::execution::unsequenced_policy, Begin HPX_RESTRICT begin, Sent end, @@ -834,7 +839,8 @@ namespace hpx::parallel::util { begin, end, HPX_FORWARD(F, f), HPX_FORWARD(Cleanup, cleanup)); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE Begin tag_invoke( hpx::parallel::util::detail::loop_with_cleanup, hpx::execution::unsequenced_task_policy, Begin HPX_RESTRICT begin, @@ -844,8 +850,8 @@ namespace hpx::parallel::util { begin, end, HPX_FORWARD(F, f), HPX_FORWARD(Cleanup, cleanup)); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE Begin tag_invoke( hpx::parallel::util::detail::loop_with_cleanup, hpx::execution::unsequenced_policy, Begin HPX_RESTRICT begin, Sent end, @@ -855,8 +861,8 @@ namespace hpx::parallel::util { begin, end, dest, HPX_FORWARD(F, f), HPX_FORWARD(Cleanup, cleanup)); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE Begin tag_invoke( hpx::parallel::util::detail::loop_with_cleanup, hpx::execution::unsequenced_task_policy, Begin HPX_RESTRICT begin, @@ -870,7 +876,7 @@ namespace hpx::parallel::util { // Helper class to repeatedly call a function a given number of times // starting from a given iterator position. - struct loop_with_cleanup_n final + HPX_CXX_EXPORT struct loop_with_cleanup_n final : hpx::functional::detail::tag_fallback { /////////////////////////////////////////////////////////////////// @@ -1068,10 +1074,11 @@ namespace hpx::parallel::util { } // namespace detail #if !defined(HPX_COMPUTE_DEVICE_CODE) - inline constexpr detail::loop_with_cleanup_n loop_with_cleanup_n = - detail::loop_with_cleanup_n{}; + HPX_CXX_EXPORT inline constexpr detail::loop_with_cleanup_n + loop_with_cleanup_n = detail::loop_with_cleanup_n{}; #else - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr decltype(auto) loop_with_cleanup_n( ExPolicy&& policy, Begin begin, std::size_t n, F&& f, Cleanup&& cleanup) @@ -1081,8 +1088,8 @@ namespace hpx::parallel::util { HPX_FORWARD(Cleanup, cleanup)); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr decltype(auto) loop_with_cleanup_n(ExPolicy&& policy, Begin begin, std::size_t n, Begin2 dest, F&& f, Cleanup&& cleanup) @@ -1093,7 +1100,7 @@ namespace hpx::parallel::util { } #endif - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE Begin tag_invoke( hpx::parallel::util::detail::loop_with_cleanup_n, hpx::execution::unsequenced_policy, Begin HPX_RESTRICT begin, @@ -1103,7 +1110,7 @@ namespace hpx::parallel::util { begin, n, HPX_FORWARD(F, f), HPX_FORWARD(Cleanup, cleanup)); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE Begin tag_invoke( hpx::parallel::util::detail::loop_with_cleanup_n, hpx::execution::unsequenced_task_policy, Begin HPX_RESTRICT begin, @@ -1113,7 +1120,8 @@ namespace hpx::parallel::util { begin, n, HPX_FORWARD(F, f), HPX_FORWARD(Cleanup, cleanup)); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE Begin tag_invoke( hpx::parallel::util::detail::loop_with_cleanup_n, hpx::execution::unsequenced_policy, Begin HPX_RESTRICT begin, @@ -1123,7 +1131,8 @@ namespace hpx::parallel::util { begin, n, dest, HPX_FORWARD(F, f), HPX_FORWARD(Cleanup, cleanup)); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE Begin tag_invoke( hpx::parallel::util::detail::loop_with_cleanup_n, hpx::execution::unsequenced_task_policy, Begin HPX_RESTRICT begin, @@ -1133,7 +1142,8 @@ namespace hpx::parallel::util { begin, n, dest, HPX_FORWARD(F, f), HPX_FORWARD(Cleanup, cleanup)); } - template + HPX_CXX_EXPORT template requires(hpx::traits::is_iterator_v) HPX_FORCEINLINE constexpr Iter loop_with_cleanup_n_with_token( Iter it, std::size_t count, CancelToken& tok, F&& f, Cleanup&& cleanup) @@ -1143,8 +1153,8 @@ namespace hpx::parallel::util { HPX_FORWARD(Cleanup, cleanup)); } - template + HPX_CXX_EXPORT template requires(hpx::traits::is_iterator_v && hpx::traits::is_iterator_v) HPX_FORCEINLINE constexpr FwdIter loop_with_cleanup_n_with_token(Iter it, @@ -1156,8 +1166,8 @@ namespace hpx::parallel::util { HPX_FORWARD(Cleanup, cleanup)); } - template + HPX_CXX_EXPORT template requires(hpx::is_execution_policy_v && hpx::traits::is_iterator_v) HPX_FORCEINLINE constexpr Iter loop_with_cleanup_n_with_token( @@ -1169,7 +1179,7 @@ namespace hpx::parallel::util { HPX_FORWARD(Cleanup, cleanup)); } - template requires(hpx::is_execution_policy_v && hpx::traits::is_iterator_v && @@ -1188,7 +1198,7 @@ namespace hpx::parallel::util { // Helper class to repeatedly call a function a given number of times // starting from a given iterator position. - template + HPX_CXX_EXPORT template struct loop_idx_n { /////////////////////////////////////////////////////////////////// @@ -1304,7 +1314,7 @@ namespace hpx::parallel::util { } // namespace detail /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct loop_idx_n_t final : hpx::functional::detail::tag_fallback> { @@ -1332,11 +1342,11 @@ namespace hpx::parallel::util { }; #if !defined(HPX_COMPUTE_DEVICE_CODE) - template + HPX_CXX_EXPORT template inline constexpr loop_idx_n_t loop_idx_n = loop_idx_n_t{}; #else - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr decltype(auto) loop_idx_n( std::size_t base_idx, Iter it, std::size_t count, F&& f) { @@ -1344,8 +1354,8 @@ namespace hpx::parallel::util { base_idx, it, count, HPX_FORWARD(F, f)); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr decltype(auto) loop_idx_n( std::size_t base_idx, Iter it, std::size_t count, CancelToken& tok, F&& f) @@ -1360,7 +1370,7 @@ namespace hpx::parallel::util { // Helper class to repeatedly call a function a given number of times // starting from a given iterator position. - template + HPX_CXX_EXPORT template struct accumulate_n { template @@ -1377,7 +1387,7 @@ namespace hpx::parallel::util { } // namespace detail /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template HPX_FORCEINLINE constexpr T accumulate_n( Iter it, std::size_t count, T init, Pred&& f) { @@ -1386,8 +1396,8 @@ namespace hpx::parallel::util { it, count, HPX_MOVE(init), HPX_FORWARD(Pred, f)); } - template + HPX_CXX_EXPORT template HPX_FORCEINLINE constexpr T accumulate( Iter first, Sent last, Reduce&& r, Conv&& conv = Conv()) { @@ -1401,8 +1411,8 @@ namespace hpx::parallel::util { return val; } - template + HPX_CXX_EXPORT template HPX_FORCEINLINE constexpr T accumulate( Iter1 first1, Sent1 last1, Iter2 first2, Reduce&& r, Conv&& conv) { diff --git a/libs/core/algorithms/include/hpx/parallel/util/low_level.hpp b/libs/core/algorithms/include/hpx/parallel/util/low_level.hpp index 17b1541c1b68..67b7f2415276 100644 --- a/libs/core/algorithms/include/hpx/parallel/util/low_level.hpp +++ b/libs/core/algorithms/include/hpx/parallel/util/low_level.hpp @@ -24,8 +24,9 @@ namespace hpx::parallel::util { // \tparam Args : parameters for the constructor // \param [in] ptr : pointer to the memory where to create the object // \param [in] args : arguments to the constructor - template - void construct_object(Value* ptr, Args&&... args) + HPX_CXX_EXPORT template + void construct_object(Value* ptr, Args&&... args) noexcept( + noexcept(hpx::construct_at(ptr, HPX_FORWARD(Args, args)...))) { hpx::construct_at(ptr, HPX_FORWARD(Args, args)...); } @@ -33,8 +34,8 @@ namespace hpx::parallel::util { // \brief destroy an object in the memory specified by ptr // \tparam Value : typename of the object to create // \param [in] ptr : pointer to the object to destroy - template - void destroy_object(Value* ptr) + HPX_CXX_EXPORT template + void destroy_object(Value* ptr) noexcept { std::destroy_at(ptr); } @@ -45,7 +46,7 @@ namespace hpx::parallel::util { // \param [in] r : range of elements not initialized // \param [in] val : object used for the initialization // \returns range initialized - template + HPX_CXX_EXPORT template void init(Iter first, Sent last, hpx::traits::iter_value_t& val) { if (first == last) @@ -70,8 +71,9 @@ namespace hpx::parallel::util { // \tparam Args : parameters for the constructor // \param [in] ptr : pointer to the memory where to create the object // \param [in] args : arguments to the constructor - template - void construct(Value* ptr, Args&&... args) + HPX_CXX_EXPORT template + void construct(Value* ptr, Args&&... args) noexcept( + noexcept(hpx::construct_at(ptr, HPX_FORWARD(Args, args)...))) { hpx::construct_at(ptr, HPX_FORWARD(Args, args)...); } @@ -81,7 +83,7 @@ namespace hpx::parallel::util { // \tparam Value : typename of the object to create // \param [in] it_dest : iterator to the final place of the objects // \param [in] R : range to move - template + HPX_CXX_EXPORT template Iter2 init_move(Iter2 it_dest, Iter1 first, Sent1 last) { while (first != last) @@ -97,7 +99,7 @@ namespace hpx::parallel::util { // \tparam Value : typename of the object to construct // \param [in] ptr : pointer to the memory where to create the object // \param [in] R : range to move - template > Value* uninit_move(Value* ptr, Iter first, Sent last) { @@ -122,8 +124,8 @@ namespace hpx::parallel::util { // \param [in] last : range to initialize // \param [in] ptr : pointer to the memory where to construct the object // \param [in] R : range to move - template - void destroy(Iter first, Sent last) + HPX_CXX_EXPORT template + void destroy(Iter first, Sent last) noexcept { while (first != last) { @@ -139,7 +141,8 @@ namespace hpx::parallel::util { // \param [in] end_buf2 : final iterator of the second buffer // \param [in] buf_out : buffer where move the elements merged // \param [in] comp : comparison object - template + HPX_CXX_EXPORT template Iter2 full_merge(Iter1 buf1, Sent1 end_buf1, Iter1 buf2, Sent1 end_buf2, Iter2 buf_out, Compare comp) { @@ -169,7 +172,8 @@ namespace hpx::parallel::util { // \param [in] last22 : final iterator of the second buffer // \param [in] it_out : uninitialized buffer where move the elements merged // \param [in] comp : comparison object - template + HPX_CXX_EXPORT template Value* uninit_full_merge(Iter first1, Sent last1, Iter first2, Sent last2, Value* it_out, Compare comp) { @@ -202,8 +206,8 @@ namespace hpx::parallel::util { // \param [in] comp : object for Compare two elements of the type pointed // by the Iter1 and Iter2 // \note The elements pointed by Iter1 and Iter2 must be the same - template + HPX_CXX_EXPORT template Iter2 half_merge(Iter1 buf1, Sent1 end_buf1, Iter2 buf2, Sent2 end_buf2, Iter2 buf_out, Compare comp) { @@ -235,8 +239,8 @@ namespace hpx::parallel::util { // \exception // \returns true : not changes done // false : changes in the buffers - template + HPX_CXX_EXPORT template bool in_place_merge_uncontiguous(Iter1 src1, Sent1 end_src1, Iter2 src2, Sent2 end_src2, Iter3 aux, Compare comp) { @@ -295,7 +299,8 @@ namespace hpx::parallel::util { // \exception // \returns true : not changes done // false : changes in the buffers - template + HPX_CXX_EXPORT template bool in_place_merge( Iter1 src1, Iter1 src2, Sent1 end_src2, Iter2 buf, Compare comp) { diff --git a/libs/core/algorithms/include/hpx/parallel/util/merge_four.hpp b/libs/core/algorithms/include/hpx/parallel/util/merge_four.hpp index d10ffd10ae81..f227567a4011 100644 --- a/libs/core/algorithms/include/hpx/parallel/util/merge_four.hpp +++ b/libs/core/algorithms/include/hpx/parallel/util/merge_four.hpp @@ -30,7 +30,7 @@ namespace hpx::parallel::util { // \param [in] pos2 : position of the element pointed by it2 // \param [in] comp : comparison object // \return result of the comparison - template + HPX_CXX_EXPORT template bool less_range(Iter it1, std::uint32_t pos1, Sent it2, std::uint32_t pos2, Compare comp) { @@ -53,8 +53,8 @@ namespace hpx::parallel::util { // \param [in] nrange_input : number of ranges in R // \param [in] comp : comparison object // \return range with all the elements move with the size adjusted - template + HPX_CXX_EXPORT template util::range full_merge4(util::range& rdest, util::range vrange_input[4], std::uint32_t nrange_input, Compare comp) @@ -197,7 +197,8 @@ namespace hpx::parallel::util { // \param [in] nrange_input : number of ranges in vrange_input // \param [in] comp : comparison object // \return range with all the elements move with the size adjusted - template + HPX_CXX_EXPORT template util::range uninit_full_merge4(util::range const& dest, util::range vrange_input[4], std::uint32_t nrange_input, Compare comp) diff --git a/libs/core/algorithms/include/hpx/parallel/util/merge_vector.hpp b/libs/core/algorithms/include/hpx/parallel/util/merge_vector.hpp index ad5a54972de0..2e63809f11ce 100644 --- a/libs/core/algorithms/include/hpx/parallel/util/merge_vector.hpp +++ b/libs/core/algorithms/include/hpx/parallel/util/merge_vector.hpp @@ -29,8 +29,8 @@ namespace hpx::parallel::util { // \param [in] v_output : vector of ranges obtained // \param [in] comp : comparison object // \return range with all the elements moved - template + HPX_CXX_EXPORT template void merge_level4(util::range dest, std::vector>& v_input, std::vector>& v_output, Compare comp) @@ -75,7 +75,8 @@ namespace hpx::parallel::util { // \param [in] v_output : vector of ranges obtained // \param [in] comp : comparison object // \return range with all the elements moved - template + HPX_CXX_EXPORT template void uninit_merge_level4(util::range dest, std::vector>& v_input, std::vector>& v_output, Compare comp) @@ -122,8 +123,8 @@ namespace hpx::parallel::util { // \param [in] v_output : vector of ranges obtained // \param [in] comp : comparison object // \return range with all the elements moved - template + HPX_CXX_EXPORT template util::range merge_vector4( util::range range_input, util::range range_output, diff --git a/libs/core/algorithms/include/hpx/parallel/util/nbits.hpp b/libs/core/algorithms/include/hpx/parallel/util/nbits.hpp index 55b602def0d7..5d89ecf6be16 100644 --- a/libs/core/algorithms/include/hpx/parallel/util/nbits.hpp +++ b/libs/core/algorithms/include/hpx/parallel/util/nbits.hpp @@ -13,24 +13,24 @@ namespace hpx::parallel::util { - inline constexpr std::uint32_t tmsb[256] = {0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, - 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + HPX_CXX_EXPORT inline constexpr std::uint32_t tmsb[256] = {0, 1, 2, 2, 3, 3, + 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8}; + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8}; // \brief Obtain the number of bits equal or greater than num // \param [in] num : Number to examine // \exception none // \return Number of bits - constexpr std::uint32_t nbits32(std::uint32_t num) noexcept + HPX_CXX_EXPORT constexpr std::uint32_t nbits32(std::uint32_t num) noexcept { int Pos = num & 0xffff0000U ? 16 : 0; if (num >> Pos & 0xff00U) @@ -44,7 +44,7 @@ namespace hpx::parallel::util { // \param [in] num : Number to examine // \exception none // \return Number of bits - constexpr std::uint32_t nbits64(std::uint64_t num) noexcept + HPX_CXX_EXPORT constexpr std::uint32_t nbits64(std::uint64_t num) noexcept { uint32_t pos = num & 0xffffffff00000000ULL ? 32 : 0; if (num >> pos & 0xffff0000ULL) diff --git a/libs/core/algorithms/include/hpx/parallel/util/partitioner.hpp b/libs/core/algorithms/include/hpx/parallel/util/partitioner.hpp index ee5b70cb6c99..eb9d1062ca7f 100644 --- a/libs/core/algorithms/include/hpx/parallel/util/partitioner.hpp +++ b/libs/core/algorithms/include/hpx/parallel/util/partitioner.hpp @@ -35,7 +35,8 @@ /////////////////////////////////////////////////////////////////////////////// namespace hpx::parallel::util::detail { - template + HPX_CXX_EXPORT template auto partition(ExPolicy policy, IterOrR it_or_r, std::size_t count, F&& f) { // estimate a chunk size based on number of cores used @@ -85,8 +86,8 @@ namespace hpx::parallel::util::detail { } } - template + HPX_CXX_EXPORT template auto partition_with_index( ExPolicy policy, FwdIter first, std::size_t count, Stride stride, F&& f) { @@ -137,8 +138,8 @@ namespace hpx::parallel::util::detail { } } - template + HPX_CXX_EXPORT template // requires is_container std::vector> partition_with_data(ExPolicy&& policy, FwdIter first, std::size_t count, @@ -180,7 +181,7 @@ namespace hpx::parallel::util::detail { /////////////////////////////////////////////////////////////////////// // The static partitioner simply spawns one chunk of iterations for // each available core. - template + HPX_CXX_EXPORT template struct static_partitioner { using parameters_type = typename ExPolicy::executor_parameters_type; @@ -357,7 +358,7 @@ namespace hpx::parallel::util::detail { }; /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct task_static_partitioner { using parameters_type = typename ExPolicy::executor_parameters_type; @@ -518,7 +519,8 @@ namespace hpx::parallel::util { // ExPolicy: execution policy // R: overall result type // Result: intermediate result type of first step - template + HPX_CXX_EXPORT template struct partitioner : detail::select_partitioner, detail::static_partitioner, diff --git a/libs/core/algorithms/include/hpx/parallel/util/partitioner_with_cleanup.hpp b/libs/core/algorithms/include/hpx/parallel/util/partitioner_with_cleanup.hpp index 3a3b27aa8b06..ad44136aecd2 100644 --- a/libs/core/algorithms/include/hpx/parallel/util/partitioner_with_cleanup.hpp +++ b/libs/core/algorithms/include/hpx/parallel/util/partitioner_with_cleanup.hpp @@ -42,7 +42,7 @@ namespace hpx::parallel::util { // iterations for each available core. The number of iterations is // determined automatically based on the measured runtime of the // iterations. - template + HPX_CXX_EXPORT template struct static_partitioner_with_cleanup { using parameters_type = typename ExPolicy::executor_parameters_type; @@ -267,7 +267,7 @@ namespace hpx::parallel::util { }; /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct task_static_partitioner_with_cleanup { using parameters_type = typename ExPolicy::executor_parameters_type; @@ -372,7 +372,8 @@ namespace hpx::parallel::util { // ExPolicy: execution policy // R: overall result type // Result: intermediate result type of first step - template + HPX_CXX_EXPORT template struct partitioner_with_cleanup : detail::select_partitioner, detail::static_partitioner_with_cleanup, diff --git a/libs/core/algorithms/include/hpx/parallel/util/prefetching.hpp b/libs/core/algorithms/include/hpx/parallel/util/prefetching.hpp index d28fc95e3dd9..2083c89f30c8 100644 --- a/libs/core/algorithms/include/hpx/parallel/util/prefetching.hpp +++ b/libs/core/algorithms/include/hpx/parallel/util/prefetching.hpp @@ -33,7 +33,7 @@ namespace hpx::parallel::util { namespace prefetching { - template + HPX_CXX_EXPORT template class prefetching_iterator { public: @@ -202,7 +202,7 @@ namespace hpx::parallel::util { /////////////////////////////////////////////////////////////////////// // Helper class to initialize prefetching_iterator - template + HPX_CXX_EXPORT template struct prefetcher_context { private: @@ -244,7 +244,7 @@ namespace hpx::parallel::util { /////////////////////////////////////////////////////////////////////// #if defined(HPX_HAVE_MM_PREFETCH) - template + HPX_CXX_EXPORT template HPX_FORCEINLINE void prefetch_addresses(T const&... ts) { (_mm_prefetch(const_cast(reinterpret_cast(&ts)), @@ -252,14 +252,14 @@ namespace hpx::parallel::util { ...); } - template + HPX_CXX_EXPORT template HPX_FORCEINLINE void prefetch_containers(hpx::tuple const& t, hpx::util::index_pack, std::size_t idx) { prefetch_addresses(hpx::get(t).get()[idx]...); } #else - template + HPX_CXX_EXPORT template HPX_FORCEINLINE void prefetch_containers(hpx::tuple const& t, hpx::util::index_pack, std::size_t idx) { @@ -268,7 +268,7 @@ namespace hpx::parallel::util { #endif /////////////////////////////////////////////////////////////////////// - struct loop_n_helper + HPX_CXX_EXPORT struct loop_n_helper { template static constexpr prefetching_iterator call( @@ -340,7 +340,8 @@ namespace hpx::parallel::util { }; /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr prefetching_iterator tag_invoke(hpx::parallel::util::loop_n_t, @@ -351,7 +352,7 @@ namespace hpx::parallel::util { } /////////////////////////////////////////////////////////////////////// - struct loop_n_ind_helper + HPX_CXX_EXPORT struct loop_n_ind_helper { template static constexpr prefetching_iterator call( @@ -423,7 +424,8 @@ namespace hpx::parallel::util { }; /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr prefetching_iterator tag_invoke(hpx::parallel::util::loop_n_ind_t, @@ -436,7 +438,7 @@ namespace hpx::parallel::util { /////////////////////////////////////////////////////////////////////////// // function to create a prefetcher_context - template + HPX_CXX_EXPORT template prefetching::prefetcher_context make_prefetcher_context( Itr base_begin, Itr base_end, std::size_t p_factor, Ts const&... rngs) { @@ -453,8 +455,9 @@ namespace hpx::parallel::util { } namespace detail { + /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct loop> { using iterator_type = prefetching::prefetching_iterator; @@ -514,7 +517,7 @@ namespace hpx::parallel::util { }; /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct loop_ind> { using iterator_type = prefetching::prefetching_iterator; diff --git a/libs/core/algorithms/include/hpx/parallel/util/range.hpp b/libs/core/algorithms/include/hpx/parallel/util/range.hpp index 9990cff1a9a7..a05042db09c8 100644 --- a/libs/core/algorithms/include/hpx/parallel/util/range.hpp +++ b/libs/core/algorithms/include/hpx/parallel/util/range.hpp @@ -24,14 +24,14 @@ namespace hpx::parallel::util { // \struct range // \brief this represent a range between two iterators // \tparam Iter type of parameters of the range - template + HPX_CXX_EXPORT template using range = hpx::util::iterator_range; // \brief concatenate two contiguous ranges // \param [in] it1 : first range // \param [in] it2 : second range // \returns range resulting of the concatenation - template + HPX_CXX_EXPORT template range concat( range const& it1, range const& it2) { @@ -42,7 +42,8 @@ namespace hpx::parallel::util { /// \param [in] dest : range where move the objects /// \param [in] src : range from where move the objects /// \return range with the objects moved and the size adjusted - template + HPX_CXX_EXPORT template range init_move( range const& dest, range const& src) { @@ -68,7 +69,8 @@ namespace hpx::parallel::util { /// \param [in] src : range from where move the objects /// \return range with the objects moved and the size adjusted //----------------------------------------------------------------------------- - template + HPX_CXX_EXPORT template range uninit_move( range const& dest, range const& src) { @@ -90,7 +92,7 @@ namespace hpx::parallel::util { // function : destroy /// \brief destroy a range of objects /// \param [in] r : range to destroy - template + HPX_CXX_EXPORT template void destroy_range(range r) { destroy(r.begin(), r.end()); @@ -100,7 +102,7 @@ namespace hpx::parallel::util { /// \param [in] r : range of elements not initialized /// \param [in] val : object used for the initialization /// \return range initialized - template + HPX_CXX_EXPORT template range init(range const& r, typename std::iterator_traits::value_type& val) { @@ -115,8 +117,8 @@ namespace hpx::parallel::util { /// \return true : they can be merged /// false : they can't be merged /// \remarks - template + HPX_CXX_EXPORT template bool is_mergeable(range const& src1, range const& src2, Compare comp) { @@ -137,8 +139,8 @@ namespace hpx::parallel::util { /// \param [in] src2 : second range to merge /// \param [in] comp : comparison object /// \return range with the elements merged and the size adjusted - template + HPX_CXX_EXPORT template range full_merge(range const& dest, range const& src1, range const& src2, Compare comp) @@ -164,8 +166,8 @@ namespace hpx::parallel::util { /// \param [in] src2 : second range to merge /// \param [in] comp : comparison object /// \return range with the elements merged and the size adjusted - template + HPX_CXX_EXPORT template range uninit_full_merge(range const& dest, range const& src1, range const& src2, Compare comp) @@ -189,8 +191,8 @@ namespace hpx::parallel::util { /// \param [in] comp : object for compare two elements of the type pointed /// by the Iter1 and Iter2 /// \return : range with the two buffers merged - template + HPX_CXX_EXPORT template range half_merge(range const& dest, range const& src1, range const& src2, Compare comp) @@ -214,8 +216,8 @@ namespace hpx::parallel::util { /// \return true : not changes done /// false : changes in the buffers /// \remarks - template + HPX_CXX_EXPORT template bool in_place_merge_uncontiguous(range const& src1, range const& src2, range& aux, Compare comp) { @@ -239,8 +241,8 @@ namespace hpx::parallel::util { /// \return true : not changes done /// false : changes in the buffers /// \remarks - template + HPX_CXX_EXPORT template range in_place_merge(range const& src1, range const& src2, range& buf, Compare comp) { @@ -262,8 +264,8 @@ namespace hpx::parallel::util { // \param [in] comp : object for to compare elements // \returns true : not changes done // false : changes in the buffers - template + HPX_CXX_EXPORT template void merge_flow(range rng1, range rbuf, range rng2, Compare cmp) { diff --git a/libs/core/algorithms/include/hpx/parallel/util/ranges_facilities.hpp b/libs/core/algorithms/include/hpx/parallel/util/ranges_facilities.hpp index 9c15af110ac4..26528bba0186 100644 --- a/libs/core/algorithms/include/hpx/parallel/util/ranges_facilities.hpp +++ b/libs/core/algorithms/include/hpx/parallel/util/ranges_facilities.hpp @@ -19,8 +19,7 @@ namespace hpx::ranges { /////////////////////////////////////////////////////////////////////////// - - template + HPX_CXX_EXPORT template // clang-format off requires ( hpx::traits::is_input_iterator_v || @@ -34,9 +33,10 @@ namespace hpx::ranges { return first; } - template - // clang-format on - requires(hpx::traits::is_sentinel_for_v && + HPX_CXX_EXPORT template + // clang-format off + requires( + hpx::traits::is_sentinel_for_v && (hpx::traits::is_input_iterator_v || hpx::traits::is_output_iterator_v) ) // clang-format on @@ -45,12 +45,12 @@ namespace hpx::ranges { return hpx::parallel::detail::advance_to_sentinel(first, bound); } - template + HPX_CXX_EXPORT template // clang-format off requires ( hpx::traits::is_sentinel_for_v && (hpx::traits::is_input_iterator_v || - hpx::traits::is_output_iterator_v) + hpx::traits::is_output_iterator_v) ) // clang-format on constexpr Iter next( diff --git a/libs/core/algorithms/include/hpx/parallel/util/result_types.hpp b/libs/core/algorithms/include/hpx/parallel/util/result_types.hpp index ae2074e911ed..ba92894119fa 100644 --- a/libs/core/algorithms/include/hpx/parallel/util/result_types.hpp +++ b/libs/core/algorithms/include/hpx/parallel/util/result_types.hpp @@ -23,7 +23,7 @@ namespace hpx::parallel::util { /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct in_in_result { HPX_NO_UNIQUE_ADDRESS I1 in1; @@ -55,25 +55,21 @@ namespace hpx::parallel::util { } }; - template + HPX_CXX_EXPORT template I2 get_in2_element(util::in_in_result&& p) { return p.in2; } - template + HPX_CXX_EXPORT template hpx::future get_in2_element(hpx::future>&& f) { return hpx::make_future( HPX_MOVE(f), [](util::in_in_result&& p) { return p.in2; }); } - template - // clang-format off - requires ( - hpx::execution::experimental::is_sender_v - ) - // clang-format on + HPX_CXX_EXPORT template + requires(hpx::execution::experimental::is_sender_v) decltype(auto) get_in2_element(InInResultSender&& result_sender) { return hpx::execution::experimental::then( @@ -84,7 +80,7 @@ namespace hpx::parallel::util { } /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct in_out_result { HPX_NO_UNIQUE_ADDRESS I in; @@ -117,13 +113,13 @@ namespace hpx::parallel::util { }; /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template std::pair get_pair(util::in_out_result&& p) { return std::pair{p.in, p.out}; } - template + HPX_CXX_EXPORT template hpx::future> get_pair( hpx::future>&& f) { @@ -133,7 +129,7 @@ namespace hpx::parallel::util { }); } - template + HPX_CXX_EXPORT template requires(hpx::execution::experimental::is_sender_v) decltype(auto) get_pair(Sender&& sender) { @@ -145,13 +141,13 @@ namespace hpx::parallel::util { } /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template O get_second_element(util::in_out_result&& p) { return p.out; } - template + HPX_CXX_EXPORT template hpx::future get_second_element( hpx::future>&& f) { @@ -161,25 +157,19 @@ namespace hpx::parallel::util { namespace functional { - struct get_second_element + HPX_CXX_EXPORT struct get_second_element { - // clang-format off template decltype(auto) operator()(T&& val) const { return hpx::parallel::util::get_second_element( HPX_FORWARD(T, val)); } - // clang-format on }; } // namespace functional - template - // clang-format off - requires ( - hpx::execution::experimental::is_sender_v - ) - // clang-format on + HPX_CXX_EXPORT template + requires(hpx::execution::experimental::is_sender_v) decltype(auto) get_second_element(Sender&& sender) { return hpx::execution::experimental::then( @@ -187,13 +177,13 @@ namespace hpx::parallel::util { } // converts a in_out_result into a iterator_range - template + HPX_CXX_EXPORT template hpx::util::iterator_range get_subrange(in_out_result const& ior) { return hpx::util::iterator_range(ior.in, ior.out); } - template + HPX_CXX_EXPORT template hpx::future> get_subrange( hpx::future>&& ior) { @@ -204,7 +194,7 @@ namespace hpx::parallel::util { } /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct min_max_result { HPX_NO_UNIQUE_ADDRESS T min; @@ -235,7 +225,7 @@ namespace hpx::parallel::util { }; /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct in_in_out_result { HPX_NO_UNIQUE_ADDRESS I1 in1; @@ -270,13 +260,13 @@ namespace hpx::parallel::util { }; /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template O get_third_element(util::in_in_out_result&& p) { return p.out; } - template + HPX_CXX_EXPORT template hpx::future get_third_element( hpx::future>&& f) { @@ -284,12 +274,8 @@ namespace hpx::parallel::util { HPX_MOVE(f), [](in_in_out_result&& p) { return p.out; }); } - template - // clang-format off - requires ( - hpx::execution::experimental::is_sender_v - ) - // clang-format on + HPX_CXX_EXPORT template + requires(hpx::execution::experimental::is_sender_v) decltype(auto) get_third_element(InInOutResultSender&& result_sender) { return hpx::execution::experimental::then( @@ -300,7 +286,7 @@ namespace hpx::parallel::util { } /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct in_out_out_result { HPX_NO_UNIQUE_ADDRESS I in; @@ -335,7 +321,7 @@ namespace hpx::parallel::util { } }; - template + HPX_CXX_EXPORT template constexpr HPX_FORCEINLINE in_out_out_result make_in_out_out_result( hpx::tuple&& t) { @@ -347,7 +333,7 @@ namespace hpx::parallel::util { return result_type{hpx::get<0>(t), hpx::get<1>(t), hpx::get<2>(t)}; } - template + HPX_CXX_EXPORT template hpx::future> make_in_out_out_result( hpx::future>&& f) { @@ -363,7 +349,7 @@ namespace hpx::parallel::util { } /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct in_fun_result { HPX_NO_UNIQUE_ADDRESS I in; @@ -395,14 +381,14 @@ namespace hpx::parallel::util { } }; - template + HPX_CXX_EXPORT template hpx::util::iterator_range make_subrange( Iterator iterator, Sentinel sentinel) { return hpx::util::iterator_range(iterator, sentinel); } - template + HPX_CXX_EXPORT template hpx::future> make_subrange( hpx::future&& iterator, Sentinel sentinel) { @@ -415,7 +401,7 @@ namespace hpx::parallel::util { /////////////////////////////////////////////////////////////////////////// namespace detail { - template + HPX_CXX_EXPORT template in_out_result< typename hpx::tuple_element<0, typename std::decay_t::iterator_tuple_type>::type, @@ -434,7 +420,7 @@ namespace hpx::parallel::util { return result_type{hpx::get<0>(t), hpx::get<1>(t)}; } - template + HPX_CXX_EXPORT template requires(hpx::execution::experimental::is_sender_v) decltype(auto) get_in_out_result(ZipIterSender&& zipiter_sender) { @@ -445,7 +431,7 @@ namespace hpx::parallel::util { }); } - template + HPX_CXX_EXPORT template hpx::future< in_out_result::type, @@ -465,7 +451,7 @@ namespace hpx::parallel::util { }); } - template + HPX_CXX_EXPORT template min_max_result::type> get_min_max_result(ZipIter&& zipiter) @@ -479,7 +465,7 @@ namespace hpx::parallel::util { return result_type{hpx::get<0>(t), hpx::get<1>(t)}; } - template + HPX_CXX_EXPORT template hpx::future::type>> get_min_max_result(hpx::future&& zipiter) @@ -495,7 +481,7 @@ namespace hpx::parallel::util { }); } - template + HPX_CXX_EXPORT template in_in_out_result< typename hpx::tuple_element<0, typename std::decay_t::iterator_tuple_type>::type, @@ -517,7 +503,7 @@ namespace hpx::parallel::util { return result_type{hpx::get<0>(t), hpx::get<1>(t), hpx::get<2>(t)}; } - template + HPX_CXX_EXPORT template requires(hpx::execution::experimental::is_sender_v) decltype(auto) get_in_in_out_result(ZipIterSender&& zipiter_sender) { @@ -528,7 +514,7 @@ namespace hpx::parallel::util { }); } - template + HPX_CXX_EXPORT template hpx::future< in_in_out_result::type, @@ -555,11 +541,11 @@ namespace hpx::parallel::util { namespace hpx::ranges { - using hpx::parallel::util::in_fun_result; - using hpx::parallel::util::in_in_out_result; - using hpx::parallel::util::in_in_result; - using hpx::parallel::util::in_out_out_result; - using hpx::parallel::util::in_out_result; - using hpx::parallel::util::min_max_result; + HPX_CXX_EXPORT using hpx::parallel::util::in_fun_result; + HPX_CXX_EXPORT using hpx::parallel::util::in_in_out_result; + HPX_CXX_EXPORT using hpx::parallel::util::in_in_result; + HPX_CXX_EXPORT using hpx::parallel::util::in_out_out_result; + HPX_CXX_EXPORT using hpx::parallel::util::in_out_result; + HPX_CXX_EXPORT using hpx::parallel::util::min_max_result; } // namespace hpx::ranges // namespace hpx::ranges diff --git a/libs/core/algorithms/include/hpx/parallel/util/scan_partitioner.hpp b/libs/core/algorithms/include/hpx/parallel/util/scan_partitioner.hpp index 7e1cf20844a9..01149a67db25 100644 --- a/libs/core/algorithms/include/hpx/parallel/util/scan_partitioner.hpp +++ b/libs/core/algorithms/include/hpx/parallel/util/scan_partitioner.hpp @@ -36,11 +36,12 @@ namespace hpx::parallel::util { /////////////////////////////////////////////////////////////////////////// namespace detail { + /////////////////////////////////////////////////////////////////////// // The static partitioner simply spawns one chunk of iterations for // each available core. - template + HPX_CXX_EXPORT template struct scan_static_partitioner { using parameters_type = typename ExPolicy::executor_parameters_type; @@ -202,8 +203,8 @@ namespace hpx::parallel::util { }; /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template struct scan_task_static_partitioner { template + HPX_CXX_EXPORT template struct scan_partitioner : detail::select_partitioner, detail::scan_static_partitioner, diff --git a/libs/core/algorithms/include/hpx/parallel/util/transfer.hpp b/libs/core/algorithms/include/hpx/parallel/util/transfer.hpp index 0551cb874fbc..3cd1f731f56d 100644 --- a/libs/core/algorithms/include/hpx/parallel/util/transfer.hpp +++ b/libs/core/algorithms/include/hpx/parallel/util/transfer.hpp @@ -30,35 +30,35 @@ namespace hpx::parallel::util { /////////////////////////////////////////////////////////////////////////// namespace detail { - template + HPX_CXX_EXPORT template struct copy_helper; - template + HPX_CXX_EXPORT template struct copy_n_helper; - template + HPX_CXX_EXPORT template struct copy_synchronize_helper; - template + HPX_CXX_EXPORT template struct move_helper; - template + HPX_CXX_EXPORT template struct move_n_helper; - template + HPX_CXX_EXPORT template struct uninit_copy_n_helper; - template + HPX_CXX_EXPORT template struct uninit_move_n_helper; /////////////////////////////////////////////////////////////////////// // NOLINTBEGIN(bugprone-bitwise-pointer-cast) - template + HPX_CXX_EXPORT template HPX_FORCEINLINE constexpr std::enable_if_t, char*> to_ptr(T ptr) noexcept { return const_cast(hpx::bit_cast(ptr)); } - template + HPX_CXX_EXPORT template HPX_FORCEINLINE constexpr std::enable_if_t, char const*> to_const_ptr(T ptr) noexcept @@ -67,7 +67,7 @@ namespace hpx::parallel::util { hpx::bit_cast(ptr)); } - template + HPX_CXX_EXPORT template HPX_FORCEINLINE constexpr std::enable_if_t, char*> to_ptr(Iter ptr) noexcept @@ -80,7 +80,7 @@ namespace hpx::parallel::util { hpx::bit_cast(&*ptr)); } - template + HPX_CXX_EXPORT template HPX_FORCEINLINE constexpr std::enable_if_t, char const*> to_const_ptr(Iter ptr) noexcept @@ -95,7 +95,7 @@ namespace hpx::parallel::util { // NOLINTEND(bugprone-bitwise-pointer-cast) /////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template HPX_FORCEINLINE constexpr in_out_result copy_memmove( InIter first, std::size_t count, OutIter dest) noexcept { @@ -124,7 +124,7 @@ namespace hpx::parallel::util { /////////////////////////////////////////////////////////////////////// // Customization point for optimizing copy operations - template + HPX_CXX_EXPORT template struct copy_helper { template @@ -138,7 +138,7 @@ namespace hpx::parallel::util { } }; - template + HPX_CXX_EXPORT template struct copy_helper { template @@ -150,14 +150,14 @@ namespace hpx::parallel::util { } }; - template + HPX_CXX_EXPORT template using pointer_category_t = hpx::traits::pointer_copy_category_t< std::decay_t< hpx::traits::remove_const_iterator_value_type_t>, std::decay_t>; } // namespace detail - template + HPX_CXX_EXPORT template HPX_FORCEINLINE constexpr in_out_result copy(InIter first, Sent last, OutIter dest) noexcept(noexcept( detail::copy_helper>::call( @@ -171,7 +171,7 @@ namespace hpx::parallel::util { namespace detail { // Customization point for optimizing copy_n operations - template + HPX_CXX_EXPORT template struct copy_n_helper { template @@ -200,7 +200,7 @@ namespace hpx::parallel::util { } }; - template + HPX_CXX_EXPORT template struct copy_n_helper { template @@ -212,7 +212,7 @@ namespace hpx::parallel::util { }; } // namespace detail - template + HPX_CXX_EXPORT template struct copy_n_t final : hpx::functional::detail::tag_fallback> { @@ -232,10 +232,11 @@ namespace hpx::parallel::util { }; #if !defined(HPX_COMPUTE_DEVICE_CODE) - template + HPX_CXX_EXPORT template inline constexpr copy_n_t copy_n = copy_n_t{}; #else - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr in_out_result copy_n(InIter first, std::size_t count, OutIter dest) { @@ -247,7 +248,7 @@ namespace hpx::parallel::util { namespace detail { // Customization point for copy-synchronize operations - template + HPX_CXX_EXPORT template struct copy_synchronize_helper { template @@ -259,7 +260,7 @@ namespace hpx::parallel::util { }; } // namespace detail - template + HPX_CXX_EXPORT template HPX_FORCEINLINE constexpr void copy_synchronize( InIter const& first, OutIter const& dest) { @@ -273,7 +274,7 @@ namespace hpx::parallel::util { namespace detail { // Customization point for optimizing copy_n operations - template + HPX_CXX_EXPORT template struct move_helper { template @@ -291,7 +292,7 @@ namespace hpx::parallel::util { } }; - template + HPX_CXX_EXPORT template struct move_helper { template @@ -304,7 +305,7 @@ namespace hpx::parallel::util { }; } // namespace detail - template + HPX_CXX_EXPORT template HPX_FORCEINLINE constexpr in_out_result move( InIter first, Sent last, OutIter dest) { @@ -318,7 +319,7 @@ namespace hpx::parallel::util { namespace detail { // Customization point for optimizing copy_n operations - template + HPX_CXX_EXPORT template struct move_n_helper { template @@ -349,7 +350,7 @@ namespace hpx::parallel::util { } }; - template + HPX_CXX_EXPORT template struct move_n_helper { template @@ -361,7 +362,7 @@ namespace hpx::parallel::util { }; } // namespace detail - template + HPX_CXX_EXPORT template HPX_FORCEINLINE constexpr in_out_result move_n( InIter first, std::size_t count, OutIter dest) { @@ -373,8 +374,9 @@ namespace hpx::parallel::util { // helpers for uninit_copy_n namespace detail { + // Customization point for optimizing copy_n operations - template + HPX_CXX_EXPORT template struct uninit_copy_n_helper { template @@ -393,7 +395,7 @@ namespace hpx::parallel::util { } }; - template + HPX_CXX_EXPORT template struct uninit_copy_n_helper { @@ -406,7 +408,7 @@ namespace hpx::parallel::util { }; } // namespace detail - template + HPX_CXX_EXPORT template HPX_FORCEINLINE constexpr in_out_result uninit_copy_n( InIter first, std::size_t count, OutIter dest) { @@ -417,7 +419,8 @@ namespace hpx::parallel::util { hpx::execution::seq, first, count, dest); } - template + HPX_CXX_EXPORT template HPX_FORCEINLINE constexpr in_out_result uninit_copy_n( ExPolicy&& policy, InIter first, std::size_t count, OutIter dest) { @@ -430,8 +433,9 @@ namespace hpx::parallel::util { // helpers for uninit_move_n namespace detail { + // Customization point for optimizing move_n operations - template + HPX_CXX_EXPORT template struct uninit_move_n_helper { template @@ -451,7 +455,7 @@ namespace hpx::parallel::util { } }; - template + HPX_CXX_EXPORT template struct uninit_move_n_helper { @@ -464,7 +468,7 @@ namespace hpx::parallel::util { }; } // namespace detail - template + HPX_CXX_EXPORT template HPX_FORCEINLINE constexpr in_out_result uninit_move_n( InIter first, std::size_t count, OutIter dest) { @@ -475,7 +479,8 @@ namespace hpx::parallel::util { hpx::execution::seq, first, count, dest); } - template + HPX_CXX_EXPORT template HPX_FORCEINLINE constexpr in_out_result uninit_move_n( ExPolicy&& policy, InIter first, std::size_t count, OutIter dest) { diff --git a/libs/core/algorithms/include/hpx/parallel/util/transform_loop.hpp b/libs/core/algorithms/include/hpx/parallel/util/transform_loop.hpp index f6933e136a3e..6703b9010d4a 100644 --- a/libs/core/algorithms/include/hpx/parallel/util/transform_loop.hpp +++ b/libs/core/algorithms/include/hpx/parallel/util/transform_loop.hpp @@ -23,7 +23,7 @@ namespace hpx::parallel::util { /////////////////////////////////////////////////////////////////////////// namespace detail { - template + HPX_CXX_EXPORT template struct transform_loop { template { private: @@ -91,9 +91,10 @@ namespace hpx::parallel::util { }; #if !defined(HPX_COMPUTE_DEVICE_CODE) - inline constexpr transform_loop_t transform_loop = transform_loop_t{}; + HPX_CXX_EXPORT inline constexpr transform_loop_t transform_loop = + transform_loop_t{}; #else - template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr util::in_out_result @@ -108,7 +109,7 @@ namespace hpx::parallel::util { /////////////////////////////////////////////////////////////////////////// namespace detail { - template + HPX_CXX_EXPORT template struct transform_loop_ind { template { private: @@ -176,10 +177,10 @@ namespace hpx::parallel::util { }; #if !defined(HPX_COMPUTE_DEVICE_CODE) - inline constexpr transform_loop_ind_t transform_loop_ind = + HPX_CXX_EXPORT inline constexpr transform_loop_ind_t transform_loop_ind = transform_loop_ind_t{}; #else - template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr util::in_out_result @@ -194,7 +195,7 @@ namespace hpx::parallel::util { /////////////////////////////////////////////////////////////////////////// namespace detail { - template + HPX_CXX_EXPORT template struct transform_binary_loop { template + HPX_CXX_EXPORT template struct transform_binary_loop_t final : hpx::functional::detail::tag_fallback> { @@ -261,12 +262,12 @@ namespace hpx::parallel::util { }; #if !defined(HPX_COMPUTE_DEVICE_CODE) - template + HPX_CXX_EXPORT template inline constexpr transform_binary_loop_t transform_binary_loop = transform_binary_loop_t{}; #else - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr util::in_in_out_result transform_binary_loop( @@ -276,8 +277,9 @@ namespace hpx::parallel::util { first1, last1, first2, dest, HPX_FORWARD(F, f)); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr util::in_in_out_result transform_binary_loop(InIter1B first1, InIter1E last1, InIter2B first2, @@ -291,7 +293,7 @@ namespace hpx::parallel::util { /////////////////////////////////////////////////////////////////////////// namespace detail { - template + HPX_CXX_EXPORT template struct transform_binary_loop_ind { template + HPX_CXX_EXPORT template struct transform_binary_loop_ind_t final : hpx::functional::detail::tag_fallback< transform_binary_loop_ind_t> @@ -435,12 +437,12 @@ namespace hpx::parallel::util { }; #if !defined(HPX_COMPUTE_DEVICE_CODE) - template + HPX_CXX_EXPORT template inline constexpr transform_binary_loop_ind_t transform_binary_loop_ind = transform_binary_loop_ind_t{}; #else - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr util::in_in_out_result transform_binary_loop_ind( @@ -450,8 +452,9 @@ namespace hpx::parallel::util { first1, last1, first2, dest, HPX_FORWARD(F, f)); } - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr util::in_in_out_result transform_binary_loop_ind(InIter1B first1, InIter1E last1, InIter2B first2, @@ -464,7 +467,7 @@ namespace hpx::parallel::util { namespace detail { - template + HPX_CXX_EXPORT template struct transform_loop_n { template @@ -539,7 +542,7 @@ namespace hpx::parallel::util { }; } // namespace detail - template + HPX_CXX_EXPORT template struct transform_loop_n_t final : hpx::functional::detail::tag_fallback> { @@ -559,11 +562,12 @@ namespace hpx::parallel::util { }; #if !defined(HPX_COMPUTE_DEVICE_CODE) - template + HPX_CXX_EXPORT template inline constexpr transform_loop_n_t transform_loop_n = transform_loop_n_t{}; #else - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr std::pair transform_loop_n(Iter it, std::size_t count, OutIter dest, F&& f) { @@ -666,7 +670,7 @@ namespace hpx::parallel::util { }; } // namespace detail - template + HPX_CXX_EXPORT template struct transform_loop_n_ind_t final : hpx::functional::detail::tag_fallback> { @@ -686,11 +690,12 @@ namespace hpx::parallel::util { }; #if !defined(HPX_COMPUTE_DEVICE_CODE) - template + HPX_CXX_EXPORT template inline constexpr transform_loop_n_ind_t transform_loop_n_ind = transform_loop_n_ind_t{}; #else - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr std::pair transform_loop_n_ind(Iter it, std::size_t count, OutIter dest, F&& f) { @@ -702,7 +707,7 @@ namespace hpx::parallel::util { /////////////////////////////////////////////////////////////////////////// namespace detail { - template + HPX_CXX_EXPORT template struct transform_binary_loop_n { template + HPX_CXX_EXPORT template struct transform_binary_loop_n_t final : hpx::functional::detail::tag_fallback< transform_binary_loop_n_t> @@ -756,12 +761,12 @@ namespace hpx::parallel::util { }; #if !defined(HPX_COMPUTE_DEVICE_CODE) - template + HPX_CXX_EXPORT template inline constexpr transform_binary_loop_n_t transform_binary_loop_n = transform_binary_loop_n_t{}; #else - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr hpx::tuple transform_binary_loop_n(InIter1 first1, std::size_t count, @@ -775,7 +780,7 @@ namespace hpx::parallel::util { /////////////////////////////////////////////////////////////////////////// namespace detail { - template + HPX_CXX_EXPORT template struct transform_binary_loop_ind_n { template + HPX_CXX_EXPORT template struct transform_binary_loop_ind_n_t final : hpx::functional::detail::tag_fallback< transform_binary_loop_ind_n_t> @@ -870,12 +875,12 @@ namespace hpx::parallel::util { }; #if !defined(HPX_COMPUTE_DEVICE_CODE) - template + HPX_CXX_EXPORT template inline constexpr transform_binary_loop_ind_n_t transform_binary_loop_ind_n = transform_binary_loop_ind_n_t{}; #else - template + HPX_CXX_EXPORT template HPX_HOST_DEVICE HPX_FORCEINLINE constexpr hpx::tuple transform_binary_loop_ind_n(InIter1 first1, std::size_t count, @@ -885,5 +890,4 @@ namespace hpx::parallel::util { first1, count, first2, dest, HPX_FORWARD(F, f)); } #endif - } // namespace hpx::parallel::util diff --git a/libs/core/algorithms/include/hpx/parallel/util/zip_iterator.hpp b/libs/core/algorithms/include/hpx/parallel/util/zip_iterator.hpp index 6424e131a87b..63a39c8718d9 100644 --- a/libs/core/algorithms/include/hpx/parallel/util/zip_iterator.hpp +++ b/libs/core/algorithms/include/hpx/parallel/util/zip_iterator.hpp @@ -19,13 +19,13 @@ namespace hpx::parallel::detail { /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template constexpr R get_iter(ZipIter&& zipiter) { return hpx::get(zipiter.get_iterator_tuple()); } - template + HPX_CXX_EXPORT template R get_iter(hpx::future&& zipiter) { using result_type = typename hpx::tuple_element + HPX_CXX_EXPORT template constexpr typename ZipIter::iterator_tuple_type get_iter_tuple( ZipIter&& zipiter) { return zipiter.get_iterator_tuple(); } - template + HPX_CXX_EXPORT template hpx::future get_iter_tuple( hpx::future&& zipiter) { @@ -55,7 +55,7 @@ namespace hpx::parallel::detail { } /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template constexpr std::pair::type, typename hpx::tuple_element<1, @@ -68,7 +68,7 @@ namespace hpx::parallel::detail { return std::make_pair(hpx::get<0>(t), hpx::get<1>(t)); } - template + HPX_CXX_EXPORT template hpx::future::type, typename hpx::tuple_element<1, @@ -86,7 +86,7 @@ namespace hpx::parallel::detail { } /////////////////////////////////////////////////////////////////////////// - template + HPX_CXX_EXPORT template constexpr util::in_in_result< typename hpx::tuple_element<0, typename ZipIter::iterator_tuple_type>::type, @@ -104,12 +104,8 @@ namespace hpx::parallel::detail { return result_type{hpx::get<0>(t), hpx::get<1>(t)}; } - template - // clang-format off - requires ( - hpx::execution::experimental::is_sender_v - ) - // clang-format on + HPX_CXX_EXPORT template + requires(hpx::execution::experimental::is_sender_v) constexpr decltype(auto) get_iter_in_in_result( ZipIterSender&& zipiter_sender) { @@ -120,7 +116,7 @@ namespace hpx::parallel::detail { }); } - template + HPX_CXX_EXPORT template hpx::future< util::in_in_result::type, diff --git a/libs/core/async_cuda/CMakeLists.txt b/libs/core/async_cuda/CMakeLists.txt index 48ccb6d9fa84..331b8eb34ac0 100644 --- a/libs/core/async_cuda/CMakeLists.txt +++ b/libs/core/async_cuda/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2019 The STE||AR-Group +# Copyright (c) 2019-2025 The STE||AR-Group # # SPDX-License-Identifier: BSL-1.0 # Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -27,6 +27,10 @@ set(async_cuda_headers hpx/async_cuda/transform_stream.hpp ) +set(async_cuda_macros_headers hpx/async_cuda/custom_blas_api.hpp + hpx/async_cuda/custom_gpu_api.hpp +) + # Default location is $HPX_ROOT/libs/async_cuda/include_compatibility # cmake-format: off set(async_cuda_compat_headers @@ -35,8 +39,14 @@ set(async_cuda_compat_headers ) # cmake-format: on -set(async_cuda_sources cuda_event_callback.cpp cuda_future.cpp cuda_target.cpp - get_targets.cpp cuda_event.cpp +set(async_cuda_sources + cublas_executor.cpp + cuda_event_callback.cpp + cuda_future.cpp + cuda_target.cpp + cuda_event.cpp + cuda_exception.cpp + get_targets.cpp ) if(HPX_WITH_HIP AND TARGET roc::hipblas) @@ -51,8 +61,10 @@ include(HPX_AddModule) add_hpx_module( core async_cuda GLOBAL_HEADER_GEN ON + GLOBAL_HEADER_MODULE_GEN ON SOURCES ${async_cuda_sources} HEADERS ${async_cuda_headers} + MACRO_HEADERS ${async_cuda_macros_headers} COMPAT_HEADERS ${async_cuda_compat_headers} MODULE_DEPENDENCIES hpx_allocator_support diff --git a/libs/core/async_cuda/include/hpx/async_cuda/cublas_executor.hpp b/libs/core/async_cuda/include/hpx/async_cuda/cublas_executor.hpp index 840ffe79dc37..c8513625a167 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/cublas_executor.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/cublas_executor.hpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -23,7 +24,7 @@ #include // CuBLAS #include -// + #include #include #include @@ -31,68 +32,31 @@ #include #include -namespace hpx { namespace cuda { namespace experimental { +namespace hpx::cuda::experimental { namespace detail { - using print_on = debug::enable_print; - static constexpr print_on cub_debug("CUBLAS_"); + + HPX_CXX_EXPORT inline constexpr print_on cub_debug("CUBLAS_"); // ------------------------------------------------------------------------- // Error handling in cublas calls // not all of these are supported by all cuda/cublas versions // (comment them out if they cause compiler errors) - inline const char* _cublasGetErrorString(cublasStatus_t error) - { - switch (error) - { - case CUBLAS_STATUS_SUCCESS: - return "CUBLAS_STATUS_SUCCESS"; - case CUBLAS_STATUS_NOT_INITIALIZED: - return "CUBLAS_STATUS_NOT_INITIALIZED"; - case CUBLAS_STATUS_ALLOC_FAILED: - return "CUBLAS_STATUS_ALLOC_FAILED"; - case CUBLAS_STATUS_INVALID_VALUE: - return "CUBLAS_STATUS_INVALID_VALUE"; - case CUBLAS_STATUS_ARCH_MISMATCH: - return "CUBLAS_STATUS_ARCH_MISMATCH"; - case CUBLAS_STATUS_MAPPING_ERROR: - return "CUBLAS_STATUS_MAPPING_ERROR"; - case CUBLAS_STATUS_EXECUTION_FAILED: - return "CUBLAS_STATUS_EXECUTION_FAILED"; - case CUBLAS_STATUS_INTERNAL_ERROR: - return "CUBLAS_STATUS_INTERNAL_ERROR"; - case CUBLAS_STATUS_NOT_SUPPORTED: - return "CUBLAS_STATUS_NOT_SUPPORTED"; -#ifdef HPX_HAVE_HIP - case HIPBLAS_STATUS_HANDLE_IS_NULLPTR: - return "HIPBLAS_STATUS_HANDLE_IS_NULLPTR"; -#if HPX_HIP_VERSION >= 40300000 - case HIPBLAS_STATUS_INVALID_ENUM: - return "HIPBLAS_STATUS_INVALID_ENUM"; -#endif - case HIPBLAS_STATUS_UNKNOWN: - return "HIPBLAS_STATUS_UNKNOWN"; -#else - case CUBLAS_STATUS_LICENSE_ERROR: - return "CUBLAS_STATUS_LICENSE_ERROR"; -#endif - default: - break; - } - return ""; - } + HPX_CXX_EXPORT HPX_CORE_EXPORT char const* _cublasGetErrorString( + cublasStatus_t error); } // namespace detail // ------------------------------------------------------------------------- // exception type for failed launch of cuda functions - struct HPX_CORE_EXPORT cublas_exception : hpx::exception + HPX_CXX_EXPORT struct HPX_ALWAYS_EXPORT cublas_exception : hpx::exception { - cublas_exception(const std::string& msg, cublasStatus_t err) + cublas_exception(std::string const& msg, cublasStatus_t err) : hpx::exception(hpx::error::bad_function_call, msg) , err_(err) { } - cublasStatus_t get_cublas_errorcode() + + cublasStatus_t get_cublas_errorcode() const { return err_; } @@ -101,20 +65,13 @@ namespace hpx { namespace cuda { namespace experimental { cublasStatus_t err_; }; - inline cublasStatus_t check_cublas_error(cublasStatus_t err) - { - if (err != CUBLAS_STATUS_SUCCESS) - { - auto temp = std::string("cublas function returned error code :") + - detail::_cublasGetErrorString(err); - throw cublas_exception(temp, err); - } - return err; - } + HPX_CXX_EXPORT HPX_CORE_EXPORT cublasStatus_t check_cublas_error( + cublasStatus_t err); namespace detail { + // specialization for return type of cublasStatus_t - template + HPX_CXX_EXPORT template struct dispatch_helper { inline cublasStatus_t operator()( @@ -125,7 +82,7 @@ namespace hpx { namespace cuda { namespace experimental { } }; - struct cublas_handle + HPX_CXX_EXPORT struct cublas_handle { static cublasHandle_t create() { @@ -146,7 +103,7 @@ namespace hpx { namespace cuda { namespace experimental { // a simple cublas wrapper helper object that can be used to synchronize // cublas calls with an hpx future. // ------------------------------------------------------------------------- - struct cublas_executor : cuda_executor + HPX_CXX_EXPORT struct cublas_executor : cuda_executor { #ifdef HPX_HAVE_HIP // hipblas handle is type : void* @@ -274,8 +231,7 @@ namespace hpx { namespace cuda { namespace experimental { handle_ptr handle_; cublasPointerMode_t pointer_mode_; }; - -}}} // namespace hpx::cuda::experimental +} // namespace hpx::cuda::experimental namespace hpx::execution::experimental { @@ -295,4 +251,5 @@ namespace hpx::execution::experimental { }; /// \endcond } // namespace hpx::execution::experimental + #endif diff --git a/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp b/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp index 03394beca08d..ae5fd3f68fde 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/cuda_event.hpp @@ -10,21 +10,22 @@ #pragma once -#include -#include - +#include #include #include #include #include -namespace hpx { namespace cuda { namespace experimental { +#include +#include + +namespace hpx::cuda::experimental { // a pool of cudaEvent_t objects. // Since allocation of a cuda event passes into the cuda runtime // it might be an expensive operation, so we pre-allocate a pool // of them at startup. - struct cuda_event_pool + HPX_CXX_EXPORT struct cuda_event_pool { static constexpr std::size_t initial_events_in_pool = 128; @@ -37,6 +38,7 @@ namespace hpx { namespace cuda { namespace experimental { static_cast(max_number_devices_), "Number of CUDA event pools does not match the number of " "devices!"); + for (int device = 0; device < max_number_devices_; device++) { check_cuda_error(cudaSetDevice(device)); @@ -51,7 +53,7 @@ namespace hpx { namespace cuda { namespace experimental { } } - inline bool pop(cudaEvent_t& event, int device = 0) + inline bool pop(cudaEvent_t& event, int const device = 0) { HPX_ASSERT_MSG(device >= 0 && device < max_number_devices_, "Accessing CUDA event pool with invalid device ID!"); @@ -69,7 +71,7 @@ namespace hpx { namespace cuda { namespace experimental { return true; } - inline bool push(cudaEvent_t event, int device = 0) + inline bool push(cudaEvent_t event, int const device = 0) { HPX_ASSERT_MSG(device >= 0 && device < max_number_devices_, "Accessing CUDA event pool with invalid device ID!"); @@ -107,7 +109,7 @@ namespace hpx { namespace cuda { namespace experimental { check_cuda_error(cudaSetDevice(original_device)); } - void add_event_to_pool(int device) + void add_event_to_pool(int const device) { check_cuda_error(cudaSetDevice(device)); cudaEvent_t event; @@ -124,4 +126,4 @@ namespace hpx { namespace cuda { namespace experimental { // One pool per GPU - each pool is dynamically sized and can grow if needed std::deque> free_lists_; }; -}}} // namespace hpx::cuda::experimental +} // namespace hpx::cuda::experimental diff --git a/libs/core/async_cuda/include/hpx/async_cuda/cuda_exception.hpp b/libs/core/async_cuda/include/hpx/async_cuda/cuda_exception.hpp index cdf0a62723b4..12ea1daeacfc 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/cuda_exception.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/cuda_exception.hpp @@ -11,21 +11,22 @@ // CUDA runtime #include -// + #include -namespace hpx { namespace cuda { namespace experimental { +namespace hpx::cuda::experimental { // ------------------------------------------------------------------------- // exception type for failed launch of cuda functions - struct cuda_exception : hpx::exception + HPX_CXX_EXPORT struct HPX_ALWAYS_EXPORT cuda_exception : hpx::exception { - cuda_exception(const std::string& msg, cudaError_t err) + cuda_exception(std::string const& msg, cudaError_t const err) : hpx::exception(hpx::error::bad_function_call, msg) , err_(err) { } - cudaError_t get_cuda_errorcode() + + cudaError_t get_cuda_errorcode() const { return err_; } @@ -36,13 +37,5 @@ namespace hpx { namespace cuda { namespace experimental { // ------------------------------------------------------------------------- // Error message handler for cuda calls - inline void check_cuda_error(cudaError_t err) - { - if (err != cudaSuccess) - { - auto temp = std::string("cuda function returned error code :") + - cudaGetErrorString(err); - throw cuda_exception(temp, err); - } - } -}}} // namespace hpx::cuda::experimental + HPX_CXX_EXPORT HPX_CORE_EXPORT void check_cuda_error(cudaError_t const err); +} // namespace hpx::cuda::experimental diff --git a/libs/core/async_cuda/include/hpx/async_cuda/cuda_executor.hpp b/libs/core/async_cuda/include/hpx/async_cuda/cuda_executor.hpp index 3ca4dc849602..18ebd5b24b49 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/cuda_executor.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/cuda_executor.hpp @@ -18,24 +18,24 @@ // CUDA runtime #include -// + #include #include #include #include #include -namespace hpx { namespace cuda { namespace experimental { +namespace hpx::cuda::experimental { namespace detail { // ------------------------------------------------------------------------- - // A helper object to call a cudafunction returning a cudaError type + // A helper object to call a cuda function returning a cudaError type // or a plain kernel definition (or cublas function in cublas executor) - template + HPX_CXX_EXPORT template struct dispatch_helper; // default implementation - call the function - template + HPX_CXX_EXPORT template struct dispatch_helper { inline R operator()(R (*f)(Args...), Args... args) const @@ -45,7 +45,7 @@ namespace hpx { namespace cuda { namespace experimental { }; // specialization for return type void - template + HPX_CXX_EXPORT template struct dispatch_helper { inline void operator()(void (*f)(Args...), Args... args) const @@ -55,7 +55,7 @@ namespace hpx { namespace cuda { namespace experimental { }; // specialization for return type of cudaError_t - template + HPX_CXX_EXPORT template struct dispatch_helper { inline void operator()( @@ -64,14 +64,13 @@ namespace hpx { namespace cuda { namespace experimental { check_cuda_error(f(args...)); } }; - } // namespace detail // ------------------------------------------------------------------------- // Allows the launching of cuda functions and kernels on a stream with futures // returned that are set when the async functions/kernels are ready // ------------------------------------------------------------------------- - struct cuda_executor_base + HPX_CXX_EXPORT struct cuda_executor_base { using future_type = hpx::future; @@ -79,11 +78,12 @@ namespace hpx { namespace cuda { namespace experimental { // constructors - create a cuda stream that all tasks invoked by // this helper will use // assume event mode is the default - cuda_executor_base(std::size_t device, bool event_mode) - : device_(device) + cuda_executor_base(std::size_t device, bool const event_mode) + : device_(static_cast(device)) , event_mode_(event_mode) { - target_ = std::make_shared(device); + target_ = + std::make_shared(device_); stream_ = target_->native_handle().get_stream(); } @@ -107,12 +107,13 @@ namespace hpx { namespace cuda { namespace experimental { // Allows you to launch kernels on a stream and get // futures back when they are ready // ------------------------------------------------------------------------- - struct cuda_executor : cuda_executor_base + HPX_CXX_EXPORT struct cuda_executor : cuda_executor_base { // ------------------------------------------------------------------------- // construct - create a cuda stream that all tasks invoked by // this helper will use - explicit cuda_executor(std::size_t device, bool event_mode = true) + explicit cuda_executor( + std::size_t const device, bool const event_mode = true) : cuda_executor_base(device, event_mode) { } @@ -181,8 +182,7 @@ namespace hpx { namespace cuda { namespace experimental { }); } }; - -}}} // namespace hpx::cuda::experimental +} // namespace hpx::cuda::experimental namespace hpx::execution::experimental { diff --git a/libs/core/async_cuda/include/hpx/async_cuda/cuda_future.hpp b/libs/core/async_cuda/include/hpx/async_cuda/cuda_future.hpp index e69e41c1d924..73724aa77667 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/cuda_future.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/cuda_future.hpp @@ -31,12 +31,14 @@ #include #include -namespace hpx { namespace cuda { namespace experimental { - using event_mode = std::true_type; - using callback_mode = std::false_type; +namespace hpx::cuda::experimental { + + HPX_CXX_EXPORT using event_mode = std::true_type; + HPX_CXX_EXPORT using callback_mode = std::false_type; /////////////////////////////////////////////////////////////////////////// namespace detail { + // ------------------------------------------------------------- // cuda future data implementation // This version supports 2 modes of operation @@ -44,15 +46,18 @@ namespace hpx { namespace cuda { namespace experimental { // by a cuda callback when the stream event occurs // 2) an event based callback that must be polled/queried by // the runtime to set the future ready state - template + HPX_CXX_EXPORT template struct future_data; - template + HPX_CXX_EXPORT template struct future_data : lcos::detail::future_data_allocator> { - HPX_NON_COPYABLE(future_data); + future_data(future_data const&) = delete; + future_data(future_data&&) = delete; + future_data& operator=(future_data const&) = delete; + future_data& operator=(future_data&&) = delete; using init_no_addref = typename lcos::detail::future_data_allocator(this)]( - cudaError_t status) { + cudaError_t const status) { HPX_ASSERT(status != cudaErrorNotReady); if (status == cudaSuccess) @@ -91,7 +96,7 @@ namespace hpx { namespace cuda { namespace experimental { } }; - template + HPX_CXX_EXPORT template struct future_data : lcos::detail::future_data_allocator> @@ -111,14 +116,14 @@ namespace hpx { namespace cuda { namespace experimental { } future_data(init_no_addref no_addref, other_allocator const& alloc, - cudaStream_t stream) + cudaStream_t const stream) : lcos::detail::future_data_allocator(no_addref, alloc) , rt_(hpx::get_runtime_ptr()) { // Hold on to the shared state on behalf of the cuda runtime - // right away as the callback could be called immediately - // and it happens on another thread which might cause a race + // right away as the callback could be called immediately, and it + // happens on another thread which might cause a race lcos::detail::intrusive_ptr_add_ref(this); cudaError_t error = @@ -138,7 +143,7 @@ namespace hpx { namespace cuda { namespace experimental { // extreme care must be taken to not lock/block or take too long // in this callback static void CUDART_CB stream_callback( - cudaStream_t, cudaError_t error, void* user_data) + cudaStream_t, cudaError_t const error, void* user_data) { future_data* this_ = static_cast(user_data); @@ -166,7 +171,7 @@ namespace hpx { namespace cuda { namespace experimental { // ------------------------------------------------------------- // main API call to get a future from a stream using allocator, and the // specified mode - template + HPX_CXX_EXPORT template hpx::future get_future( Allocator const& a, cudaStream_t stream, int device) { @@ -188,6 +193,7 @@ namespace hpx { namespace cuda { namespace experimental { static_assert(std::is_same_v || std::is_same_v, "get_future mode not supported!"); + if constexpr (std::is_same_v) { traits::construct( @@ -205,9 +211,9 @@ namespace hpx { namespace cuda { namespace experimental { // ------------------------------------------------------------- // main API call to get a future from a stream using allocator - template + HPX_CXX_EXPORT template hpx::future get_future_with_callback( - Allocator const& a, cudaStream_t stream) + Allocator const& a, cudaStream_t const stream) { // device id 0 will be dropped in callback mode - can be // an arbitrary number here @@ -216,9 +222,9 @@ namespace hpx { namespace cuda { namespace experimental { // ------------------------------------------------------------- // main API call to get a future from a stream using allocator - template + HPX_CXX_EXPORT template hpx::future get_future_with_event( - Allocator const& a, cudaStream_t stream, int device = -1) + Allocator const& a, cudaStream_t const stream, int device = -1) { if (device == -1) check_cuda_error(cudaGetDevice(&device)); @@ -227,24 +233,21 @@ namespace hpx { namespace cuda { namespace experimental { // ------------------------------------------------------------- // non allocator version of : get future with a callback set - HPX_CORE_EXPORT hpx::future get_future_with_callback( - cudaStream_t); + HPX_CXX_EXPORT HPX_CORE_EXPORT hpx::future + get_future_with_callback(cudaStream_t); // ------------------------------------------------------------- // non allocator version of : get future with an event set - HPX_CORE_EXPORT hpx::future get_future_with_event( + HPX_CXX_EXPORT HPX_CORE_EXPORT hpx::future get_future_with_event( cudaStream_t stream, int device = -1); } // namespace detail -}}} // namespace hpx::cuda::experimental - -namespace hpx { namespace traits { namespace detail { - - template - struct shared_state_allocator< - hpx::cuda::experimental::detail::future_data, - NewAllocator> - { - using type = - hpx::cuda::experimental::detail::future_data; - }; -}}} // namespace hpx::traits::detail +} // namespace hpx::cuda::experimental + +HPX_CXX_EXPORT template +struct hpx::traits::detail::shared_state_allocator< + hpx::cuda::experimental::detail::future_data, NewAllocator> +{ + using type = + hpx::cuda::experimental::detail::future_data; +}; diff --git a/libs/core/async_cuda/include/hpx/async_cuda/cuda_polling_helper.hpp b/libs/core/async_cuda/include/hpx/async_cuda/cuda_polling_helper.hpp index 827146b0a51f..ec803db60af7 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/cuda_polling_helper.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/cuda_polling_helper.hpp @@ -16,12 +16,20 @@ #include -namespace hpx { namespace cuda { namespace experimental { +namespace hpx::cuda::experimental { + // ----------------------------------------------------------------- // This RAII helper class enables polling for a scoped block - struct [[nodiscard]] enable_user_polling + HPX_CXX_EXPORT struct [[nodiscard]] enable_user_polling { - enable_user_polling(std::string const& pool_name = "") + enable_user_polling() + : pool_name_() + { + // install polling loop on requested thread pool + detail::register_polling(hpx::resource::get_thread_pool(0)); + } + + explicit enable_user_polling(std::string const& pool_name) : pool_name_(pool_name) { // install polling loop on requested thread pool @@ -52,5 +60,4 @@ namespace hpx { namespace cuda { namespace experimental { private: std::string pool_name_; }; - -}}} // namespace hpx::cuda::experimental +} // namespace hpx::cuda::experimental diff --git a/libs/core/async_cuda/include/hpx/async_cuda/custom_blas_api.hpp b/libs/core/async_cuda/include/hpx/async_cuda/custom_blas_api.hpp index f1aeb8b5118c..2654b69d6327 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/custom_blas_api.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/custom_blas_api.hpp @@ -6,37 +6,35 @@ #pragma once -// clang-format off #include #if defined(HPX_HAVE_HIP) && defined(HPX_HAVE_GPUBLAS) - #include - - #define cublasCreate hipblasCreate - #define cublasDestroy hipblasDestroy - #define cublasHandle_t hipblasHandle_t - #define cublasPointerMode_t hipblasPointerMode_t - #define cublasSetPointerMode hipblasSetPointerMode - #define cublasSetStream hipblasSetStream - #define cublasSgemm hipblasSgemm - #define cublasStatus_t hipblasStatus_t - - #define CUBLAS_OP_N HIPBLAS_OP_N - #define CUBLAS_POINTER_MODE_HOST HIPBLAS_POINTER_MODE_HOST - #define CUBLAS_STATUS_SUCCESS HIPBLAS_STATUS_SUCCESS - #define CUBLAS_STATUS_NOT_INITIALIZED HIPBLAS_STATUS_NOT_INITIALIZED - #define CUBLAS_STATUS_ALLOC_FAILED HIPBLAS_STATUS_ALLOC_FAILED - #define CUBLAS_STATUS_INVALID_VALUE HIPBLAS_STATUS_INVALID_VALUE - #define CUBLAS_STATUS_ARCH_MISMATCH HIPBLAS_STATUS_ARCH_MISMATCH - #define CUBLAS_STATUS_MAPPING_ERROR HIPBLAS_STATUS_MAPPING_ERROR - #define CUBLAS_STATUS_EXECUTION_FAILED HIPBLAS_STATUS_EXECUTION_FAILED - #define CUBLAS_STATUS_INTERNAL_ERROR HIPBLAS_STATUS_INTERNAL_ERROR - #define CUBLAS_STATUS_NOT_SUPPORTED HIPBLAS_STATUS_NOT_SUPPORTED +#include + +#define cublasCreate hipblasCreate +#define cublasDestroy hipblasDestroy +#define cublasHandle_t hipblasHandle_t +#define cublasPointerMode_t hipblasPointerMode_t +#define cublasSetPointerMode hipblasSetPointerMode +#define cublasSetStream hipblasSetStream +#define cublasSgemm hipblasSgemm +#define cublasStatus_t hipblasStatus_t + +#define CUBLAS_OP_N HIPBLAS_OP_N +#define CUBLAS_POINTER_MODE_HOST HIPBLAS_POINTER_MODE_HOST +#define CUBLAS_STATUS_SUCCESS HIPBLAS_STATUS_SUCCESS +#define CUBLAS_STATUS_NOT_INITIALIZED HIPBLAS_STATUS_NOT_INITIALIZED +#define CUBLAS_STATUS_ALLOC_FAILED HIPBLAS_STATUS_ALLOC_FAILED +#define CUBLAS_STATUS_INVALID_VALUE HIPBLAS_STATUS_INVALID_VALUE +#define CUBLAS_STATUS_ARCH_MISMATCH HIPBLAS_STATUS_ARCH_MISMATCH +#define CUBLAS_STATUS_MAPPING_ERROR HIPBLAS_STATUS_MAPPING_ERROR +#define CUBLAS_STATUS_EXECUTION_FAILED HIPBLAS_STATUS_EXECUTION_FAILED +#define CUBLAS_STATUS_INTERNAL_ERROR HIPBLAS_STATUS_INTERNAL_ERROR +#define CUBLAS_STATUS_NOT_SUPPORTED HIPBLAS_STATUS_NOT_SUPPORTED #elif defined(HPX_HAVE_CUDA) && defined(HPX_HAVE_GPUBLAS) - #include +#include #endif -// clang-format on diff --git a/libs/core/async_cuda/include/hpx/async_cuda/custom_gpu_api.hpp b/libs/core/async_cuda/include/hpx/async_cuda/custom_gpu_api.hpp index 707c4b9ae96a..bafa38dcdcf1 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/custom_gpu_api.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/custom_gpu_api.hpp @@ -6,72 +6,70 @@ #pragma once -// clang-format off #include #if defined(HPX_HAVE_HIP) - #if defined(__clang__) - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wdeprecated-copy" - #pragma clang diagnostic ignored "-Wdouble-promotion" - #pragma clang diagnostic ignored "-Wsign-compare" - #pragma clang diagnostic ignored "-Wunused-parameter" - #pragma clang diagnostic ignored "-Wunused-variable" - #endif +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-copy" +#pragma clang diagnostic ignored "-Wdouble-promotion" +#pragma clang diagnostic ignored "-Wsign-compare" +#pragma clang diagnostic ignored "-Wunused-parameter" +#pragma clang diagnostic ignored "-Wunused-variable" +#endif - #include - #if defined(__clang__) - #pragma clang diagnostic pop - #endif +#include +#if defined(__clang__) +#pragma clang diagnostic pop +#endif - #ifdef _WIN32 - #define CUDART_CB __stdcall - #else - #define CUDART_CB - #endif +#ifdef _WIN32 +#define CUDART_CB __stdcall +#else +#define CUDART_CB +#endif - #define cudaDeviceProp hipDeviceProp_t - #define cudaDeviceSynchronize hipDeviceSynchronize - #define cudaError_t hipError_t - #define cudaErrorNotReady hipErrorNotReady - #define cudaEvent_t hipEvent_t - #define cudaEventCreateWithFlags hipEventCreateWithFlags - #define cudaEventDestroy hipEventDestroy - #define cudaEventDisableTiming hipEventDisableTiming - #define cudaEventQuery hipEventQuery - #define cudaEventRecord hipEventRecord - #define cudaFree hipFree - #define cudaGetDevice hipGetDevice - #define cudaGetDeviceCount hipGetDeviceCount - #define cudaGetDeviceProperties hipGetDeviceProperties - #define cudaGetErrorString hipGetErrorString - #define cudaGetLastError hipGetLastError - #define cudaGetParameterBuffer hipGetParameterBuffer - #define cudaLaunchDevice hipLaunchDevice - #define cudaLaunchKernel hipLaunchKernel - #define cudaMalloc hipMalloc - #define cudaMallocHost hipHostMalloc - #define cudaMemcpy hipMemcpy - #define cudaMemcpyAsync hipMemcpyAsync - #define cudaMemcpyDeviceToDevice hipMemcpyDeviceToDevice - #define cudaMemcpyDeviceToHost hipMemcpyDeviceToHost - #define cudaMemcpyHostToDevice hipMemcpyHostToDevice - #define cudaMemGetInfo hipMemGetInfo - #define cudaMemsetAsync hipMemsetAsync - #define cudaSetDevice hipSetDevice - #define cudaStream_t hipStream_t - #define cudaStreamAddCallback hipStreamAddCallback - #define cudaStreamCreate hipStreamCreate - #define cudaStreamCreateWithFlags hipStreamCreateWithFlags - #define cudaStreamDestroy hipStreamDestroy - #define cudaStreamNonBlocking hipStreamNonBlocking - #define cudaStreamSynchronize hipStreamSynchronize - #define cudaSuccess hipSuccess +#define cudaDeviceProp hipDeviceProp_t +#define cudaDeviceSynchronize hipDeviceSynchronize +#define cudaError_t hipError_t +#define cudaErrorNotReady hipErrorNotReady +#define cudaEvent_t hipEvent_t +#define cudaEventCreateWithFlags hipEventCreateWithFlags +#define cudaEventDestroy hipEventDestroy +#define cudaEventDisableTiming hipEventDisableTiming +#define cudaEventQuery hipEventQuery +#define cudaEventRecord hipEventRecord +#define cudaFree hipFree +#define cudaGetDevice hipGetDevice +#define cudaGetDeviceCount hipGetDeviceCount +#define cudaGetDeviceProperties hipGetDeviceProperties +#define cudaGetErrorString hipGetErrorString +#define cudaGetLastError hipGetLastError +#define cudaGetParameterBuffer hipGetParameterBuffer +#define cudaLaunchDevice hipLaunchDevice +#define cudaLaunchKernel hipLaunchKernel +#define cudaMalloc hipMalloc +#define cudaMallocHost hipHostMalloc +#define cudaMemcpy hipMemcpy +#define cudaMemcpyAsync hipMemcpyAsync +#define cudaMemcpyDeviceToDevice hipMemcpyDeviceToDevice +#define cudaMemcpyDeviceToHost hipMemcpyDeviceToHost +#define cudaMemcpyHostToDevice hipMemcpyHostToDevice +#define cudaMemGetInfo hipMemGetInfo +#define cudaMemsetAsync hipMemsetAsync +#define cudaSetDevice hipSetDevice +#define cudaStream_t hipStream_t +#define cudaStreamAddCallback hipStreamAddCallback +#define cudaStreamCreate hipStreamCreate +#define cudaStreamCreateWithFlags hipStreamCreateWithFlags +#define cudaStreamDestroy hipStreamDestroy +#define cudaStreamNonBlocking hipStreamNonBlocking +#define cudaStreamSynchronize hipStreamSynchronize +#define cudaSuccess hipSuccess #elif defined(HPX_HAVE_CUDA) - #include +#include #endif -// clang-format on diff --git a/libs/core/async_cuda/include/hpx/async_cuda/detail/cuda_debug.hpp b/libs/core/async_cuda/include/hpx/async_cuda/detail/cuda_debug.hpp index 1baad30a75e6..a29117eaaaa4 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/detail/cuda_debug.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/detail/cuda_debug.hpp @@ -9,9 +9,11 @@ #pragma once +#include #include -namespace hpx { namespace cuda { namespace experimental { namespace detail { - using print_on = debug::enable_print; - static constexpr print_on cud_debug("CUDA"); -}}}} // namespace hpx::cuda::experimental::detail +namespace hpx::cuda::experimental::detail { + + HPX_CXX_EXPORT using print_on = debug::enable_print; + HPX_CXX_EXPORT inline constexpr print_on cud_debug("CUDA"); +} // namespace hpx::cuda::experimental::detail diff --git a/libs/core/async_cuda/include/hpx/async_cuda/detail/cuda_event_callback.hpp b/libs/core/async_cuda/include/hpx/async_cuda/detail/cuda_event_callback.hpp index b311951b6951..163985d10fdc 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/detail/cuda_event_callback.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/detail/cuda_event_callback.hpp @@ -21,14 +21,16 @@ #include -namespace hpx { namespace cuda { namespace experimental { namespace detail { - using event_callback_function_type = +namespace hpx::cuda::experimental::detail { + + HPX_CXX_EXPORT using event_callback_function_type = hpx::move_only_function; - HPX_CORE_EXPORT void add_event_callback( + HPX_CXX_EXPORT HPX_CORE_EXPORT void add_event_callback( event_callback_function_type&& f, cudaStream_t stream, int device = 0); - HPX_CORE_EXPORT void register_polling(hpx::threads::thread_pool_base& pool); - HPX_CORE_EXPORT void unregister_polling( + HPX_CXX_EXPORT HPX_CORE_EXPORT void register_polling( + hpx::threads::thread_pool_base& pool); + HPX_CXX_EXPORT HPX_CORE_EXPORT void unregister_polling( hpx::threads::thread_pool_base& pool); -}}}} // namespace hpx::cuda::experimental::detail +} // namespace hpx::cuda::experimental::detail diff --git a/libs/core/async_cuda/include/hpx/async_cuda/get_targets.hpp b/libs/core/async_cuda/include/hpx/async_cuda/get_targets.hpp index 9af9f2481935..7c11409bdf08 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/get_targets.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/get_targets.hpp @@ -13,10 +13,10 @@ #include -namespace hpx { namespace cuda { namespace experimental { - struct HPX_CORE_EXPORT target; +namespace hpx::cuda::experimental { - HPX_CORE_EXPORT std::vector get_local_targets(); - HPX_CORE_EXPORT void print_local_targets(); + HPX_CXX_EXPORT struct HPX_CORE_EXPORT target; -}}} // namespace hpx::cuda::experimental + HPX_CXX_EXPORT HPX_CORE_EXPORT std::vector get_local_targets(); + HPX_CXX_EXPORT HPX_CORE_EXPORT void print_local_targets(); +} // namespace hpx::cuda::experimental diff --git a/libs/core/async_cuda/include/hpx/async_cuda/target.hpp b/libs/core/async_cuda/include/hpx/async_cuda/target.hpp index d0e26a00147a..148a112cfa59 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/target.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/target.hpp @@ -30,10 +30,10 @@ #include -namespace hpx { namespace cuda { namespace experimental { +namespace hpx::cuda::experimental { /////////////////////////////////////////////////////////////////////////// - struct target + HPX_CXX_EXPORT struct target { public: struct HPX_CORE_EXPORT native_handle_type @@ -41,7 +41,6 @@ namespace hpx { namespace cuda { namespace experimental { typedef hpx::spinlock mutex_type; native_handle_type(int device = 0); - ~native_handle_type(); native_handle_type(native_handle_type const& rhs) noexcept; @@ -73,7 +72,7 @@ namespace hpx { namespace cuda { namespace experimental { return processor_name_; } - void reset() noexcept; + void reset() const noexcept; private: void init_processing_units(); @@ -170,8 +169,8 @@ namespace hpx { namespace cuda { namespace experimental { native_handle_type handle_; }; - using detail::get_future_with_callback; - HPX_CORE_EXPORT target& get_default_target(); -}}} // namespace hpx::cuda::experimental + HPX_CXX_EXPORT using detail::get_future_with_callback; + HPX_CXX_EXPORT HPX_CORE_EXPORT target& get_default_target(); +} // namespace hpx::cuda::experimental #include diff --git a/libs/core/async_cuda/include/hpx/async_cuda/transform_stream.hpp b/libs/core/async_cuda/include/hpx/async_cuda/transform_stream.hpp index 7f8141bde902..d107fa98b4ca 100644 --- a/libs/core/async_cuda/include/hpx/async_cuda/transform_stream.hpp +++ b/libs/core/async_cuda/include/hpx/async_cuda/transform_stream.hpp @@ -19,11 +19,13 @@ #include #include -namespace hpx { namespace cuda { namespace experimental { +namespace hpx::cuda::experimental { + namespace detail { - template + + HPX_CXX_EXPORT template void set_value_event_callback_helper( - cudaError_t status, R&& r, Ts&&... ts) + cudaError_t const status, R&& r, Ts&&... ts) { static_assert(sizeof...(Ts) <= 1, "Expecting at most one value"); @@ -37,23 +39,22 @@ namespace hpx { namespace cuda { namespace experimental { else { hpx::execution::experimental::set_error(HPX_FORWARD(R, r), - std::make_exception_ptr( - cuda_exception(std::string("Getting event after " - "CUDA stream transform " - "failed with status ") + - cudaGetErrorString(status), - status))); + std::make_exception_ptr(cuda_exception( + std::string("Getting event after CUDA stream transform " + "failed with status ") + + cudaGetErrorString(status), + status))); } } - template + HPX_CXX_EXPORT template void extend_argument_lifetimes(cudaStream_t stream, Ts&&... ts) { if constexpr (sizeof...(Ts) > 0) { detail::add_event_callback( [keep_alive = hpx::make_tuple(HPX_FORWARD(Ts, ts)...)]( - cudaError_t status) { + cudaError_t const status) { HPX_ASSERT(status != cudaErrorNotReady); HPX_UNUSED(status); }, @@ -61,18 +62,18 @@ namespace hpx { namespace cuda { namespace experimental { } } - template + HPX_CXX_EXPORT template void set_value_immediate_void(cudaStream_t stream, R&& r, Ts&&... ts) { hpx::execution::experimental::set_value(HPX_FORWARD(R, r)); // Even though we call set_value immediately, we still extend the - // life time of the arguments by capturing them in a callback that + // life-time of the arguments by capturing them in a callback that // is triggered when the event is ready. extend_argument_lifetimes(stream, HPX_FORWARD(Ts, ts)...); } - template + HPX_CXX_EXPORT template void set_value_event_callback_void( cudaStream_t stream, R&& r, Ts&&... ts) { @@ -85,7 +86,7 @@ namespace hpx { namespace cuda { namespace experimental { stream); } - template + HPX_CXX_EXPORT template void set_value_immediate_non_void( cudaStream_t stream, R&& r, T&& t, Ts&&... ts) { @@ -93,12 +94,12 @@ namespace hpx { namespace cuda { namespace experimental { HPX_FORWARD(R, r), HPX_FORWARD(T, t)); // Even though we call set_value immediately, we still extend the - // life time of the arguments by capturing them in a callback that + // life-time of the arguments by capturing them in a callback that // is triggered when the event is ready. extend_argument_lifetimes(stream, HPX_FORWARD(Ts, ts)...); } - template + HPX_CXX_EXPORT template void set_value_event_callback_non_void( cudaStream_t stream, R&& r, T&& t, Ts&&... ts) { @@ -112,21 +113,21 @@ namespace hpx { namespace cuda { namespace experimental { stream); } - template + HPX_CXX_EXPORT template struct transform_stream_receiver; - template + HPX_CXX_EXPORT template struct is_transform_stream_receiver : std::false_type { }; - template + HPX_CXX_EXPORT template struct is_transform_stream_receiver> : std::true_type { }; - template + HPX_CXX_EXPORT template struct transform_stream_receiver { #if defined(HPX_HAVE_STDEXEC) @@ -137,7 +138,7 @@ namespace hpx { namespace cuda { namespace experimental { cudaStream_t stream; template - transform_stream_receiver(R_&& r, F_&& f, cudaStream_t stream) + transform_stream_receiver(R_&& r, F_&& f, cudaStream_t const stream) : r(HPX_FORWARD(R_, r)) , f(HPX_FORWARD(F_, f)) , stream(stream) @@ -177,10 +178,11 @@ namespace hpx { namespace cuda { namespace experimental { if (r.stream == stream) { // When the next receiver is also a - // transform_stream_receiver, we can immediately - // call set_value, with the knowledge that a - // later receiver will synchronize the stream - // when a non-transform_stream receiver is + // transform_stream_receiver, we can + // immediately call set_value, with the + // knowledge that a later receiver will + // synchronize the stream when a + // non-transform_stream receiver is // connected. set_value_immediate_void(stream, HPX_MOVE(r), HPX_FORWARD(Ts, ts)...); @@ -205,8 +207,8 @@ namespace hpx { namespace cuda { namespace experimental { } else { - // When the return type is non-void, we have to forward - // the value to the receiver + // When the return type is non-void, we have to + // forward the value to the receiver auto t = HPX_INVOKE(f, HPX_FORWARD(Ts, ts)..., stream); @@ -216,10 +218,11 @@ namespace hpx { namespace cuda { namespace experimental { if (r.stream == stream) { // When the next receiver is also a - // transform_stream_receiver, we can immediately - // call set_value, with the knowledge that a - // later receiver will synchronize the stream - // when a non-transform_stream receiver is + // transform_stream_receiver, we can + // immediately call set_value, with the + // knowledge that a later receiver will + // synchronize the stream when a + // non-transform_stream receiver is // connected. set_value_immediate_non_void(stream, HPX_MOVE(r), HPX_MOVE(t), @@ -271,7 +274,7 @@ namespace hpx { namespace cuda { namespace experimental { // nvcc does not know how to compile it with some argument types // ("error: no instance of overloaded function std::forward matches the // argument list"). - template + HPX_CXX_EXPORT template void tag_invoke(hpx::execution::experimental::set_value_t, transform_stream_receiver&& r, Ts&&... ts) { @@ -279,7 +282,7 @@ namespace hpx { namespace cuda { namespace experimental { } #endif - template + HPX_CXX_EXPORT template struct transform_stream_sender { std::decay_t s; @@ -326,14 +329,14 @@ namespace hpx { namespace cuda { namespace experimental { friend auto tag_invoke( hpx::execution::experimental::get_completion_signatures_t, transform_stream_sender const&, Env const&) - -> hpx::execution::experimental::transform_completion_signatures_of< - S, Env, - hpx::execution::experimental::completion_signatures< - hpx::execution::experimental::set_error_t(std::exception_ptr) - >, - invoke_function_transformation - // stop and error channel will be forwarded if they are present. - >; + -> hpx::execution::experimental::transform_completion_signatures_of< + S, Env, + hpx::execution::experimental::completion_signatures< + hpx::execution::experimental::set_error_t(std::exception_ptr) + >, + invoke_function_transformation + // stop and error channel will be forwarded if they are present. + >; // clang-format on friend constexpr auto tag_invoke( @@ -400,18 +403,18 @@ namespace hpx { namespace cuda { namespace experimental { }; } // namespace detail - // NOTE: This is not a customization of - // hpx::execution::experimental::then. It has different semantics: + // NOTE: This is not a customization of hpx::execution::experimental::then. + // It has different semantics: // - a cudaStream_t is inserted as an additional argument into the call to f // - values from the predecessor sender are not forwarded, only passed by // reference, to the call to f to keep them alive until the event is ready - inline constexpr struct transform_stream_t final + HPX_CXX_EXPORT inline constexpr struct transform_stream_t final : hpx::functional::detail::tag_fallback { private: template , cudaStream_t>::value>> + !std::is_same_v, cudaStream_t>>> friend constexpr HPX_FORCEINLINE auto tag_fallback_invoke( transform_stream_t, S&& s, F&& f, cudaStream_t stream = {}) { @@ -427,4 +430,4 @@ namespace hpx { namespace cuda { namespace experimental { transform_stream_t, F, cudaStream_t>{HPX_FORWARD(F, f), stream}; } } transform_stream{}; -}}} // namespace hpx::cuda::experimental +} // namespace hpx::cuda::experimental diff --git a/libs/core/async_cuda/src/cublas_executor.cpp b/libs/core/async_cuda/src/cublas_executor.cpp new file mode 100644 index 000000000000..5ef69237c745 --- /dev/null +++ b/libs/core/async_cuda/src/cublas_executor.cpp @@ -0,0 +1,77 @@ +// Copyright (c) 2020 John Biddiscombe +// Copyright (c) 2020 Teodor Nikolov +// Copyright (c) 2024-2025 Hartmut Kaiser +// +// SPDX-License-Identifier: BSL-1.0 +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include + +#if defined(HPX_HAVE_GPU_SUPPORT) && defined(HPX_HAVE_GPUBLAS) +#include + +#include + +namespace hpx::cuda::experimental { + + namespace detail { + // -------------------------------------------------------------------- + // Error handling in cublas calls + // not all of these are supported by all cuda/cublas versions + // (comment them out if they cause compiler errors) + char const* _cublasGetErrorString(cublasStatus_t error) + { + switch (error) + { + case CUBLAS_STATUS_SUCCESS: + return "CUBLAS_STATUS_SUCCESS"; + case CUBLAS_STATUS_NOT_INITIALIZED: + return "CUBLAS_STATUS_NOT_INITIALIZED"; + case CUBLAS_STATUS_ALLOC_FAILED: + return "CUBLAS_STATUS_ALLOC_FAILED"; + case CUBLAS_STATUS_INVALID_VALUE: + return "CUBLAS_STATUS_INVALID_VALUE"; + case CUBLAS_STATUS_ARCH_MISMATCH: + return "CUBLAS_STATUS_ARCH_MISMATCH"; + case CUBLAS_STATUS_MAPPING_ERROR: + return "CUBLAS_STATUS_MAPPING_ERROR"; + case CUBLAS_STATUS_EXECUTION_FAILED: + return "CUBLAS_STATUS_EXECUTION_FAILED"; + case CUBLAS_STATUS_INTERNAL_ERROR: + return "CUBLAS_STATUS_INTERNAL_ERROR"; + case CUBLAS_STATUS_NOT_SUPPORTED: + return "CUBLAS_STATUS_NOT_SUPPORTED"; +#ifdef HPX_HAVE_HIP + case HIPBLAS_STATUS_HANDLE_IS_NULLPTR: + return "HIPBLAS_STATUS_HANDLE_IS_NULLPTR"; +#if HPX_HIP_VERSION >= 40300000 + case HIPBLAS_STATUS_INVALID_ENUM: + return "HIPBLAS_STATUS_INVALID_ENUM"; +#endif + case HIPBLAS_STATUS_UNKNOWN: + return "HIPBLAS_STATUS_UNKNOWN"; +#else + case CUBLAS_STATUS_LICENSE_ERROR: + return "CUBLAS_STATUS_LICENSE_ERROR"; +#endif + default: + break; + } + return ""; + } + } // namespace detail + + cublasStatus_t check_cublas_error(cublasStatus_t err) + { + if (err != CUBLAS_STATUS_SUCCESS) + { + auto temp = std::string("cublas function returned error code :") + + detail::_cublasGetErrorString(err); + throw cublas_exception(temp, err); + } + return err; + } +} // namespace hpx::cuda::experimental + +#endif diff --git a/libs/core/async_cuda/src/cuda_event.cpp b/libs/core/async_cuda/src/cuda_event.cpp index 1425937a8f29..ba086c50679d 100644 --- a/libs/core/async_cuda/src/cuda_event.cpp +++ b/libs/core/async_cuda/src/cuda_event.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Gregor Daiß +// Copyright (c) 2023 Gregor Daiß // // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying @@ -10,10 +10,11 @@ #include #include -namespace hpx { namespace cuda { namespace experimental { +namespace hpx::cuda::experimental { + cuda_event_pool& cuda_event_pool::get_event_pool() { - static cuda_event_pool event_pool_; - return event_pool_; + static cuda_event_pool event_pool; + return event_pool; } -}}} // namespace hpx::cuda::experimental +} // namespace hpx::cuda::experimental diff --git a/libs/core/async_cuda/src/cuda_event_callback.cpp b/libs/core/async_cuda/src/cuda_event_callback.cpp index 98cbe3dcedb9..3992d0f5ca4d 100644 --- a/libs/core/async_cuda/src/cuda_event_callback.cpp +++ b/libs/core/async_cuda/src/cuda_event_callback.cpp @@ -29,7 +29,8 @@ #include #include -namespace hpx { namespace cuda { namespace experimental { namespace detail { +namespace hpx::cuda::experimental::detail { + // this code runs on a std::thread, but we will use a spinlock // as we never suspend - only ever try_lock, or exit using mutex_type = hpx::spinlock; @@ -135,7 +136,7 @@ namespace hpx { namespace cuda { namespace experimental { namespace detail { auto& event_callback_vector = detail::get_event_callback_vector(); // Don't poll if another thread is already polling - std::unique_lock lk( + std::unique_lock const lk( detail::get_vector_mtx(), std::try_to_lock); if (!lk.owns_lock()) { @@ -169,7 +170,8 @@ namespace hpx { namespace cuda { namespace experimental { namespace detail { std::remove_if(event_callback_vector.begin(), event_callback_vector.end(), [&](event_callback& continuation) { - cudaError_t status = cudaEventQuery(continuation.event); + cudaError_t const status = + cudaEventQuery(continuation.event); if (status == cudaErrorNotReady) { @@ -191,7 +193,7 @@ namespace hpx { namespace cuda { namespace experimental { namespace detail { detail::event_callback continuation; while (detail::get_event_callback_queue().try_dequeue(continuation)) { - cudaError_t status = cudaEventQuery(continuation.event); + cudaError_t const status = cudaEventQuery(continuation.event); if (status == cudaErrorNotReady) { @@ -218,7 +220,8 @@ namespace hpx { namespace cuda { namespace experimental { namespace detail { { std::size_t work_count = 0; { - std::unique_lock lk(get_vector_mtx(), std::try_to_lock); + std::unique_lock const lk( + get_vector_mtx(), std::try_to_lock); if (lk.owns_lock()) { work_count += get_number_of_active_events(); @@ -249,9 +252,9 @@ namespace hpx { namespace cuda { namespace experimental { namespace detail { { std::unique_lock lk( detail::get_vector_mtx()); - bool event_queue_empty = + bool const event_queue_empty = get_event_callback_queue().size_approx() == 0; - bool event_vector_empty = get_event_callback_vector().empty(); + bool const event_vector_empty = get_event_callback_vector().empty(); lk.unlock(); HPX_ASSERT_MSG(event_queue_empty, "CUDA event polling was disabled while there are unprocessed " @@ -267,4 +270,4 @@ namespace hpx { namespace cuda { namespace experimental { namespace detail { auto* sched = pool.get_scheduler(); sched->clear_cuda_polling_function(); } -}}}} // namespace hpx::cuda::experimental::detail +} // namespace hpx::cuda::experimental::detail diff --git a/libs/core/async_cuda/src/cuda_exception.cpp b/libs/core/async_cuda/src/cuda_exception.cpp new file mode 100644 index 000000000000..e6ab8400571f --- /dev/null +++ b/libs/core/async_cuda/src/cuda_exception.cpp @@ -0,0 +1,29 @@ +// Copyright (c) 2020 John Biddiscombe +// +// SPDX-License-Identifier: BSL-1.0 +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include +#include + +// CUDA runtime +#include +#include + +#include + +namespace hpx::cuda::experimental { + + // ------------------------------------------------------------------------- + // Error message handler for cuda calls + void check_cuda_error(cudaError_t const err) + { + if (err != cudaSuccess) + { + auto temp = std::string("cuda function returned error code :") + + cudaGetErrorString(err); + throw cuda_exception(temp, err); + } + } +} // namespace hpx::cuda::experimental diff --git a/libs/core/async_cuda/src/cuda_future.cpp b/libs/core/async_cuda/src/cuda_future.cpp index 2611066e60a3..aa1cfc391f22 100644 --- a/libs/core/async_cuda/src/cuda_future.cpp +++ b/libs/core/async_cuda/src/cuda_future.cpp @@ -14,7 +14,8 @@ #include #include -namespace hpx { namespace cuda { namespace experimental { namespace detail { +namespace hpx::cuda::experimental::detail { + hpx::future get_future_with_callback(cudaStream_t stream) { return get_future_with_callback( @@ -26,4 +27,4 @@ namespace hpx { namespace cuda { namespace experimental { namespace detail { return get_future_with_event( hpx::util::internal_allocator<>{}, stream, device); } -}}}} // namespace hpx::cuda::experimental::detail +} // namespace hpx::cuda::experimental::detail diff --git a/libs/core/async_cuda/src/cuda_target.cpp b/libs/core/async_cuda/src/cuda_target.cpp index cdc65ccce3ea..cef4a3b1967a 100644 --- a/libs/core/async_cuda/src/cuda_target.cpp +++ b/libs/core/async_cuda/src/cuda_target.cpp @@ -20,12 +20,13 @@ #include -namespace hpx { namespace cuda { namespace experimental { +namespace hpx::cuda::experimental { + void target::native_handle_type::init_processing_units() { cudaDeviceProp props; - cudaError_t error = cudaGetDeviceProperties(&props, device_); - if (error != cudaSuccess) + if (cudaError_t error = cudaGetDeviceProperties(&props, device_); + error != cudaSuccess) { // report error HPX_THROW_EXCEPTION(hpx::error::kernel_error, @@ -66,7 +67,7 @@ namespace hpx { namespace cuda { namespace experimental { target::native_handle_type::native_handle_type(int device) : device_(device) - , stream_(0) + , stream_(nullptr) { init_processing_units(); } @@ -76,12 +77,12 @@ namespace hpx { namespace cuda { namespace experimental { reset(); } - void target::native_handle_type::reset() noexcept + void target::native_handle_type::reset() const noexcept { if (stream_) { - cudaError_t err = cudaStreamDestroy(stream_); // ignore error - HPX_UNUSED(err); + [[maybe_unused]] cudaError_t err = + cudaStreamDestroy(stream_); // ignore error } } @@ -91,7 +92,7 @@ namespace hpx { namespace cuda { namespace experimental { , processing_units_(rhs.processing_units_) , processor_family_(rhs.processor_family_) , processor_name_(rhs.processor_name_) - , stream_(0) + , stream_(nullptr) { } @@ -103,7 +104,7 @@ namespace hpx { namespace cuda { namespace experimental { , processor_name_(rhs.processor_name_) , stream_(rhs.stream_) { - rhs.stream_ = 0; + rhs.stream_ = nullptr; } target::native_handle_type& target::native_handle_type::operator=( @@ -132,7 +133,7 @@ namespace hpx { namespace cuda { namespace experimental { processor_family_ = rhs.processor_family_; processor_name_ = rhs.processor_name_; stream_ = rhs.stream_; - rhs.stream_ = 0; + rhs.stream_ = nullptr; return *this; } @@ -141,7 +142,7 @@ namespace hpx { namespace cuda { namespace experimental { { std::lock_guard l(mtx_); - if (stream_ == 0) + if (stream_ == nullptr) { cudaError_t error = cudaSetDevice(device_); if (error != cudaSuccess) @@ -151,6 +152,7 @@ namespace hpx { namespace cuda { namespace experimental { std::string("cudaSetDevice failed: ") + cudaGetErrorString(error)); } + error = cudaStreamCreateWithFlags(&stream_, cudaStreamNonBlocking); if (error != cudaSuccess) { @@ -166,17 +168,17 @@ namespace hpx { namespace cuda { namespace experimental { /////////////////////////////////////////////////////////////////////////// void target::synchronize() const { - cudaStream_t stream = handle_.get_stream(); + cudaStream_t const stream = handle_.get_stream(); - if (stream == 0) + if (stream == nullptr) { HPX_THROW_EXCEPTION(hpx::error::invalid_status, "cuda::experimental::target::synchronize", "no stream available"); } - cudaError_t error = cudaStreamSynchronize(stream); - if (error != cudaSuccess) + if (cudaError_t const error = cudaStreamSynchronize(stream); + error != cudaSuccess) { HPX_THROW_EXCEPTION(hpx::error::kernel_error, "cuda::experimental::target::synchronize", @@ -201,4 +203,4 @@ namespace hpx { namespace cuda { namespace experimental { static target target_; return target_; } -}}} // namespace hpx::cuda::experimental +} // namespace hpx::cuda::experimental diff --git a/libs/core/async_cuda/src/get_targets.cpp b/libs/core/async_cuda/src/get_targets.cpp index def66e823295..8660553b74a1 100644 --- a/libs/core/async_cuda/src/get_targets.cpp +++ b/libs/core/async_cuda/src/get_targets.cpp @@ -16,12 +16,13 @@ #include -namespace hpx { namespace cuda { namespace experimental { +namespace hpx::cuda::experimental { + std::vector get_local_targets() { int device_count = 0; - cudaError_t error = cudaGetDeviceCount(&device_count); - if (error != cudaSuccess) + if (cudaError_t const error = cudaGetDeviceCount(&device_count); + error != cudaSuccess) { HPX_THROW_EXCEPTION(hpx::error::kernel_error, "cuda::experimental::get_local_targets()", @@ -49,8 +50,7 @@ namespace hpx { namespace cuda { namespace experimental { void print_local_targets(void) { - auto targets = get_local_targets(); - for (auto target : targets) + for (auto const targets = get_local_targets(); auto target : targets) { std::cout << "GPU Device " << target.native_handle().get_device() << ": \"" << target.native_handle().processor_name() @@ -58,5 +58,4 @@ namespace hpx { namespace cuda { namespace experimental { << target.native_handle().processor_family() << "\n"; } } - -}}} // namespace hpx::cuda::experimental +} // namespace hpx::cuda::experimental diff --git a/libs/core/compute_local/include/hpx/compute_local/host/block_allocator.hpp b/libs/core/compute_local/include/hpx/compute_local/host/block_allocator.hpp index 8f918490bc22..62602be0934a 100644 --- a/libs/core/compute_local/include/hpx/compute_local/host/block_allocator.hpp +++ b/libs/core/compute_local/include/hpx/compute_local/host/block_allocator.hpp @@ -14,16 +14,13 @@ #include #include +#include #include #include #include #include #include #include -#include -#include -#include -#include #include #include diff --git a/libs/core/compute_local/include/hpx/compute_local/host/numa_allocator.hpp b/libs/core/compute_local/include/hpx/compute_local/host/numa_allocator.hpp index b9922656f937..8a6971767be7 100644 --- a/libs/core/compute_local/include/hpx/compute_local/host/numa_allocator.hpp +++ b/libs/core/compute_local/include/hpx/compute_local/host/numa_allocator.hpp @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -16,7 +17,6 @@ #include #include #include -#include #include #include diff --git a/libs/core/compute_local/include/hpx/compute_local/vector.hpp b/libs/core/compute_local/include/hpx/compute_local/vector.hpp index 7e9bc4390d1e..52652c27d73e 100644 --- a/libs/core/compute_local/include/hpx/compute_local/vector.hpp +++ b/libs/core/compute_local/include/hpx/compute_local/vector.hpp @@ -13,10 +13,10 @@ #include #include #include +#include #include #include #include -#include #include #include diff --git a/libs/core/compute_local/tests/regressions/for_each_value_proxy.cpp b/libs/core/compute_local/tests/regressions/for_each_value_proxy.cpp index 51dc5f61b867..507f2d0bb471 100644 --- a/libs/core/compute_local/tests/regressions/for_each_value_proxy.cpp +++ b/libs/core/compute_local/tests/regressions/for_each_value_proxy.cpp @@ -5,7 +5,6 @@ // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #include -#include #include #include #include diff --git a/libs/core/include_local/include/hpx/algorithm.hpp.in b/libs/core/include_local/include/hpx/algorithm.hpp.in index 2af2ef9905cb..cee57368361e 100644 --- a/libs/core/include_local/include/hpx/algorithm.hpp.in +++ b/libs/core/include_local/include/hpx/algorithm.hpp.in @@ -9,9 +9,4 @@ #pragma once #include -#include -#include -#include -#if defined(HPX_HAVE_DATAPAR) -#include -#endif +#include diff --git a/libs/core/include_local/include/hpx/datapar.hpp b/libs/core/include_local/include/hpx/datapar.hpp index 684772c28894..1e06910ed5bc 100644 --- a/libs/core/include_local/include/hpx/datapar.hpp +++ b/libs/core/include_local/include/hpx/datapar.hpp @@ -6,4 +6,4 @@ #pragma once -#include +#include diff --git a/libs/core/include_local/include/hpx/experimental/run_on_all.hpp b/libs/core/include_local/include/hpx/experimental/run_on_all.hpp index b0a094850ae8..2bc4d4ef5ca5 100644 --- a/libs/core/include_local/include/hpx/experimental/run_on_all.hpp +++ b/libs/core/include_local/include/hpx/experimental/run_on_all.hpp @@ -6,4 +6,4 @@ #pragma once -#include +#include diff --git a/libs/core/include_local/include/hpx/experimental/task_group.hpp b/libs/core/include_local/include/hpx/experimental/task_group.hpp index dfcefff952a6..bbf57168e512 100644 --- a/libs/core/include_local/include/hpx/experimental/task_group.hpp +++ b/libs/core/include_local/include/hpx/experimental/task_group.hpp @@ -6,4 +6,4 @@ #pragma once -#include +#include diff --git a/libs/core/include_local/include/hpx/functional.hpp b/libs/core/include_local/include/hpx/functional.hpp index 8053e39131d0..528e4595c68e 100644 --- a/libs/core/include_local/include/hpx/functional.hpp +++ b/libs/core/include_local/include/hpx/functional.hpp @@ -12,6 +12,6 @@ namespace hpx { - using hpx::invoke_fused; - using hpx::mem_fn; + HPX_CXX_EXPORT using hpx::invoke_fused; + HPX_CXX_EXPORT using hpx::mem_fn; } // namespace hpx diff --git a/libs/core/include_local/include/hpx/memory.hpp b/libs/core/include_local/include/hpx/memory.hpp index d1970b2befb3..9a7a973387db 100644 --- a/libs/core/include_local/include/hpx/memory.hpp +++ b/libs/core/include_local/include/hpx/memory.hpp @@ -6,7 +6,6 @@ #pragma once +#include #include #include -#include -#include diff --git a/libs/core/include_local/include/hpx/numeric.hpp b/libs/core/include_local/include/hpx/numeric.hpp index a3bd5bc95ad9..bbf57168e512 100644 --- a/libs/core/include_local/include/hpx/numeric.hpp +++ b/libs/core/include_local/include/hpx/numeric.hpp @@ -6,5 +6,4 @@ #pragma once -#include -#include +#include diff --git a/libs/core/include_local/include/hpx/task_block.hpp b/libs/core/include_local/include/hpx/task_block.hpp index 86307c03ba30..46186d082ee8 100644 --- a/libs/core/include_local/include/hpx/task_block.hpp +++ b/libs/core/include_local/include/hpx/task_block.hpp @@ -6,11 +6,13 @@ #pragma once -#include +#include namespace hpx { - using task_cancelled_exception = hpx::experimental::task_canceled_exception; - using hpx::experimental::define_task_block; - using hpx::experimental::define_task_block_restore_thread; - using hpx::experimental::task_block; + + HPX_CXX_EXPORT using task_cancelled_exception = + hpx::experimental::task_canceled_exception; + HPX_CXX_EXPORT using hpx::experimental::define_task_block; + HPX_CXX_EXPORT using hpx::experimental::define_task_block_restore_thread; + HPX_CXX_EXPORT using hpx::experimental::task_block; } // namespace hpx diff --git a/libs/core/include_local/include/hpx/type_traits.hpp b/libs/core/include_local/include/hpx/type_traits.hpp index 372336d8c334..9ea438a2e9df 100644 --- a/libs/core/include_local/include/hpx/type_traits.hpp +++ b/libs/core/include_local/include/hpx/type_traits.hpp @@ -11,5 +11,6 @@ #include namespace hpx { - using hpx::util::invoke_result; + + HPX_CXX_EXPORT using hpx::util::invoke_result; } // namespace hpx diff --git a/libs/core/init_runtime_local/src/init_runtime_local.cpp b/libs/core/init_runtime_local/src/init_runtime_local.cpp index c34a629106e1..14301f53d6b5 100644 --- a/libs/core/init_runtime_local/src/init_runtime_local.cpp +++ b/libs/core/init_runtime_local/src/init_runtime_local.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -30,7 +31,6 @@ #include #include #include -#include #if defined(HPX_NATIVE_MIC) || defined(__bgq__) #include diff --git a/libs/core/iterator_support/tests/include/hpx/iterator_support/tests/iter_sent.hpp b/libs/core/iterator_support/tests/include/hpx/iterator_support/tests/iter_sent.hpp index 7736e9f4e8e2..dde2d28978a7 100644 --- a/libs/core/iterator_support/tests/include/hpx/iterator_support/tests/iter_sent.hpp +++ b/libs/core/iterator_support/tests/include/hpx/iterator_support/tests/iter_sent.hpp @@ -9,7 +9,8 @@ #pragma once -#include +#include + #include #include diff --git a/libs/core/thrust/CMakeLists.txt b/libs/core/thrust/CMakeLists.txt index 6bd11debf858..cac9959f7b32 100644 --- a/libs/core/thrust/CMakeLists.txt +++ b/libs/core/thrust/CMakeLists.txt @@ -10,8 +10,9 @@ endif() list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") -set(thrust_headers hpx/thrust/policy.hpp hpx/thrust/algorithms.hpp - hpx/thrust/detail/algorithm_map.hpp +set(thrust_headers + hpx/thrust/policy.hpp hpx/thrust/thrust_headers.hpp + hpx/thrust/algorithms.hpp hpx/thrust/detail/algorithm_map.hpp ) # cmake-format: off @@ -24,16 +25,21 @@ include(HPX_AddModule) add_hpx_module( core thrust GLOBAL_HEADER_GEN ON + GLOBAL_HEADER_MODULE_GEN ON SOURCES ${thrust_sources} HEADERS ${thrust_headers} + EXCLUDE_FROM_GLOBAL_HEADER "hpx/thrust/thrust_headers.hpp" COMPAT_HEADERS ${thrust_compat_headers} MODULE_DEPENDENCIES hpx_algorithms + hpx_async_cuda hpx_concepts hpx_execution hpx_execution_base + hpx_executors hpx_functional hpx_futures - hpx_async_cuda + hpx_tag_invoke + hpx_threading_base CMAKE_SUBDIRS examples tests ) diff --git a/libs/core/thrust/include/hpx/thrust/algorithms.hpp b/libs/core/thrust/include/hpx/thrust/algorithms.hpp index 1eb224f69feb..c9ffd284f576 100644 --- a/libs/core/thrust/include/hpx/thrust/algorithms.hpp +++ b/libs/core/thrust/include/hpx/thrust/algorithms.hpp @@ -3,40 +3,38 @@ // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// #pragma once #include -#include -#include +#include #include #include -#include + #include namespace hpx::thrust { - template + template requires(is_thrust_execution_policy_v> && - detail::is_algorithm_mapped) - decltype(auto) tag_invoke(HPXTag tag, ThrustPolicy&& policy, Args&&... args) + detail::is_algorithm_mapped) + decltype(auto) tag_invoke(Tag tag, ThrustPolicy&& policy, Args&&... args) { if constexpr (hpx::is_async_execution_policy_v< std::decay_t>) { - if constexpr (std::is_void_v::invoke(std::declval(), - std::declval()...))>) + using result_type = decltype(detail::algorithm_map::invoke( + std::declval(), std::declval()...)); + if constexpr (std::is_void_v) { - detail::algorithm_map::invoke( + detail::algorithm_map::invoke( HPX_FORWARD(ThrustPolicy, policy), HPX_FORWARD(Args, args)...); return policy.get_future(); // future } else { - auto result = detail::algorithm_map::invoke( + auto result = detail::algorithm_map::invoke( HPX_FORWARD(ThrustPolicy, policy), HPX_FORWARD(Args, args)...); return policy.get_future().then( @@ -48,7 +46,7 @@ namespace hpx::thrust { } else { - return detail::algorithm_map::invoke( + return detail::algorithm_map::invoke( HPX_FORWARD(ThrustPolicy, policy), HPX_FORWARD(Args, args)...); } } diff --git a/libs/core/thrust/include/hpx/thrust/detail/algorithm_map.hpp b/libs/core/thrust/include/hpx/thrust/detail/algorithm_map.hpp index 1008f4ef103b..61c185ebc8eb 100644 --- a/libs/core/thrust/include/hpx/thrust/detail/algorithm_map.hpp +++ b/libs/core/thrust/include/hpx/thrust/detail/algorithm_map.hpp @@ -3,54 +3,23 @@ // SPDX-License-Identifier: BSL-1.0 // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// #pragma once // HPX algorithm headers for tag types -#include -#include -#include +#include +#include +#include // Centralized Thrust algorithm headers -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include // HPX_FORWARD #include #include namespace hpx::thrust::detail { - template - struct - algorithm_map; // No definition = compilation error for unmapped algorithms + // No definition = compilation error for unmapped algorithms + HPX_CXX_EXPORT template + struct algorithm_map; template <> struct algorithm_map @@ -679,10 +648,9 @@ namespace hpx::thrust::detail { }; // boolean predicate indicating whether a mapping exists - template + HPX_CXX_EXPORT template concept is_algorithm_mapped = requires { - algorithm_map::invoke( + algorithm_map::invoke( std::declval(), std::declval()...); }; - } // namespace hpx::thrust::detail diff --git a/libs/core/thrust/include/hpx/thrust/policy.hpp b/libs/core/thrust/include/hpx/thrust/policy.hpp index 4ef08a001e82..60501b952f92 100644 --- a/libs/core/thrust/include/hpx/thrust/policy.hpp +++ b/libs/core/thrust/include/hpx/thrust/policy.hpp @@ -6,40 +6,32 @@ #pragma once -// Required HPX execution headers -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include #include -#include -#include +#include +#include +#include #include -#include #include #include namespace hpx::thrust { - struct thrust_task_policy; //for async ops - template + HPX_CXX_EXPORT struct thrust_task_policy; // for async ops + HPX_CXX_EXPORT template struct thrust_task_policy_shim; - struct thrust_policy; - template + HPX_CXX_EXPORT struct thrust_policy; + HPX_CXX_EXPORT template struct thrust_policy_shim; - struct thrust_host_policy; - struct thrust_device_policy; + HPX_CXX_EXPORT struct thrust_host_policy; + HPX_CXX_EXPORT struct thrust_device_policy; - struct thrust_task_policy + HPX_CXX_EXPORT struct thrust_task_policy { using executor_type = hpx::execution::parallel_executor; using executor_parameters_type = @@ -61,8 +53,8 @@ namespace hpx::thrust { return *this; } - thrust_task_policy_shim on( - hpx::cuda::experimental::target const& t) const; + static thrust_task_policy_shim + on(hpx::cuda::experimental::target const& t); // HPX execution policy interface executor_type executor() const @@ -109,7 +101,7 @@ namespace hpx::thrust { executor_parameters_type params_{}; }; - template + HPX_CXX_EXPORT template struct thrust_task_policy_shim : thrust_task_policy { using executor_type = Executor; @@ -188,10 +180,10 @@ namespace hpx::thrust { } template ::value && - std::is_constructible::value, - Dependent>::type> + typename Enable = + std::enable_if_t && + std::is_constructible_v, + Dependent>> constexpr thrust_task_policy_shim() { } @@ -217,9 +209,10 @@ namespace hpx::thrust { std::shared_ptr bound_target_{}; }; - inline thrust_task_policy_shim - thrust_task_policy::on(hpx::cuda::experimental::target const& t) const + thrust_task_policy::on(hpx::cuda::experimental::target const& t) { using shim_type = thrust_task_policy_shim; @@ -227,7 +220,7 @@ namespace hpx::thrust { } // Base thrust_policy - struct thrust_policy + HPX_CXX_EXPORT struct thrust_policy { using executor_type = hpx::execution::parallel_executor; using executor_parameters_type = @@ -254,7 +247,7 @@ namespace hpx::thrust { Executor_, executor_parameters_type>::type on(Executor_&& exec) const { - using executor_type = typename std::decay::type; + using executor_type = std::decay_t; static_assert(hpx::traits::is_executor_any_v, "hpx::traits::is_executor_any_v"); @@ -284,7 +277,9 @@ namespace hpx::thrust { { return params_; } - constexpr executor_parameters_type const& parameters() const + + [[nodiscard]] constexpr executor_parameters_type const& parameters() + const { return params_; } @@ -293,7 +288,7 @@ namespace hpx::thrust { executor_parameters_type params_{}; }; - template + HPX_CXX_EXPORT template struct thrust_policy_shim : thrust_policy { using executor_type = Executor; @@ -320,7 +315,7 @@ namespace hpx::thrust { thrust_policy_shim, Executor_, executor_parameters_type>::type on(Executor_&& exec) const { - using executor_type = typename std::decay::type; + using executor_type = std::decay_t; static_assert(hpx::traits::is_executor_any_v, "hpx::traits::is_executor_any_v"); @@ -363,10 +358,10 @@ namespace hpx::thrust { } template ::value && - std::is_constructible::value, - Dependent>::type> + typename Enable = + std::enable_if_t && + std::is_constructible_v, + Dependent>> constexpr thrust_policy_shim() { } @@ -384,7 +379,7 @@ namespace hpx::thrust { }; // Host-specific policy that inherits from thrust_policy - struct thrust_host_policy : thrust_policy + HPX_CXX_EXPORT struct thrust_host_policy : thrust_policy { constexpr thrust_host_policy() = default; @@ -396,25 +391,25 @@ namespace hpx::thrust { }; // Device-specific policy that inherits from thrust_policy - struct thrust_device_policy : thrust_policy + HPX_CXX_EXPORT struct thrust_device_policy : thrust_policy { constexpr thrust_device_policy() = default; // Return thrust::device execution policy - constexpr auto get() const + static constexpr auto get() { return ::thrust::device; } }; // Global policy instances - inline constexpr thrust_host_policy thrust_host{}; - inline constexpr thrust_device_policy thrust_device{}; + HPX_CXX_EXPORT inline constexpr thrust_host_policy thrust_host{}; + HPX_CXX_EXPORT inline constexpr thrust_device_policy thrust_device{}; // Legacy support - default thrust policy (keep for backward compatibility) - static constexpr thrust_policy thrust; + HPX_CXX_EXPORT inline constexpr thrust_policy thrust; - template + HPX_CXX_EXPORT template struct is_thrust_execution_policy : std::false_type { }; @@ -425,7 +420,7 @@ namespace hpx::thrust { { }; - template + HPX_CXX_EXPORT template struct is_thrust_execution_policy< hpx::thrust::thrust_policy_shim> : std::true_type { @@ -449,22 +444,24 @@ namespace hpx::thrust { { }; - template + HPX_CXX_EXPORT template struct is_thrust_execution_policy< hpx::thrust::thrust_task_policy_shim> : std::true_type { }; - template + HPX_CXX_EXPORT template inline constexpr bool is_thrust_execution_policy_v = is_thrust_execution_policy::value; namespace detail { - template + + HPX_CXX_EXPORT template struct get_policy_result; - template + HPX_CXX_EXPORT template struct get_policy_result>>> @@ -483,7 +480,7 @@ namespace hpx::thrust { } }; - template + HPX_CXX_EXPORT template struct get_policy_result>>> @@ -500,17 +497,17 @@ namespace hpx::thrust { } }; } // namespace detail - } // namespace hpx::thrust namespace hpx::detail { - template + + HPX_CXX_EXPORT template struct is_rebound_execution_policy< hpx::thrust::thrust_policy_shim> : std::true_type { }; - template + HPX_CXX_EXPORT template struct is_rebound_execution_policy< hpx::thrust::thrust_task_policy_shim> : std::true_type @@ -522,7 +519,7 @@ namespace hpx::detail { { }; - template + HPX_CXX_EXPORT template struct is_execution_policy< hpx::thrust::thrust_policy_shim> : std::true_type { @@ -544,7 +541,7 @@ namespace hpx::detail { { }; - template + HPX_CXX_EXPORT template struct is_execution_policy< hpx::thrust::thrust_task_policy_shim> : std::true_type @@ -557,7 +554,7 @@ namespace hpx::detail { { }; - template + HPX_CXX_EXPORT template struct is_parallel_execution_policy< hpx::thrust::thrust_policy_shim> : std::true_type { @@ -581,7 +578,7 @@ namespace hpx::detail { { }; - template + HPX_CXX_EXPORT template struct is_parallel_execution_policy< hpx::thrust::thrust_task_policy_shim> : std::true_type @@ -594,11 +591,10 @@ namespace hpx::detail { { }; - template + HPX_CXX_EXPORT template struct is_async_execution_policy< hpx::thrust::thrust_task_policy_shim> : std::true_type { }; - } // namespace hpx::detail diff --git a/libs/core/thrust/include/hpx/thrust/thrust_headers.hpp b/libs/core/thrust/include/hpx/thrust/thrust_headers.hpp new file mode 100644 index 000000000000..6345ce5c43bd --- /dev/null +++ b/libs/core/thrust/include/hpx/thrust/thrust_headers.hpp @@ -0,0 +1,39 @@ +// Copyright (c) 2025 Aditya Sapra +// +// SPDX-License-Identifier: BSL-1.0 +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#pragma once + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include diff --git a/libs/full/collectives/include/hpx/collectives/all_reduce.hpp b/libs/full/collectives/include/hpx/collectives/all_reduce.hpp index deb2fc544ebe..bee7be77555f 100644 --- a/libs/full/collectives/include/hpx/collectives/all_reduce.hpp +++ b/libs/full/collectives/include/hpx/collectives/all_reduce.hpp @@ -224,10 +224,10 @@ namespace hpx { namespace collectives { #include #include #include +#include #include #include #include -#include #include #include diff --git a/libs/full/collectives/include/hpx/collectives/exclusive_scan.hpp b/libs/full/collectives/include/hpx/collectives/exclusive_scan.hpp index 39fab93290ea..8cbf5bd17d25 100644 --- a/libs/full/collectives/include/hpx/collectives/exclusive_scan.hpp +++ b/libs/full/collectives/include/hpx/collectives/exclusive_scan.hpp @@ -278,10 +278,10 @@ namespace hpx { namespace collectives { #include #include #include +#include #include #include #include -#include #include #include diff --git a/libs/full/collectives/include/hpx/collectives/inclusive_scan.hpp b/libs/full/collectives/include/hpx/collectives/inclusive_scan.hpp index 29d9bf1afcff..c471f738d967 100644 --- a/libs/full/collectives/include/hpx/collectives/inclusive_scan.hpp +++ b/libs/full/collectives/include/hpx/collectives/inclusive_scan.hpp @@ -224,10 +224,10 @@ namespace hpx { namespace collectives { #include #include #include +#include #include #include #include -#include #include #include diff --git a/libs/full/collectives/include/hpx/collectives/reduce.hpp b/libs/full/collectives/include/hpx/collectives/reduce.hpp index d8c2b164903e..f8501eb24fb8 100644 --- a/libs/full/collectives/include/hpx/collectives/reduce.hpp +++ b/libs/full/collectives/include/hpx/collectives/reduce.hpp @@ -402,10 +402,10 @@ namespace hpx { namespace collectives { #include #include #include +#include #include #include #include -#include #include #include diff --git a/libs/full/collectives/src/detail/communication_set_node.cpp b/libs/full/collectives/src/detail/communication_set_node.cpp index cd37697ffcc4..3ce5e602aab0 100644 --- a/libs/full/collectives/src/detail/communication_set_node.cpp +++ b/libs/full/collectives/src/detail/communication_set_node.cpp @@ -12,10 +12,10 @@ #include #include #include +#include #include #include #include -#include #include #include #include diff --git a/libs/full/compute/include/hpx/compute/host/distributed_target.hpp b/libs/full/compute/include/hpx/compute/host/distributed_target.hpp index bab385033db7..3820e3e9c32d 100644 --- a/libs/full/compute/include/hpx/compute/host/distributed_target.hpp +++ b/libs/full/compute/include/hpx/compute/host/distributed_target.hpp @@ -9,10 +9,10 @@ #pragma once #include -#include #if defined(HPX_HAVE_DISTRIBUTED_RUNTIME) #include +#include #include #include #include diff --git a/libs/full/include/include/hpx/algorithm.hpp b/libs/full/include/include/hpx/algorithm.hpp index 097be17ddb34..d8a57c8eba95 100644 --- a/libs/full/include/include/hpx/algorithm.hpp +++ b/libs/full/include/include/hpx/algorithm.hpp @@ -7,10 +7,5 @@ #pragma once #include -#include -#include -#include -#if defined(HPX_HAVE_DATAPAR) -#include -#endif +#include #include diff --git a/libs/full/include/include/hpx/include/datapar.hpp b/libs/full/include/include/hpx/include/datapar.hpp index 5a36e657fff2..4ff379cc736c 100644 --- a/libs/full/include/include/hpx/include/datapar.hpp +++ b/libs/full/include/include/hpx/include/datapar.hpp @@ -6,4 +6,4 @@ #pragma once -#include +#include diff --git a/libs/full/include/include/hpx/include/parallel_adjacent_difference.hpp b/libs/full/include/include/hpx/include/parallel_adjacent_difference.hpp index a998d14fe7d7..f8f69c55e980 100644 --- a/libs/full/include/include/hpx/include/parallel_adjacent_difference.hpp +++ b/libs/full/include/include/hpx/include/parallel_adjacent_difference.hpp @@ -7,6 +7,6 @@ #pragma once #include -#include +#include #include diff --git a/libs/full/include/include/hpx/include/parallel_adjacent_find.hpp b/libs/full/include/include/hpx/include/parallel_adjacent_find.hpp index 28238e46499e..7e9c3841ac99 100644 --- a/libs/full/include/include/hpx/include/parallel_adjacent_find.hpp +++ b/libs/full/include/include/hpx/include/parallel_adjacent_find.hpp @@ -8,6 +8,5 @@ #pragma once #include -#include - +#include #include diff --git a/libs/full/include/include/hpx/include/parallel_algorithm.hpp b/libs/full/include/include/hpx/include/parallel_algorithm.hpp index 3479786f0147..caaf22a3097f 100644 --- a/libs/full/include/include/hpx/include/parallel_algorithm.hpp +++ b/libs/full/include/include/hpx/include/parallel_algorithm.hpp @@ -6,4 +6,4 @@ #pragma once -#include +#include diff --git a/libs/full/include/include/hpx/include/parallel_all_any_none_of.hpp b/libs/full/include/include/hpx/include/parallel_all_any_none_of.hpp index a40de5f138fd..15b2b7c025da 100644 --- a/libs/full/include/include/hpx/include/parallel_all_any_none_of.hpp +++ b/libs/full/include/include/hpx/include/parallel_all_any_none_of.hpp @@ -8,7 +8,5 @@ #pragma once #include -#include -#include - +#include #include diff --git a/libs/full/include/include/hpx/include/parallel_container_algorithm.hpp b/libs/full/include/include/hpx/include/parallel_container_algorithm.hpp index 68b94e3d453e..18fb7a370e99 100644 --- a/libs/full/include/include/hpx/include/parallel_container_algorithm.hpp +++ b/libs/full/include/include/hpx/include/parallel_container_algorithm.hpp @@ -6,5 +6,4 @@ #pragma once -#include -#include +#include diff --git a/libs/full/include/include/hpx/include/parallel_copy.hpp b/libs/full/include/include/hpx/include/parallel_copy.hpp index 3b7728012aa5..9a6be3def307 100644 --- a/libs/full/include/include/hpx/include/parallel_copy.hpp +++ b/libs/full/include/include/hpx/include/parallel_copy.hpp @@ -7,5 +7,4 @@ #pragma once -#include -#include +#include diff --git a/libs/full/include/include/hpx/include/parallel_count.hpp b/libs/full/include/include/hpx/include/parallel_count.hpp index e8d801bf0391..97ba1f763cda 100644 --- a/libs/full/include/include/hpx/include/parallel_count.hpp +++ b/libs/full/include/include/hpx/include/parallel_count.hpp @@ -8,7 +8,5 @@ #pragma once #include -#include -#include - +#include #include diff --git a/libs/full/include/include/hpx/include/parallel_destroy.hpp b/libs/full/include/include/hpx/include/parallel_destroy.hpp index ec7a14905f04..751daa57dd43 100644 --- a/libs/full/include/include/hpx/include/parallel_destroy.hpp +++ b/libs/full/include/include/hpx/include/parallel_destroy.hpp @@ -6,5 +6,4 @@ #pragma once -#include -#include +#include diff --git a/libs/full/include/include/hpx/include/parallel_equal.hpp b/libs/full/include/include/hpx/include/parallel_equal.hpp index 9058dead409d..64380a76c827 100644 --- a/libs/full/include/include/hpx/include/parallel_equal.hpp +++ b/libs/full/include/include/hpx/include/parallel_equal.hpp @@ -7,5 +7,4 @@ #pragma once -#include -#include +#include diff --git a/libs/full/include/include/hpx/include/parallel_fill.hpp b/libs/full/include/include/hpx/include/parallel_fill.hpp index b9c9091a50db..dd63e8a1fc1a 100644 --- a/libs/full/include/include/hpx/include/parallel_fill.hpp +++ b/libs/full/include/include/hpx/include/parallel_fill.hpp @@ -8,7 +8,5 @@ #pragma once #include -#include -#include - +#include #include diff --git a/libs/full/include/include/hpx/include/parallel_find.hpp b/libs/full/include/include/hpx/include/parallel_find.hpp index f9f773da589e..0cd5b2b9e0f4 100644 --- a/libs/full/include/include/hpx/include/parallel_find.hpp +++ b/libs/full/include/include/hpx/include/parallel_find.hpp @@ -8,7 +8,5 @@ #pragma once #include -#include -#include - +#include #include diff --git a/libs/full/include/include/hpx/include/parallel_for_each.hpp b/libs/full/include/include/hpx/include/parallel_for_each.hpp index fd789e96698e..dc1644843942 100644 --- a/libs/full/include/include/hpx/include/parallel_for_each.hpp +++ b/libs/full/include/include/hpx/include/parallel_for_each.hpp @@ -7,7 +7,5 @@ #pragma once -#include -#include - +#include #include diff --git a/libs/full/include/include/hpx/include/parallel_for_loop.hpp b/libs/full/include/include/hpx/include/parallel_for_loop.hpp index a65c5092b794..71b7a529303f 100644 --- a/libs/full/include/include/hpx/include/parallel_for_loop.hpp +++ b/libs/full/include/include/hpx/include/parallel_for_loop.hpp @@ -6,4 +6,4 @@ #pragma once -#include +#include diff --git a/libs/full/include/include/hpx/include/parallel_generate.hpp b/libs/full/include/include/hpx/include/parallel_generate.hpp index 4d4449bcc98c..e09267c5a4e9 100644 --- a/libs/full/include/include/hpx/include/parallel_generate.hpp +++ b/libs/full/include/include/hpx/include/parallel_generate.hpp @@ -8,7 +8,5 @@ #pragma once #include -#include -#include - +#include #include diff --git a/libs/full/include/include/hpx/include/parallel_is_heap.hpp b/libs/full/include/include/hpx/include/parallel_is_heap.hpp index d2f7291df778..0f948bae1262 100644 --- a/libs/full/include/include/hpx/include/parallel_is_heap.hpp +++ b/libs/full/include/include/hpx/include/parallel_is_heap.hpp @@ -6,5 +6,4 @@ #pragma once -#include -#include +#include diff --git a/libs/full/include/include/hpx/include/parallel_is_partitioned.hpp b/libs/full/include/include/hpx/include/parallel_is_partitioned.hpp index 224530ae4820..f1a6b5c9577d 100644 --- a/libs/full/include/include/hpx/include/parallel_is_partitioned.hpp +++ b/libs/full/include/include/hpx/include/parallel_is_partitioned.hpp @@ -6,5 +6,4 @@ #pragma once -#include -#include +#include diff --git a/libs/full/include/include/hpx/include/parallel_is_sorted.hpp b/libs/full/include/include/hpx/include/parallel_is_sorted.hpp index 939cac635c42..f1a6b5c9577d 100644 --- a/libs/full/include/include/hpx/include/parallel_is_sorted.hpp +++ b/libs/full/include/include/hpx/include/parallel_is_sorted.hpp @@ -6,5 +6,4 @@ #pragma once -#include -#include +#include diff --git a/libs/full/include/include/hpx/include/parallel_lexicographical_compare.hpp b/libs/full/include/include/hpx/include/parallel_lexicographical_compare.hpp index dc53af7873db..88722c03da8d 100644 --- a/libs/full/include/include/hpx/include/parallel_lexicographical_compare.hpp +++ b/libs/full/include/include/hpx/include/parallel_lexicographical_compare.hpp @@ -6,4 +6,4 @@ #pragma once -#include +#include diff --git a/libs/full/include/include/hpx/include/parallel_make_heap.hpp b/libs/full/include/include/hpx/include/parallel_make_heap.hpp index d61678da779d..88722c03da8d 100644 --- a/libs/full/include/include/hpx/include/parallel_make_heap.hpp +++ b/libs/full/include/include/hpx/include/parallel_make_heap.hpp @@ -6,5 +6,4 @@ #pragma once -#include -#include +#include diff --git a/libs/full/include/include/hpx/include/parallel_memory.hpp b/libs/full/include/include/hpx/include/parallel_memory.hpp index 1c1752a008dc..7c2422cfb9e8 100644 --- a/libs/full/include/include/hpx/include/parallel_memory.hpp +++ b/libs/full/include/include/hpx/include/parallel_memory.hpp @@ -7,4 +7,4 @@ #pragma once #include -#include +#include diff --git a/libs/full/include/include/hpx/include/parallel_merge.hpp b/libs/full/include/include/hpx/include/parallel_merge.hpp index 77323cd176b3..0f948bae1262 100644 --- a/libs/full/include/include/hpx/include/parallel_merge.hpp +++ b/libs/full/include/include/hpx/include/parallel_merge.hpp @@ -6,5 +6,4 @@ #pragma once -#include -#include +#include diff --git a/libs/full/include/include/hpx/include/parallel_minmax.hpp b/libs/full/include/include/hpx/include/parallel_minmax.hpp index 8d8cf71e3127..b3fece645488 100644 --- a/libs/full/include/include/hpx/include/parallel_minmax.hpp +++ b/libs/full/include/include/hpx/include/parallel_minmax.hpp @@ -8,7 +8,5 @@ #pragma once #include -#include -#include - +#include #include diff --git a/libs/full/include/include/hpx/include/parallel_mismatch.hpp b/libs/full/include/include/hpx/include/parallel_mismatch.hpp index 82bc79a8f4da..64380a76c827 100644 --- a/libs/full/include/include/hpx/include/parallel_mismatch.hpp +++ b/libs/full/include/include/hpx/include/parallel_mismatch.hpp @@ -7,5 +7,4 @@ #pragma once -#include -#include +#include diff --git a/libs/full/include/include/hpx/include/parallel_move.hpp b/libs/full/include/include/hpx/include/parallel_move.hpp index 80f3d2f12914..dc4adb13136f 100644 --- a/libs/full/include/include/hpx/include/parallel_move.hpp +++ b/libs/full/include/include/hpx/include/parallel_move.hpp @@ -7,5 +7,4 @@ #pragma once -#include -#include +#include diff --git a/libs/full/include/include/hpx/include/parallel_numeric.hpp b/libs/full/include/include/hpx/include/parallel_numeric.hpp index 709744b244ed..caaf22a3097f 100644 --- a/libs/full/include/include/hpx/include/parallel_numeric.hpp +++ b/libs/full/include/include/hpx/include/parallel_numeric.hpp @@ -6,4 +6,4 @@ #pragma once -#include +#include diff --git a/libs/full/include/include/hpx/include/parallel_partition.hpp b/libs/full/include/include/hpx/include/parallel_partition.hpp index 5d7394784860..7cc6333db365 100644 --- a/libs/full/include/include/hpx/include/parallel_partition.hpp +++ b/libs/full/include/include/hpx/include/parallel_partition.hpp @@ -7,5 +7,4 @@ #pragma once -#include -#include +#include diff --git a/libs/full/include/include/hpx/include/parallel_reduce.hpp b/libs/full/include/include/hpx/include/parallel_reduce.hpp index ad6974875db6..3d3e706c6e93 100644 --- a/libs/full/include/include/hpx/include/parallel_reduce.hpp +++ b/libs/full/include/include/hpx/include/parallel_reduce.hpp @@ -8,8 +8,5 @@ #pragma once #include -#include -#include -#include - +#include #include diff --git a/libs/full/include/include/hpx/include/parallel_remove.hpp b/libs/full/include/include/hpx/include/parallel_remove.hpp index 68bab270fa63..0f948bae1262 100644 --- a/libs/full/include/include/hpx/include/parallel_remove.hpp +++ b/libs/full/include/include/hpx/include/parallel_remove.hpp @@ -6,5 +6,4 @@ #pragma once -#include -#include +#include diff --git a/libs/full/include/include/hpx/include/parallel_remove_copy.hpp b/libs/full/include/include/hpx/include/parallel_remove_copy.hpp index 71d0eae707c3..f1a6b5c9577d 100644 --- a/libs/full/include/include/hpx/include/parallel_remove_copy.hpp +++ b/libs/full/include/include/hpx/include/parallel_remove_copy.hpp @@ -6,5 +6,4 @@ #pragma once -#include -#include +#include diff --git a/libs/full/include/include/hpx/include/parallel_replace.hpp b/libs/full/include/include/hpx/include/parallel_replace.hpp index 28322bbef0d3..dc4adb13136f 100644 --- a/libs/full/include/include/hpx/include/parallel_replace.hpp +++ b/libs/full/include/include/hpx/include/parallel_replace.hpp @@ -7,5 +7,4 @@ #pragma once -#include -#include +#include diff --git a/libs/full/include/include/hpx/include/parallel_reverse.hpp b/libs/full/include/include/hpx/include/parallel_reverse.hpp index bc0e0d51f15e..9a6be3def307 100644 --- a/libs/full/include/include/hpx/include/parallel_reverse.hpp +++ b/libs/full/include/include/hpx/include/parallel_reverse.hpp @@ -7,5 +7,4 @@ #pragma once -#include -#include +#include diff --git a/libs/full/include/include/hpx/include/parallel_rotate.hpp b/libs/full/include/include/hpx/include/parallel_rotate.hpp index 6bd1b5cca47b..949236708f7e 100644 --- a/libs/full/include/include/hpx/include/parallel_rotate.hpp +++ b/libs/full/include/include/hpx/include/parallel_rotate.hpp @@ -6,5 +6,4 @@ #pragma once -#include -#include +#include diff --git a/libs/full/include/include/hpx/include/parallel_scan.hpp b/libs/full/include/include/hpx/include/parallel_scan.hpp index 8f16d1c05119..e7db28f766a2 100644 --- a/libs/full/include/include/hpx/include/parallel_scan.hpp +++ b/libs/full/include/include/hpx/include/parallel_scan.hpp @@ -7,8 +7,6 @@ #pragma once #include -#include -#include - +#include #include #include diff --git a/libs/full/include/include/hpx/include/parallel_search.hpp b/libs/full/include/include/hpx/include/parallel_search.hpp index 00d7ac410191..dc4adb13136f 100644 --- a/libs/full/include/include/hpx/include/parallel_search.hpp +++ b/libs/full/include/include/hpx/include/parallel_search.hpp @@ -7,5 +7,4 @@ #pragma once -#include -#include +#include diff --git a/libs/full/include/include/hpx/include/parallel_set_operations.hpp b/libs/full/include/include/hpx/include/parallel_set_operations.hpp index e31dd437ae33..751daa57dd43 100644 --- a/libs/full/include/include/hpx/include/parallel_set_operations.hpp +++ b/libs/full/include/include/hpx/include/parallel_set_operations.hpp @@ -6,14 +6,4 @@ #pragma once -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include +#include diff --git a/libs/full/include/include/hpx/include/parallel_sort.hpp b/libs/full/include/include/hpx/include/parallel_sort.hpp index cf36d2ecda8f..751daa57dd43 100644 --- a/libs/full/include/include/hpx/include/parallel_sort.hpp +++ b/libs/full/include/include/hpx/include/parallel_sort.hpp @@ -6,8 +6,4 @@ #pragma once -#include -#include -#include -#include -#include +#include diff --git a/libs/full/include/include/hpx/include/parallel_swap_ranges.hpp b/libs/full/include/include/hpx/include/parallel_swap_ranges.hpp index 02dae60f955e..dc4adb13136f 100644 --- a/libs/full/include/include/hpx/include/parallel_swap_ranges.hpp +++ b/libs/full/include/include/hpx/include/parallel_swap_ranges.hpp @@ -7,4 +7,4 @@ #pragma once -#include +#include diff --git a/libs/full/include/include/hpx/include/parallel_task_block.hpp b/libs/full/include/include/hpx/include/parallel_task_block.hpp index 8b2865f4b074..704502e17ecd 100644 --- a/libs/full/include/include/hpx/include/parallel_task_block.hpp +++ b/libs/full/include/include/hpx/include/parallel_task_block.hpp @@ -7,4 +7,4 @@ #pragma once #include -#include +#include diff --git a/libs/full/include/include/hpx/include/parallel_transform.hpp b/libs/full/include/include/hpx/include/parallel_transform.hpp index 3c45ac12a541..6c494e5c0b59 100644 --- a/libs/full/include/include/hpx/include/parallel_transform.hpp +++ b/libs/full/include/include/hpx/include/parallel_transform.hpp @@ -8,7 +8,5 @@ #pragma once #include -#include -#include - +#include #include diff --git a/libs/full/include/include/hpx/include/parallel_transform_reduce.hpp b/libs/full/include/include/hpx/include/parallel_transform_reduce.hpp index 30966592d6eb..fce2a333b176 100644 --- a/libs/full/include/include/hpx/include/parallel_transform_reduce.hpp +++ b/libs/full/include/include/hpx/include/parallel_transform_reduce.hpp @@ -8,7 +8,5 @@ #pragma once #include -#include -#include - +#include #include diff --git a/libs/full/include/include/hpx/include/parallel_transform_scan.hpp b/libs/full/include/include/hpx/include/parallel_transform_scan.hpp index a058a0e315db..4d9d89077c1a 100644 --- a/libs/full/include/include/hpx/include/parallel_transform_scan.hpp +++ b/libs/full/include/include/hpx/include/parallel_transform_scan.hpp @@ -7,8 +7,6 @@ #pragma once #include -#include -#include - +#include #include #include diff --git a/libs/full/include/include/hpx/include/parallel_uninitialized_copy.hpp b/libs/full/include/include/hpx/include/parallel_uninitialized_copy.hpp index c9f4f44e8d7d..caaf22a3097f 100644 --- a/libs/full/include/include/hpx/include/parallel_uninitialized_copy.hpp +++ b/libs/full/include/include/hpx/include/parallel_uninitialized_copy.hpp @@ -6,4 +6,4 @@ #pragma once -#include +#include diff --git a/libs/full/include/include/hpx/include/parallel_uninitialized_default_construct.hpp b/libs/full/include/include/hpx/include/parallel_uninitialized_default_construct.hpp index 36945448ddad..64e604e59061 100644 --- a/libs/full/include/include/hpx/include/parallel_uninitialized_default_construct.hpp +++ b/libs/full/include/include/hpx/include/parallel_uninitialized_default_construct.hpp @@ -6,4 +6,4 @@ #pragma once -#include +#include diff --git a/libs/full/include/include/hpx/include/parallel_uninitialized_fill.hpp b/libs/full/include/include/hpx/include/parallel_uninitialized_fill.hpp index 96521405c8a8..caaf22a3097f 100644 --- a/libs/full/include/include/hpx/include/parallel_uninitialized_fill.hpp +++ b/libs/full/include/include/hpx/include/parallel_uninitialized_fill.hpp @@ -6,4 +6,4 @@ #pragma once -#include +#include diff --git a/libs/full/include/include/hpx/include/parallel_uninitialized_move.hpp b/libs/full/include/include/hpx/include/parallel_uninitialized_move.hpp index bcc7cea0b29a..64e604e59061 100644 --- a/libs/full/include/include/hpx/include/parallel_uninitialized_move.hpp +++ b/libs/full/include/include/hpx/include/parallel_uninitialized_move.hpp @@ -6,4 +6,4 @@ #pragma once -#include +#include diff --git a/libs/full/include/include/hpx/include/parallel_uninitialized_value_construct.hpp b/libs/full/include/include/hpx/include/parallel_uninitialized_value_construct.hpp index 32e312052881..64e604e59061 100644 --- a/libs/full/include/include/hpx/include/parallel_uninitialized_value_construct.hpp +++ b/libs/full/include/include/hpx/include/parallel_uninitialized_value_construct.hpp @@ -6,4 +6,4 @@ #pragma once -#include +#include diff --git a/libs/full/include/include/hpx/include/parallel_unique.hpp b/libs/full/include/include/hpx/include/parallel_unique.hpp index 9fb57174b3dd..0f948bae1262 100644 --- a/libs/full/include/include/hpx/include/parallel_unique.hpp +++ b/libs/full/include/include/hpx/include/parallel_unique.hpp @@ -6,5 +6,4 @@ #pragma once -#include -#include +#include diff --git a/libs/full/include/include/hpx/include/traits.hpp b/libs/full/include/include/hpx/include/traits.hpp index 8d826fe6baee..eac4c987911a 100644 --- a/libs/full/include/include/hpx/include/traits.hpp +++ b/libs/full/include/include/hpx/include/traits.hpp @@ -8,8 +8,7 @@ #include -#include -#include +#include #include #include #include diff --git a/libs/full/include/include/hpx/include/unseq.hpp b/libs/full/include/include/hpx/include/unseq.hpp index a57fd1f05fc4..0928bbb7d351 100644 --- a/libs/full/include/include/hpx/include/unseq.hpp +++ b/libs/full/include/include/hpx/include/unseq.hpp @@ -6,4 +6,4 @@ #pragma once -#include +#include diff --git a/libs/full/include/include/hpx/include/util.hpp b/libs/full/include/include/hpx/include/util.hpp index f1849dee21d6..8ad6afcfa31a 100644 --- a/libs/full/include/include/hpx/include/util.hpp +++ b/libs/full/include/include/hpx/include/util.hpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -22,5 +23,3 @@ #include #include #include - -#include diff --git a/libs/full/init_runtime/src/hpx_init.cpp b/libs/full/init_runtime/src/hpx_init.cpp index e12115c9f0ce..d751e9c11242 100644 --- a/libs/full/init_runtime/src/hpx_init.cpp +++ b/libs/full/init_runtime/src/hpx_init.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -40,7 +41,6 @@ #include #include #include -#include #ifdef HPX_HAVE_MODULE_MPI_BASE #include diff --git a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithm.hpp b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithm.hpp index d5b3d145c356..d8407e65ec3c 100644 --- a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithm.hpp +++ b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithm.hpp @@ -7,7 +7,7 @@ #pragma once #include -#include +#include #include #include diff --git a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/adjacent_difference.hpp b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/adjacent_difference.hpp index c43c7db090e7..3f09f8072d91 100644 --- a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/adjacent_difference.hpp +++ b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/adjacent_difference.hpp @@ -9,14 +9,10 @@ #pragma once #include -#include -#include - +#include #include -#include +#include #include -#include -#include #include #include diff --git a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/adjacent_find.hpp b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/adjacent_find.hpp index 94f631ff0dc3..beb2ba0e2eec 100644 --- a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/adjacent_find.hpp +++ b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/adjacent_find.hpp @@ -7,15 +7,11 @@ #pragma once #include -#include +#include #include #include #include -#include -#include #include -#include -#include #include #include diff --git a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/all_any_none.hpp b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/all_any_none.hpp index aefd99764e21..6bdcd77c9388 100644 --- a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/all_any_none.hpp +++ b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/all_any_none.hpp @@ -8,14 +8,9 @@ #pragma once #include -#include - +#include #include -#include -#include #include -#include -#include #include #include diff --git a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/count.hpp b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/count.hpp index 9c83b6e67666..0cc78f1bc515 100644 --- a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/count.hpp +++ b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/count.hpp @@ -7,16 +7,9 @@ #pragma once #include -#include - +#include #include -#include -#include -#include -#include #include -#include -#include #include #include diff --git a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/detail/dispatch.hpp b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/detail/dispatch.hpp index 28324f02c1be..d3d7de7573ab 100644 --- a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/detail/dispatch.hpp +++ b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/detail/dispatch.hpp @@ -9,18 +9,13 @@ #include #include -#include #include #include +#include +#include #include #include -#include -#include -#include -#include -#include - #include #include #include diff --git a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/detail/reduce.hpp b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/detail/reduce.hpp index 8adce486f061..9a2436e2ac94 100644 --- a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/detail/reduce.hpp +++ b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/detail/reduce.hpp @@ -8,15 +8,11 @@ #pragma once #include -#include -#include -#include - +#include #include -#include +#include #include -#include -#include +#include #include #include diff --git a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/detail/scan.hpp b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/detail/scan.hpp index d1cbe6bca060..a3180eddb6a4 100644 --- a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/detail/scan.hpp +++ b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/detail/scan.hpp @@ -10,22 +10,17 @@ #pragma once #include -#include #include +#include #include +#include +#include #include #include #include #include #include -#include - -#include -#include -#include #include -#include -#include #include #include diff --git a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/detail/transfer.hpp b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/detail/transfer.hpp index 4cc0be1e0643..1fcce7cee834 100644 --- a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/detail/transfer.hpp +++ b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/detail/transfer.hpp @@ -7,16 +7,11 @@ #pragma once #include -#include #include #include - +#include #include -#include #include -#include -#include -#include #include #include diff --git a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/exclusive_scan.hpp b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/exclusive_scan.hpp index 24851db8271a..404695d95bcc 100644 --- a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/exclusive_scan.hpp +++ b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/exclusive_scan.hpp @@ -12,15 +12,10 @@ #include -#include - +#include #include -#include -#include -#include #include #include -#include #include #include diff --git a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/fill.hpp b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/fill.hpp index 074691157cc9..a1d7cbfad29f 100644 --- a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/fill.hpp +++ b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/fill.hpp @@ -8,12 +8,9 @@ #pragma once #include - +#include #include -#include -#include #include -#include #include #include diff --git a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/find.hpp b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/find.hpp index 9ea1bc4c1615..11155f0cfb61 100644 --- a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/find.hpp +++ b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/find.hpp @@ -8,14 +8,9 @@ #pragma once #include -#include - +#include #include -#include -#include #include -#include -#include #include #include diff --git a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/for_each.hpp b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/for_each.hpp index 49c9e8a99ea5..84dc43508639 100644 --- a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/for_each.hpp +++ b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/for_each.hpp @@ -7,14 +7,9 @@ #pragma once #include -#include - +#include #include -#include -#include #include -#include -#include #include #include diff --git a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/functional/segmented_iterator_helpers.hpp b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/functional/segmented_iterator_helpers.hpp index 4e104df64b94..69c3d2ee1b98 100644 --- a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/functional/segmented_iterator_helpers.hpp +++ b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/functional/segmented_iterator_helpers.hpp @@ -7,7 +7,7 @@ #pragma once #include -#include +#include namespace hpx::util::functional { diff --git a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/generate.hpp b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/generate.hpp index 8f04c1df9b00..11bf533d7fa8 100644 --- a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/generate.hpp +++ b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/generate.hpp @@ -7,14 +7,9 @@ #pragma once #include -#include - +#include #include -#include -#include #include -#include -#include #include #include diff --git a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/inclusive_scan.hpp b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/inclusive_scan.hpp index fad2172700eb..14f58b01c34e 100644 --- a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/inclusive_scan.hpp +++ b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/inclusive_scan.hpp @@ -12,16 +12,11 @@ #include -#include - +#include #include #include -#include -#include -#include #include #include -#include #include #include diff --git a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/minmax.hpp b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/minmax.hpp index 7b578ea5123f..a48d130be9d1 100644 --- a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/minmax.hpp +++ b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/minmax.hpp @@ -7,15 +7,9 @@ #pragma once #include -#include - +#include #include -#include -#include #include -#include -#include -#include #include #include diff --git a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/reduce.hpp b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/reduce.hpp index f870071bd810..e21bd9e059f5 100644 --- a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/reduce.hpp +++ b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/reduce.hpp @@ -8,18 +8,11 @@ #pragma once #include -#include -#include - +#include #include -#include -#include -#include -#include +#include #include #include -#include -#include #include #include diff --git a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/traits/zip_iterator.hpp b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/traits/zip_iterator.hpp index ee24b368b5ee..63bdd284e639 100644 --- a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/traits/zip_iterator.hpp +++ b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/traits/zip_iterator.hpp @@ -8,7 +8,7 @@ #pragma once #include -#include +#include #include #include #include diff --git a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/transform.hpp b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/transform.hpp index 2e47b6a6704d..7741243762b7 100644 --- a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/transform.hpp +++ b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/transform.hpp @@ -8,16 +8,10 @@ #pragma once #include -#include +#include #include -#include - #include -#include -#include #include -#include -#include #include #include diff --git a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/transform_exclusive_scan.hpp b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/transform_exclusive_scan.hpp index abf17f333340..576904652248 100644 --- a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/transform_exclusive_scan.hpp +++ b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/transform_exclusive_scan.hpp @@ -12,15 +12,11 @@ #include -#include - +#include #include -#include -#include #include #include #include -#include #include #include diff --git a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/transform_inclusive_scan.hpp b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/transform_inclusive_scan.hpp index d100389a1244..46ba1041c974 100644 --- a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/transform_inclusive_scan.hpp +++ b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/transform_inclusive_scan.hpp @@ -12,15 +12,11 @@ #include -#include - +#include #include -#include -#include #include #include #include -#include #include #include diff --git a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/transform_reduce.hpp b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/transform_reduce.hpp index 570ea2a9787e..b2b67d54bac8 100644 --- a/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/transform_reduce.hpp +++ b/libs/full/segmented_algorithms/include/hpx/parallel/segmented_algorithms/transform_reduce.hpp @@ -7,16 +7,11 @@ #pragma once #include -#include -#include - +#include #include -#include -#include +#include #include #include -#include -#include #include #include diff --git a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_transform_reduce1.cpp b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_transform_reduce1.cpp index dbfb69202704..b7837f4aaf5f 100644 --- a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_transform_reduce1.cpp +++ b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_transform_reduce1.cpp @@ -7,15 +7,13 @@ #include #if !defined(HPX_COMPUTE_DEVICE_CODE) #include -#include -#include #include #include +#include #include #include #include #include -#include #include #include diff --git a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_transform_reduce2.cpp b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_transform_reduce2.cpp index a17aae258d06..bbf391db8440 100644 --- a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_transform_reduce2.cpp +++ b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_transform_reduce2.cpp @@ -7,15 +7,13 @@ #include #if !defined(HPX_COMPUTE_DEVICE_CODE) #include -#include -#include #include #include +#include #include #include #include #include -#include #include #include diff --git a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_transform_reduce_binary1.cpp b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_transform_reduce_binary1.cpp index 5c53dbbecc80..65f5374a1e3e 100644 --- a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_transform_reduce_binary1.cpp +++ b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_transform_reduce_binary1.cpp @@ -7,13 +7,11 @@ #include #if !defined(HPX_COMPUTE_DEVICE_CODE) #include -#include -#include #include #include +#include #include #include -#include #include #include diff --git a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_transform_reduce_binary2.cpp b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_transform_reduce_binary2.cpp index c49c203db6b3..0bebb57fd42b 100644 --- a/libs/full/segmented_algorithms/tests/unit/partitioned_vector_transform_reduce_binary2.cpp +++ b/libs/full/segmented_algorithms/tests/unit/partitioned_vector_transform_reduce_binary2.cpp @@ -7,13 +7,11 @@ #include #if !defined(HPX_COMPUTE_DEVICE_CODE) #include -#include -#include #include #include +#include #include #include -#include #include #include diff --git a/tests/unit/init/CMakeLists.txt b/tests/unit/init/CMakeLists.txt index b79a13404c66..ca1181477f6b 100644 --- a/tests/unit/init/CMakeLists.txt +++ b/tests/unit/init/CMakeLists.txt @@ -5,9 +5,12 @@ # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -set(tests manage_runtime auto_wrap_main) +set(tests manage_runtime) -set(auto_wrap_main_FLAGS NOLIBS DEPENDENCIES HPX::hpx HPX::auto_wrap_main) +if(NOT MSVC) + set(tests ${tests} auto_wrap_main) + set(auto_wrap_main_FLAGS NOLIBS DEPENDENCIES HPX::hpx HPX::auto_wrap_main) +endif() foreach(test ${tests}) set(sources ${test}.cpp) diff --git a/wrap/CMakeLists.txt b/wrap/CMakeLists.txt index 9407788038a2..1ecab3bb0bc9 100644 --- a/wrap/CMakeLists.txt +++ b/wrap/CMakeLists.txt @@ -42,9 +42,6 @@ add_hpx_source_group( add_library( hpx_wrap STATIC ${hpx_wrap_SOURCES} ${hpx_wrap_HEADERS} ${config_header} ) -add_library( - hpx_auto_wrap STATIC ${hpx_wrap_SOURCES} ${hpx_wrap_HEADERS} ${config_header} -) set_target_properties(hpx_wrap PROPERTIES POSITION_INDEPENDENT_CODE ON) target_link_libraries(hpx_wrap PRIVATE hpx_full) @@ -56,25 +53,11 @@ target_include_directories( $ ) -set_target_properties(hpx_auto_wrap PROPERTIES POSITION_INDEPENDENT_CODE ON) -target_link_libraries(hpx_auto_wrap PRIVATE hpx_full) -target_link_libraries(hpx_auto_wrap PRIVATE hpx_init) -target_link_libraries(hpx_auto_wrap PRIVATE hpx_private_flags) -target_compile_definitions( - hpx_auto_wrap PRIVATE HPX_LIBRARY_EXPORTS HPX_AUTO_WRAP_MAIN_ACTIVATE -) -target_include_directories( - hpx_auto_wrap PUBLIC $ - $ -) - if(HPX_WITH_CXX_MODULES) hpx_configure_module_consumer(hpx_wrap hpx_core_module_if) - hpx_configure_module_consumer(hpx_auto_wrap hpx_core_module_if) endif() set_property(TARGET hpx_wrap PROPERTY FOLDER "Core") -set_property(TARGET hpx_auto_wrap PROPERTY FOLDER "Core") if(MSVC) set_target_properties( @@ -88,6 +71,52 @@ if(MSVC) ) endif() +# install PDB if needed +if(MSVC) + foreach(cfg DEBUG;RELWITHDEBINFO) + get_target_property(_pdb_file hpx_wrap COMPILE_PDB_NAME_${cfg}) + get_target_property(_pdb_dir hpx_wrap COMPILE_PDB_OUTPUT_DIRECTORY_${cfg}) + install( + FILES ${_pdb_dir}/${_pdb_file}.pdb + DESTINATION ${CMAKE_INSTALL_LIBDIR} + CONFIGURATIONS ${cfg} + COMPONENT runtime + OPTIONAL + ) + endforeach() +endif() + +hpx_export_internal_targets(hpx_wrap) +add_hpx_pseudo_dependencies(core hpx_wrap) + +if(HPX_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(hpx_wrap REUSE_FROM hpx_precompiled_headers) +endif() + +if(NOT MSVC) + add_library( + hpx_auto_wrap STATIC ${hpx_wrap_SOURCES} ${hpx_wrap_HEADERS} + ${config_header} + ) + set_target_properties(hpx_auto_wrap PROPERTIES POSITION_INDEPENDENT_CODE ON) + target_link_libraries(hpx_auto_wrap PRIVATE hpx_full) + target_link_libraries(hpx_auto_wrap PRIVATE hpx_init) + target_link_libraries(hpx_auto_wrap PRIVATE hpx_private_flags) + target_compile_definitions( + hpx_auto_wrap PRIVATE HPX_LIBRARY_EXPORTS HPX_AUTO_WRAP_MAIN_ACTIVATE + ) + target_include_directories( + hpx_auto_wrap PUBLIC $ + $ + ) + + if(HPX_WITH_CXX_MODULES) + hpx_configure_module_consumer(hpx_auto_wrap hpx_core_module_if) + endif() + + set_property(TARGET hpx_auto_wrap PROPERTY FOLDER "Core") +endif() + if(HPX_WITH_DYNAMIC_HPX_MAIN) if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") target_link_libraries(hpx_wrap INTERFACE "-Wl,-wrap=main") @@ -108,14 +137,6 @@ install( RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT hpx_init ) -install( - TARGETS hpx_auto_wrap - EXPORT HPXInternalTargets - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT hpx_init - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT hpx_init - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT hpx_init -) - install( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} @@ -138,12 +159,25 @@ if(MSVC) endif() hpx_export_internal_targets(hpx_wrap) -hpx_export_internal_targets(hpx_auto_wrap) - add_hpx_pseudo_dependencies(core hpx_wrap) -add_hpx_pseudo_dependencies(core hpx_auto_wrap) if(HPX_WITH_PRECOMPILED_HEADERS) target_precompile_headers(hpx_wrap REUSE_FROM hpx_precompiled_headers) - target_precompile_headers(hpx_auto_wrap REUSE_FROM hpx_precompiled_headers) +endif() + +if(NOT MSVC) + install( + TARGETS hpx_auto_wrap + EXPORT HPXInternalTargets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT hpx_init + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT hpx_init + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT hpx_init + ) + + hpx_export_internal_targets(hpx_auto_wrap) + add_hpx_pseudo_dependencies(core hpx_auto_wrap) + + if(HPX_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(hpx_auto_wrap REUSE_FROM hpx_precompiled_headers) + endif() endif()