execution¶
The contents of this module can be included with the header
hpx/modules/execution.hpp
. These headers may be used by user-code but are not
guaranteed stable (neither header location nor contents). You are using these at
your own risk. If you wish to use non-public functionality from a module we
strongly suggest only including the module header hpx/modules/execution.hpp
, not
the particular header in which the functionality you would like to use is
defined. See Public API for a list of names that are part of the public
HPX API.
Header hpx/execution/execution.hpp
¶
Header hpx/execution/executor_parameters.hpp
¶
Header hpx/execution/executors/auto_chunk_size.hpp
¶
-
namespace
hpx
-
namespace
parallel
-
namespace
execution
-
struct
auto_chunk_size
¶ - #include <auto_chunk_size.hpp>
Loop iterations are divided into pieces and then assigned to threads. The number of loop iterations combined is determined based on measurements of how long the execution of 1% of the overall number of iterations takes. This executor parameters type makes sure that as many loop iterations are combined as necessary to run for the amount of time specified.
Public Functions
-
constexpr
auto_chunk_size
(std::uint64_t num_iters_for_timing = 0)¶ Construct an auto_chunk_size executor parameters object
- Note
Default constructed auto_chunk_size executor parameter types will use 80 microseconds as the minimal time for which any of the scheduled chunks should run.
-
auto_chunk_size
(hpx::util::steady_duration const &rel_time, std::uint64_t num_iters_for_timing = 0)¶ Construct an auto_chunk_size executor parameters object
- Parameters
rel_time
: [in] The time duration to use as the minimum to decide how many loop iterations should be combined.
-
constexpr
-
struct
-
namespace
-
namespace
Header hpx/execution/executors/dynamic_chunk_size.hpp
¶
-
namespace
hpx
-
namespace
parallel
-
namespace
execution
-
struct
dynamic_chunk_size
¶ - #include <dynamic_chunk_size.hpp>
Loop iterations are divided into pieces of size chunk_size and then dynamically scheduled among the threads; when a thread finishes one chunk, it is dynamically assigned another If chunk_size is not specified, the default chunk size is 1.
- Note
This executor parameters type is equivalent to OpenMP’s DYNAMIC scheduling directive.
Public Functions
-
constexpr
dynamic_chunk_size
(std::size_t chunk_size = 1)¶ Construct a dynamic_chunk_size executor parameters object
- Parameters
chunk_size
: [in] The optional chunk size to use as the number of loop iterations to schedule together. The default chunk size is 1.
-
struct
-
namespace
-
namespace
Header hpx/execution/executors/execution.hpp
¶
Header hpx/execution/executors/execution_information.hpp
¶
Header hpx/execution/executors/execution_information_fwd.hpp
¶
Header hpx/execution/executors/execution_parameters.hpp
¶
-
namespace
hpx
-
namespace
parallel
-
namespace
execution
Functions
-
template<typename ...
Params
>
executor_parameters_join<Params...>::typejoin_executor_parameters
(Params&&... params)¶
-
template<typename ...
Params
>
structexecutor_parameters_join
¶ - #include <execution_parameters.hpp>
-
template<typename ...
-
namespace
-
namespace
Header hpx/execution/executors/execution_parameters_fwd.hpp
¶
Header hpx/execution/executors/fused_bulk_execute.hpp
¶
Header hpx/execution/executors/guided_chunk_size.hpp
¶
-
namespace
hpx
-
namespace
parallel
-
namespace
execution
-
struct
guided_chunk_size
¶ - #include <guided_chunk_size.hpp>
Iterations are dynamically assigned to threads in blocks as threads request them until no blocks remain to be assigned. Similar to dynamic_chunk_size except that the block size decreases each time a number of loop iterations is given to a thread. The size of the initial block is proportional to number_of_iterations / number_of_cores. Subsequent blocks are proportional to number_of_iterations_remaining / number_of_cores. The optional chunk size parameter defines the minimum block size. The default chunk size is 1.
- Note
This executor parameters type is equivalent to OpenMP’s GUIDED scheduling directive.
Public Functions
-
constexpr
guided_chunk_size
(std::size_t min_chunk_size = 1)¶ Construct a guided_chunk_size executor parameters object
- Parameters
min_chunk_size
: [in] The optional minimal chunk size to use as the minimal number of loop iterations to schedule together. The default minimal chunk size is 1.
-
struct
-
namespace
-
namespace
Header hpx/execution/executors/persistent_auto_chunk_size.hpp
¶
-
namespace
hpx
-
namespace
parallel
-
namespace
execution
-
struct
persistent_auto_chunk_size
¶ - #include <persistent_auto_chunk_size.hpp>
Loop iterations are divided into pieces and then assigned to threads. The number of loop iterations combined is determined based on measurements of how long the execution of 1% of the overall number of iterations takes. This executor parameters type makes sure that as many loop iterations are combined as necessary to run for the amount of time specified.
Public Functions
-
constexpr
persistent_auto_chunk_size
(std::uint64_t num_iters_for_timing = 0)¶ Construct an persistent_auto_chunk_size executor parameters object
- Note
Default constructed persistent_auto_chunk_size executor parameter types will use 0 microseconds as the execution time for each chunk and 80 microseconds as the minimal time for which any of the scheduled chunks should run.
-
persistent_auto_chunk_size
(hpx::util::steady_duration const &time_cs, std::uint64_t num_iters_for_timing = 0)¶ Construct an persistent_auto_chunk_size executor parameters object
- Parameters
time_cs
: The execution time for each chunk.
-
persistent_auto_chunk_size
(hpx::util::steady_duration const &time_cs, hpx::util::steady_duration const &rel_time, std::uint64_t num_iters_for_timing = 0)¶ Construct an persistent_auto_chunk_size executor parameters object
- Parameters
rel_time
: [in] The time duration to use as the minimum to decide how many loop iterations should be combined.time_cs
: The execution time for each chunk.
-
constexpr
-
struct
-
namespace
-
namespace
Header hpx/execution/executors/polymorphic_executor.hpp
¶
-
namespace
hpx
-
namespace
parallel
-
namespace
execution
-
template<typename
R
, typename ...Ts
>
classpolymorphic_executor
<R(Ts...)> : private hpx::parallel::execution::detail::polymorphic_executor_base¶ - #include <polymorphic_executor.hpp>
Public Functions
-
constexpr
polymorphic_executor
()¶
-
polymorphic_executor
(polymorphic_executor const &other)¶
-
polymorphic_executor
(polymorphic_executor &&other)¶
-
polymorphic_executor &
operator=
(polymorphic_executor const &other)¶
-
polymorphic_executor &
operator=
(polymorphic_executor &&other)¶
-
template<typename
Exec
, typenamePE
= typename std::decay<Exec>::type, typenameEnable
= typename std::enable_if<!std::is_same<PE, polymorphic_executor>::value>::type>polymorphic_executor
(Exec &&exec)¶
-
template<typename
Exec
, typenamePE
= typename std::decay<Exec>::type, typenameEnable
= typename std::enable_if<!std::is_same<PE, polymorphic_executor>::value>::type>
polymorphic_executor &operator=
(Exec &&exec)¶
-
void
reset
()¶
-
template<typename
F
, typenameFuture
>
hpx::future<R>then_execute
(F &&f, Future &&predecessor, Ts&&... ts) const¶
-
template<typename
F
, typenameShape
>
std::vector<R>bulk_sync_execute
(F &&f, Shape const &s, Ts&&... ts) const¶
-
template<typename
F
, typenameShape
>
std::vector<hpx::future<R>>bulk_async_execute
(F &&f, Shape const &s, Ts&&... ts) const¶
-
constexpr
-
template<typename
-
namespace
-
namespace
Header hpx/execution/executors/rebind_executor.hpp
¶
-
namespace
hpx
-
namespace
parallel
-
namespace
execution
-
template<typename
ExecutionPolicy
, typenameExecutor
, typenameParameters
>
structrebind_executor
¶ - #include <rebind_executor.hpp>
Rebind the type of executor used by an execution policy. The execution category of Executor shall not be weaker than that of ExecutionPolicy.
Public Types
-
typedef ExecutionPolicy::template rebind<executor_type, parameters_type>::type
type
¶ The type of the rebound execution policy.
-
typedef ExecutionPolicy::template rebind<executor_type, parameters_type>::type
-
template<typename
-
namespace
-
namespace
Header hpx/execution/executors/static_chunk_size.hpp
¶
-
namespace
hpx
-
namespace
parallel
-
namespace
execution
-
struct
static_chunk_size
¶ - #include <static_chunk_size.hpp>
Loop iterations are divided into pieces of size chunk_size and then assigned to threads. If chunk_size is not specified, the iterations are evenly (if possible) divided contiguously among the threads.
- Note
This executor parameters type is equivalent to OpenMP’s STATIC scheduling directive.
Public Functions
-
constexpr
static_chunk_size
()¶ Construct a static_chunk_size executor parameters object
- Note
By default the number of loop iterations is determined from the number of available cores and the overall number of loop iterations to schedule.
-
constexpr
static_chunk_size
(std::size_t chunk_size)¶ Construct a static_chunk_size executor parameters object
- Parameters
chunk_size
: [in] The optional chunk size to use as the number of loop iterations to run on a single thread.
-
struct
-
namespace
-
namespace
Header hpx/execution/traits/executor_traits.hpp
¶
-
namespace
hpx
-
namespace
parallel
-
namespace
execution
Typedefs
-
using
executor_future_t
= typename executor_future<Executor, T, Ts...>::type¶
-
template<typename
Executor
>
structexecutor_context
¶ - #include <executor_traits.hpp>
-
template<typename
Executor
>
structexecutor_execution_category
¶ - #include <executor_traits.hpp>
Public Types
-
template<>
usingtype
= hpx::util::detected_or_t<unsequenced_execution_tag, execution_category, Executor>¶
Private Types
-
template<>
usingexecution_category
= typename T::execution_category¶
-
template<>
-
template<typename
Executor
>
structexecutor_index
¶ - #include <executor_traits.hpp>
Public Types
-
template<>
usingtype
= hpx::util::detected_or_t<typename executor_shape<Executor>::type, index_type, Executor>¶
Private Types
-
template<>
usingindex_type
= typename T::index_type¶
-
template<>
-
template<typename
Executor
>
structexecutor_parameters_type
¶ - #include <executor_traits.hpp>
Public Types
-
template<>
usingtype
= hpx::util::detected_or_t<parallel::execution::static_chunk_size, parameters_type, Executor>¶
Private Types
-
template<>
usingparameters_type
= typename T::parameters_type¶
-
template<>
-
template<typename
Executor
>
structexecutor_shape
¶ - #include <executor_traits.hpp>
Public Types
-
template<>
usingtype
= hpx::util::detected_or_t<std::size_t, shape_type, Executor>¶
Private Types
-
template<>
usingshape_type
= typename T::shape_type¶
-
template<>
-
using
-
namespace
-
namespace
traits
Typedefs
-
using
executor_context_t
= typename executor_context<Executor>::type¶
-
using
executor_execution_category_t
= typename executor_execution_category<Executor>::type¶
-
using
executor_shape_t
= typename executor_shape<Executor>::type¶
-
using
executor_index_t
= typename executor_index<Executor>::type¶
-
using
executor_future_t
= typename executor_future<Executor, T, Ts...>::type¶
-
using
executor_parameters_type_t
= typename executor_parameters_type<Executor>::type¶
-
using
-
namespace
Header hpx/execution/traits/future_then_result_exec.hpp
¶
Header hpx/execution/traits/is_execution_policy.hpp
¶
-
namespace
hpx
-
namespace
parallel
-
namespace
execution
-
template<typename
T
>
structis_async_execution_policy
: public execution::detail::is_async_execution_policy<hpx::util::decay<T>::type>¶ - #include <is_execution_policy.hpp>
Extension: Detect whether given execution policy makes algorithms asynchronous
The type is_async_execution_policy can be used to detect asynchronous execution policies for the purpose of excluding function signatures from otherwise ambiguous overload resolution participation.
If T is the type of a standard or implementation-defined execution policy, is_async_execution_policy<T> shall be publicly derived from integral_constant<bool, true>, otherwise from integral_constant<bool, false>.
The behavior of a program that adds specializations for is_async_execution_policy is undefined.
-
template<typename
T
>
structis_execution_policy
: public execution::detail::is_execution_policy<hpx::util::decay<T>::type>¶ - #include <is_execution_policy.hpp>
The type is_execution_policy can be used to detect execution policies for the purpose of excluding function signatures from otherwise ambiguous overload resolution participation.
If T is the type of a standard or implementation-defined execution policy, is_execution_policy<T> shall be publicly derived from integral_constant<bool, true>, otherwise from integral_constant<bool, false>.
The behavior of a program that adds specializations for is_execution_policy is undefined.
-
template<typename
T
>
structis_parallel_execution_policy
: public execution::detail::is_parallel_execution_policy<hpx::util::decay<T>::type>¶ - #include <is_execution_policy.hpp>
Extension: Detect whether given execution policy enables parallelization
The type is_parallel_execution_policy can be used to detect parallel execution policies for the purpose of excluding function signatures from otherwise ambiguous overload resolution participation.
If T is the type of a standard or implementation-defined execution policy, is_parallel_execution_policy<T> shall be publicly derived from integral_constant<bool, true>, otherwise from integral_constant<bool, false>.
The behavior of a program that adds specializations for is_parallel_execution_policy is undefined.
-
template<typename
T
>
structis_sequenced_execution_policy
: public execution::detail::is_sequenced_execution_policy<hpx::util::decay<T>::type>¶ - #include <is_execution_policy.hpp>
Extension: Detect whether given execution policy does not enable parallelization
The type is_sequenced_execution_policy can be used to detect non-parallel execution policies for the purpose of excluding function signatures from otherwise ambiguous overload resolution participation.
If T is the type of a standard or implementation-defined execution policy, is_sequenced_execution_policy<T> shall be publicly derived from integral_constant<bool, true>, otherwise from integral_constant<bool, false>.
The behavior of a program that adds specializations for is_sequenced_execution_policy is undefined.
-
template<typename
-
namespace
-
namespace
Header hpx/execution/traits/is_executor.hpp
¶
-
namespace
hpx
-
namespace
parallel
-
namespace
execution
Typedefs
-
using
is_one_way_executor_t
= typename is_one_way_executor<T>::type¶
-
using
is_never_blocking_one_way_executor_t
= typename is_never_blocking_one_way_executor<T>::type¶
-
using
is_bulk_one_way_executor_t
= typename is_bulk_one_way_executor<T>::type¶
-
using
is_two_way_executor_t
= typename is_two_way_executor<T>::type¶
-
using
is_bulk_two_way_executor_t
= typename is_bulk_two_way_executor<T>::type¶
-
using
-
namespace
-
namespace
traits
Typedefs
-
using
is_one_way_executor_t
= typename is_one_way_executor<T>::type¶
-
using
is_never_blocking_one_way_executor_t
= typename is_never_blocking_one_way_executor<T>::type¶
-
using
is_bulk_one_way_executor_t
= typename is_bulk_one_way_executor<T>::type¶
-
using
is_two_way_executor_t
= typename is_two_way_executor<T>::type¶
-
using
is_bulk_two_way_executor_t
= typename is_bulk_two_way_executor<T>::type¶
-
using
is_executor_any_t
= typename is_executor_any<T>::type¶
-
using
-
namespace
Header hpx/execution/traits/is_executor_parameters.hpp
¶
-
template<typename
Executor
>
structextract_executor_parameters
<Executor, typename hpx::util::always_void<typename Executor::executor_parameters_type>::type>¶ - #include <is_executor_parameters.hpp>
Public Types
-
template<>
usingtype
= typename Executor::executor_parameters_type¶
-
template<>
-
template<typename
Parameters
>
structextract_has_variable_chunk_size
<Parameters, typename hpx::util::always_void<typename Parameters::has_variable_chunk_size>::type>¶ - #include <is_executor_parameters.hpp>
Public Types
-
template<>
usingtype
= typename Parameters::has_variable_chunk_size¶
-
template<>
-
namespace
hpx
-
namespace
parallel
-
namespace
execution
Typedefs
-
using
is_executor_parameters_t
= typename is_executor_parameters<T>::type¶
-
template<typename
Executor
, typenameEnable
= void>
structextract_executor_parameters
¶ - #include <is_executor_parameters.hpp>
Public Types
-
template<>
usingtype
= sequential_executor_parameters¶
-
template<>
-
template<typename
Executor
>
structextract_executor_parameters
<Executor, typename hpx::util::always_void<typename Executor::executor_parameters_type>::type> - #include <is_executor_parameters.hpp>
Public Types
-
template<>
usingtype
= typename Executor::executor_parameters_type
-
template<>
-
template<typename
Parameters
, typenameEnable
= void>
structextract_has_variable_chunk_size
¶ - #include <is_executor_parameters.hpp>
-
template<typename
Parameters
>
structextract_has_variable_chunk_size
<Parameters, typename hpx::util::always_void<typename Parameters::has_variable_chunk_size>::type> - #include <is_executor_parameters.hpp>
Public Types
-
template<>
usingtype
= typename Parameters::has_variable_chunk_size
-
template<>
-
using
-
namespace
-
namespace
traits
Typedefs
-
using
is_executor_parameters_t
= typename is_executor_parameters<T>::type¶
-
using
-
namespace
Header hpx/execution/traits/vector_pack_alignment_size.hpp
¶
Header hpx/execution/traits/vector_pack_count_bits.hpp
¶
-
namespace
hpx
-
namespace
parallel
-
namespace
traits
-
namespace
-
namespace