Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
10 changes: 8 additions & 2 deletions cmake/HPX_AddModule.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down
30 changes: 26 additions & 4 deletions cmake/templates/std_headers.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
#include <hpx/config/modules_enabled.hpp>

@cxx_standard_headers@
// Some standard headers include the following headers.
#include <numeric>

#if defined(HPX_HAVE_STDEXEC)
# if defined(HPX_GCC_VERSION)
# pragma GCC diagnostic push
Expand Down Expand Up @@ -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 <hpx/thrust/thrust_headers.hpp>
#endif

#if defined(HPX_HAVE_MM_PREFETCH)
# if defined(HPX_MSVC)
# include <intrin.h>
# endif
# if defined(HPX_GCC_VERSION)
# include <emmintrin.h>
# endif
#endif

#if defined(HPX_HAVE_DATAPAR)
# if defined(HPX_HAVE_DATAPAR_EVE)
# include <eve/eve.hpp>
# include <eve/memory/aligned_ptr.hpp>
# endif
# if defined(HPX_HAVE_DATAPAR_STD_EXPERIMENTAL_SIMD)
# include <experimental/simd>
# endif
# if defined(HPX_HAVE_DATAPAR_VC)
# include <Vc/Vc>
# include <Vc/global.h>
# endif
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

#include <hpx/config.hpp>
#include <hpx/components/client_base.hpp>
#include <hpx/modules/futures.hpp>
#include <hpx/modules/async_base.hpp>
#include <hpx/modules/futures.hpp>
#include <hpx/naming_base/address.hpp>
#include <hpx/naming_base/id_type.hpp>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
// http://lafstern.org/matt/segmented.pdf.

#include <hpx/config.hpp>
#include <hpx/algorithms/traits/is_value_proxy.hpp>
#include <hpx/algorithms/traits/segmented_iterator_traits.hpp>
#include <hpx/assert.hpp>
#include <hpx/modules/algorithms.hpp>
#include <hpx/modules/async_base.hpp>
#include <hpx/modules/iterator_support.hpp>
#include <hpx/naming_base/id_type.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
#include <hpx/collectives/spmd_block.hpp>
#include <hpx/components/containers/partitioned_vector/partitioned_vector_local_view.hpp>
#include <hpx/components/containers/partitioned_vector/partitioned_vector_view.hpp>
#include <hpx/modules/executors.hpp>
#include <hpx/hpx_main.hpp>
#include <hpx/include/partitioned_vector_predef.hpp>
#include <hpx/include/partitioned_vector_view.hpp>
#include <hpx/modules/executors.hpp>
#include <hpx/modules/testing.hpp>
#include <hpx/runtime_distributed/find_all_localities.hpp>

Expand Down
7 changes: 6 additions & 1 deletion docs/sphinx/manual/creating_hpx_projects.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions docs/sphinx/manual/executors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Parallel Executor
.. code-block:: c++

#include <hpx/execution.hpp>
#include <hpx/parallel/algorithms/for_each.hpp>
#include <hpx/algorithm.hpp>
#include <vector>

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

#include <hpx/execution.hpp>
#include <hpx/parallel/algorithms/for_each.hpp>
#include <hpx/algorithm.hpp>
#include <vector>

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

#include <hpx/execution.hpp>
#include <hpx/parallel/algorithms/for_each.hpp>
#include <hpx/algorithm.hpp>
#include <vector>

std::vector<int> data(100, 1);
Expand Down
4 changes: 4 additions & 0 deletions docs/sphinx/manual/starting_the_hpx_runtime.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::

Expand Down
2 changes: 1 addition & 1 deletion examples/quickstart/sort_by_key_demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <hpx/algorithm.hpp>
#include <hpx/execution.hpp>
#include <hpx/init.hpp>
#include <hpx/parallel/algorithms/sort_by_key.hpp>

#include <cstddef>
#include <iostream>
Expand Down
34 changes: 19 additions & 15 deletions libs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -219,11 +228,6 @@ target_compile_definitions(
"$<${_is_library}:HPX_PLUGIN_NAME_DEFAULT=hpx_$<TARGET_PROPERTY:NAME>>"
)

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}
Expand Down
43 changes: 26 additions & 17 deletions libs/core/algorithms/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
// 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
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

#pragma once

#include <hpx/config.hpp>

#include <utility>

namespace hpx::traits {

template <typename T>
HPX_CXX_EXPORT template <typename T>
inline constexpr bool is_pair_v = false;

template <typename T1, typename T2>
HPX_CXX_EXPORT template <typename T1, typename T2>
inline constexpr bool is_pair_v<std::pair<T1, T2>> = true;
} // namespace hpx::traits
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,26 @@

#pragma once

#include <hpx/config.hpp>

#include <type_traits>

namespace hpx::traits {

template <typename T>
HPX_CXX_EXPORT template <typename T>
struct is_value_proxy : std::false_type
{
};

template <typename T>
HPX_CXX_EXPORT template <typename T>
inline constexpr bool is_value_proxy_v = is_value_proxy<T>::value;

template <typename T>
HPX_CXX_EXPORT template <typename T>
struct proxy_value
{
using type = T;
};

template <typename T>
HPX_CXX_EXPORT template <typename T>
using proxy_value_t = typename proxy_value<T>::type;
} // namespace hpx::traits
Loading
Loading