Public API#

Our API is semantically conforming; hence, the reader is highly encouraged to refer to the corresponding facility in the C++ Standard if needed. All names below are also available in the top-level hpx namespace unless otherwise noted. The names in hpx should be preferred. The names in sub-namespaces will eventually be removed.

hpx/algorithm.hpp#

The header hpx/algorithm.hpp corresponds to the C++ standard library header algorithm. See Using parallel algorithms for more information about the parallel algorithms.

Classes#

Table 125 Classes of header hpx/algorithm.hpp#

Class

C++ standard

hpx::experimental::reduction

N4808

hpx::experimental::induction

N4808

Functions#

Table 126 hpx functions of header hpx/algorithm.hpp#

hpx function

C++ standard

hpx::adjacent_find

std::adjacent_find

hpx::all_of

std::all_of

hpx::any_of

std::any_of

hpx::copy

std::copy

hpx::copy_if

std::copy_if

hpx::copy_n

std::copy_n

hpx::count

std::count

hpx::count_if

std::count_if

hpx::ends_with

std::ends_with

hpx::equal

std::equal

hpx::fill

std::fill

hpx::fill_n

std::fill_n

hpx::find

std::find

hpx::find_end

std::find_end

hpx::find_first_of

std::find_first_of

hpx::find_if

std::find_if

hpx::find_if_not

std::find_if_not

hpx::for_each

std::for_each

hpx::for_each_n

std::for_each_n

hpx::generate

std::generate

hpx::generate_n

std::generate_n

hpx::includes

std::includes

hpx::inplace_merge

std::inplace_merge

hpx::is_heap

std::is_heap

hpx::is_heap_until

std::is_heap_until

hpx::is_partitioned

std::is_partitioned

hpx::is_sorted

std::is_sorted

hpx::is_sorted_until

std::is_sorted_until

hpx::lexicographical_compare

std::lexicographical_compare

hpx::make_heap

std::make_heap

hpx::max_element

std::max_element

hpx::merge

std::merge

hpx::min_element

std::min_element

hpx::minmax_element

std::minmax_element

hpx::mismatch

std::mismatch

hpx::move

std::move

hpx::none_of

std::none_of

hpx::nth_element

std::nth_element

hpx::partial_sort

std::partial_sort

hpx::partial_sort_copy

std::partial_sort_copy

hpx::partition

std::partition

hpx::partition_copy

std::partition_copy

hpx::experimental::reduce_by_key

reduce_by_key

hpx::remove

std::remove

hpx::remove_copy

std::remove_copy

hpx::remove_copy_if

std::remove_copy_if

hpx::remove_if

std::remove_if

hpx::replace

std::replace

hpx::replace_copy

std::replace_copy

hpx::replace_copy_if

std::replace_copy_if

hpx::replace_if

std::replace_if

hpx::reverse

std::reverse

hpx::reverse_copy

std::reverse_copy

hpx::rotate

std::rotate

hpx::rotate_copy

std::rotate_copy

hpx::search

std::search

hpx::search_n

std::search_n

hpx::set_difference

std::set_difference

hpx::set_intersection

std::set_intersection

hpx::set_symmetric_difference

std::set_symmetric_difference

hpx::set_union

std::set_union

hpx::shift_left

std::shift_left

hpx::shift_right

std::shift_right

hpx::sort

std::sort

hpx::experimental::sort_by_key

sort_by_key

hpx::stable_partition

std::stable_partition

hpx::stable_sort

std::stable_sort

hpx::starts_with

std::starts_with

hpx::swap_ranges

std::swap_ranges

hpx::transform

std::transform

hpx::unique

std::unique

hpx::unique_copy

std::unique_copy

hpx::experimental::for_loop

N4808

hpx::experimental::for_loop_strided

N4808

hpx::experimental::for_loop_n

N4808

hpx::experimental::for_loop_n_strided

N4808

Table 127 hpx::ranges functions of header hpx/algorithm.hpp#

hpx::ranges function

C++ standard

hpx::ranges::adjacent_find

std::adjacent_find

hpx::ranges::all_of

std::all_of

hpx::ranges::any_of

std::any_of

hpx::ranges::copy

std::copy

hpx::ranges::copy_if

std::copy_if

hpx::ranges::copy_n

std::copy_n

hpx::ranges::count

std::count

hpx::ranges::count_if

std::count_if

hpx::ranges::ends_with

std::ends_with

hpx::ranges::equal

std::equal

hpx::ranges::fill

std::fill

hpx::ranges::fill_n

std::fill_n

hpx::ranges::find

std::find

hpx::ranges::find_end

std::find_end

hpx::ranges::find_first_of

std::find_first_of

hpx::ranges::find_if

std::find_if

hpx::ranges::find_if_not

std::find_if_not

hpx::ranges::for_each

std::for_each

hpx::ranges::for_each_n

std::for_each_n

hpx::ranges::generate

std::generate

hpx::ranges::generate_n

std::generate_n

hpx::ranges::includes

std::includes

hpx::ranges::inplace_merge

std::inplace_merge

hpx::ranges::is_heap

std::is_heap

hpx::ranges::is_heap_until

std::is_heap_until

hpx::ranges::is_partitioned

std::is_partitioned

hpx::ranges::is_sorted

std::is_sorted

hpx::ranges::is_sorted_until

std::is_sorted_until

hpx::ranges::make_heap

std::make_heap

hpx::ranges::max_element

std::max_element

hpx::ranges::merge

std::merge

hpx::ranges::min_element

std::min_element

hpx::ranges::minmax_element

std::minmax_element

hpx::ranges::mismatch

std::mismatch

hpx::ranges::move

std::move

hpx::ranges::none_of

std::none_of

hpx::ranges::nth_element

std::nth_element

hpx::ranges::partial_sort

std::partial_sort

hpx::ranges::partial_sort_copy

std::partial_sort_copy

hpx::ranges::partition

std::partition

hpx::ranges::partition_copy

std::partition_copy

hpx::ranges::set_difference

std::set_difference

hpx::ranges::set_intersection

std::set_intersection

hpx::ranges::set_symmetric_difference

std::set_symmetric_difference

hpx::ranges::set_union

std::set_union

hpx::ranges::shift_left

P2440

hpx::ranges::shift_right

P2440

hpx::ranges::sort

std::sort

hpx::ranges::stable_partition

std::stable_partition

hpx::ranges::stable_sort

std::stable_sort

hpx::ranges::starts_with

std::starts_with

hpx::ranges::swap_ranges

std::swap_ranges

hpx::ranges::transform

std::transform

hpx::ranges::unique

std::unique

hpx::ranges::unique_copy

std::unique_copy

hpx::ranges::experimental::for_loop

N4808

hpx::ranges::experimental::for_loop_strided

N4808

hpx/any.hpp#

The header hpx/any.hpp corresponds to the C++ standard library header any.

hpx::any is compatible with std::any.

hpx::any_nonser, hpx::unique_any_nonser, and their corresponding factory functions hpx::make_any_nonser and hpx::make_unique_any_nonser are HPX extensions that do not support serialization and have no counterparts in the C++ standard library.

Classes#

Table 128 Classes of header hpx/any.hpp#

Class

C++ standard

hpx::any

std::any

hpx::any_nonser

hpx::bad_any_cast

std::bad_any_cast

hpx::unique_any_nonser

Functions#

Table 129 Functions of header hpx/any.hpp#

Function

C++ standard

hpx::any_cast

std::any_cast

hpx::make_any

std::make_any

hpx::make_any_nonser

hpx::make_unique_any_nonser

hpx/assert.hpp#

The header hpx/assert.hpp corresponds to the C++ standard library header cassert.

HPX_ASSERT is the HPX equivalent to assert in cassert. HPX_ASSERT can also be used in CUDA device code.

Macros#

Table 130 Macros of header hpx/assert.hpp#

Macro

HPX_ASSERT

HPX_ASSERT_MSG

hpx/barrier.hpp#

The header hpx/barrier.hpp corresponds to the C++ standard library header barrier and contains a distributed barrier implementation. This functionality is also exposed through the hpx::distributed namespace. The name in hpx::distributed should be preferred.

Classes#

Table 131 Classes of header hpx/barrier.hpp#

Class

C++ standard

hpx::barrier

std::barrier

Table 132 Distributed implementation of classes of header hpx/barrier.hpp#

Class

hpx::distributed::barrier

hpx/channel.hpp#

The header hpx/channel.hpp contains a local and a distributed channel implementation. This functionality is also exposed through the hpx::distributed namespace. The name in hpx::distributed should be preferred.

The channel functionality is specific to HPX and has no counterpart in the C++ standard library.

Classes#

Table 133 Classes of header hpx/channel.hpp#

Class

hpx::channel

Table 134 Distributed implementation of classes of header hpx/channel.hpp#

Class

hpx::distributed::channel

hpx/chrono.hpp#

The header hpx/chrono.hpp corresponds to the C++ standard library header chrono. The following replacements and extensions are provided compared to chrono.

Classes#

Table 135 Classes of header hpx/chrono.hpp#

Class

C++ standard

hpx::chrono::high_resolution_clock

std::high_resolution_clock

hpx::chrono::high_resolution_timer

hpx::chrono::steady_time_point

std::time_point

hpx/condition_variable.hpp#

The header hpx/condition_variable.hpp corresponds to the C++ standard library header condition_variable.

Classes#

hpx/exception.hpp#

The header hpx/exception.hpp corresponds to the C++ standard library header exception. hpx::exception extends std::exception and is the base class for all exceptions thrown in HPX. HPX_THROW_EXCEPTION can be used to throw HPX exceptions with file and line information attached to the exception.

Macros#

Classes#

Table 137 Classes of header hpx/exception.hpp#

Class

C++ standard

hpx::exception

std::exception

hpx/execution.hpp#

The header hpx/execution.hpp corresponds to the C++ standard library header execution. See High level parallel facilities, Using parallel algorithms and Executor parameters and executor parameter traits for more information about execution policies and executor parameters.

Note

These names are only available in the hpx::execution namespace, not in the top-level hpx namespace.

Constants#

Classes#

hpx/functional.hpp#

The header hpx/functional.hpp corresponds to the C++ standard library header functional. hpx::function is a more efficient and serializable replacement for std::function.

Constants#

The following constants correspond to the C++ standard std::placeholders

Table 140 Constants of header hpx/functional.hpp#

Constant

hpx::placeholders::_1

hpx::placeholders::_2

hpx::placeholders::_9

Classes#

Functions#

hpx/future.hpp#

The header hpx/future.hpp corresponds to the C++ standard library header future. See Extended facilities for futures for more information about extensions to futures compared to the C++ standard library.

This header file also contains overloads of hpx::async, hpx::post, hpx::sync, and hpx::dataflow that can be used with actions. See Action invocation for more information about invoking actions.

Classes#

Note

All names except hpx::promise are also available in the top-level hpx namespace. hpx::promise refers to hpx::distributed::promise, a distributed variant of hpx::promise, but will eventually refer to hpx::promise after a deprecation period.

Table 144 Distributed implementation of classes of header hpx/future.hpp#

Class

hpx::distributed::promise

Functions#

hpx/init.hpp#

The header hpx/init.hpp contains functionality for starting, stopping, suspending, and resuming the HPX runtime. This is the main way to explicitly start the HPX runtime. See Starting the HPX runtime for more details on starting the HPX runtime.

Classes#

Table 146 Classes of header hpx/init.hpp#

Class

hpx::init_params

hpx::runtime_mode

Functions#

Table 147 Functions of header hpx/init.hpp#

Function

hpx::init

hpx::start

hpx::finalize

hpx::disconnect

hpx::suspend

hpx::resume

hpx/latch.hpp#

The header hpx/latch.hpp corresponds to the C++ standard library header latch. It contains a local and a distributed latch implementation. This functionality is also exposed through the hpx::distributed namespace. The name in hpx::distributed should be preferred.

Classes#

Table 148 Classes of header hpx/latch.hpp#

Class

C++ standard

hpx::latch

std::latch

Table 149 Distributed implementation of classes of header hpx/latch.hpp#

Class

hpx::distributed::latch

hpx/mutex.hpp#

The header hpx/mutex.hpp corresponds to the C++ standard library header mutex.

Classes#

Functions#

Table 151 Functions of header hpx/mutex.hpp#

Class

C++ standard

hpx::call_once

std::call_once

hpx/memory.hpp#

The header hpx/memory.hpp corresponds to the C++ standard library header memory. It contains parallel versions of the copy, fill, move, and construct helper functions in memory. See Using parallel algorithms for more information about the parallel algorithms.

Functions#

hpx/numeric.hpp#

The header hpx/numeric.hpp corresponds to the C++ standard library header numeric. See Using parallel algorithms for more information about the parallel algorithms.

Functions#

hpx/optional.hpp#

The header hpx/optional.hpp corresponds to the C++ standard library header optional. hpx::optional is compatible with std::optional.

Constants#

  • hpx::nullopt

Classes#

Table 156 Classes of header hpx/optional.hpp#

Class

C++ standard

hpx::optional

std::optional

hpx::nullopt_t

std::nullopt_t

hpx::bad_optional_access

std::bad_optional_access

hpx/runtime.hpp#

The header hpx/runtime.hpp contains functions for accessing local and distributed runtime information.

Typedefs#

Table 157 Typedefs of header hpx/runtime.hpp#

Typedef

hpx::startup_function_type

hpx::shutdown_function_type

Functions#

hpx/experimental/scope.hpp#

The header hpx/experimental/scope.hpp corresponds to the C++ standard library header experimental/scope.

Classes#

hpx/semaphore.hpp#

The header hpx/semaphore.hpp corresponds to the C++ standard library header semaphore.

Classes#

Table 160 Classes of header hpx/semaphore.hpp#

Class

C++ standard

hpx::binary_semaphore

std::counting_semaphore

hpx::counting_semaphore

std::counting_semaphore

hpx/shared_mutex.hpp#

The header hpx/shared_mutex.hpp corresponds to the C++ standard library header shared_mutex.

Classes#

Table 161 Classes of header hpx/shared_mutex.hpp#

Class

C++ standard

hpx::shared_mutex

std::shared_mutex

hpx/source_location.hpp#

The header hpx/source_location.hpp corresponds to the C++ standard library header source_location.

Classes#

Table 162 Classes of header hpx/system_error.hpp#

Class

C++ standard

hpx::source_location

std::source_location

hpx/stop_token.hpp#

The header hpx/stop_token.hpp corresponds to the C++ standard library header stop_token.

Constants#

Table 163 Constants of header hpx/stop_token.hpp#

Constant

C++ standard

hpx::nostopstate

std::nostopstate

Classes#

hpx/system_error.hpp#

The header hpx/system_error.hpp corresponds to the C++ standard library header system_error.

Classes#

Table 165 Classes of header hpx/system_error.hpp#

Class

C++ standard

hpx::error_code

std::error_code

hpx/task_block.hpp#

The header hpx/task_block.hpp corresponds to the task_block feature in N4755. See using_task_block for more details on using task blocks.

Classes#

Table 166 Classes of header hpx/task_block.hpp#

Class

hpx::experimental::task_canceled_exception

hpx::experimental::task_block

Functions#

Table 167 Functions of header hpx/task_block.hpp#

Function

hpx::experimental::define_task_block

hpx::experimental::define_task_block_restore_thread

hpx/experimental/task_group.hpp#

The header hpx/experimental/task_group.hpp corresponds to the task_group feature in oneAPI Threading Building Blocks (oneTBB).

Classes#

Table 168 Classes of header hpx/experimental/task_group.hpp#

Class

hpx::experimental::task_group

hpx/thread.hpp#

The header hpx/thread.hpp corresponds to the C++ standard library header thread. The functionality in this header is equivalent to the standard library thread functionality, with the exception that the HPX equivalents are implemented on top of lightweight threads and the HPX runtime.

Classes#

Table 169 Classes of header hpx/thread.hpp#

Class

C++ standard

hpx::thread

std::thread

hpx::jthread

std::jthread

Functions#

hpx/tuple.hpp#

The header hpx/tuple.hpp corresponds to the C++ standard library header tuple. hpx::tuple can be used in CUDA device code, unlike std::tuple.

Constants#

Table 171 Constants of header hpx/tuple.hpp#

Constant

C++ standard

hpx::ignore

std::ignore

Classes#

Table 172 Classes of header hpx/tuple.hpp#

Class

C++ standard

hpx::tuple

std::tuple

hpx::tuple_size

std::tuple_size

hpx::tuple_element

std::tuple_element

Functions#

hpx/type_traits.hpp#

The header hpx/type_traits.hpp corresponds to the C++ standard library header type_traits.

Classes#

Table 174 Classes of header hpx/type_traits.hpp#

Class

C++ standard

hpx::is_invocable

std::is_invocable

hpx::is_invocable_r

std::is_invocable

hpx/unwrap.hpp#

The header hpx/unwrap.hpp contains utilities for unwrapping futures.

Classes#

Table 175 Classes of header hpx/unwrap.hpp#

Class

hpx::functional::unwrap

hpx::functional::unwrap_n

hpx::functional::unwrap_all

Functions#

Table 176 Functions of header hpx/unwrap.hpp#

Function

hpx::unwrap

hpx::unwrap_n

hpx::unwrap_all

hpx::unwrapping

hpx::unwrapping_n

hpx::unwrapping_all

hpx/version.hpp#

The header hpx/version.hpp provides version information about HPX.

The macros and functions provided by this header are specific to HPX and have no counterparts in the C++ standard library.

Macros#

Table 177 Macros of header hpx/version.hpp#

Macro

HPX_VERSION_MAJOR

HPX_VERSION_MINOR

HPX_VERSION_SUBMINOR

HPX_VERSION_FULL

HPX_VERSION_DATE

HPX_VERSION_TAG

HPX_AGAS_VERSION

Functions#

Table 178 Functions of header hpx/version.hpp#

Function

hpx::major_version

hpx::minor_version

hpx::subminor_version

hpx::full_version

hpx::full_version_as_string

hpx::tag

hpx::agas_version

hpx::build_type

hpx::build_date_time

hpx/wrap_main.hpp#

The header hpx/wrap_main.hpp does not provide any direct functionality but is used for implicitly using main as the runtime entry point. See Re-use the main() function as the main HPX entry point for more details on implicitly starting the HPX runtime.