executors¶
See Public API for a list of names and headers that are part of the public HPX API.
-
namespace
hpx
-
namespace
execution
-
namespace
experimental
Functions
-
template<typename
BaseExecutor
>
structannotating_executor
¶ - #include <annotating_executor.hpp>
A annotating_executor wraps any other executor and adds the capability to add annotations to the launched threads.
-
template<typename
-
namespace
-
namespace
-
namespace
hpx
-
namespace
parallel
-
namespace
execution
Typedefs
-
using
current_executor
= parallel::execution::thread_pool_executor¶
-
using
-
namespace
-
namespace
this_thread
Functions
-
parallel::execution::current_executor
get_executor
(error_code &ec = throws)¶ Returns a reference to the executor which was used to create the current thread.
- Exceptions
If
:&ec != &throws
, never throws, but will set ec to an appropriate value when an error occurs. Otherwise, this function will throw an hpx::exception with an error code of hpx::yield_aborted if it is signaled with wait_aborted. If called outside of a HPX-thread, this function will throw an hpx::exception with an error code of hpx::null_thread_id. If this function is called while the thread-manager is not running, it will throw an hpx::exception with an error code of hpx::invalid_status.
-
parallel::execution::current_executor
-
namespace
threads
Functions
-
parallel::execution::current_executor
get_executor
(thread_id_type const &id, error_code &ec = throws)¶ Returns a reference to the executor which was used to create the given thread.
- Exceptions
If
:&ec != &throws
, never throws, but will set ec to an appropriate value when an error occurs. Otherwise, this function will throw an hpx::exception with an error code of hpx::yield_aborted if it is signaled with wait_aborted. If called outside of a HPX-thread, this function will throw an hpx::exception with an error code of hpx::null_thread_id. If this function is called while the thread-manager is not running, it will throw an hpx::exception with an error code of hpx::invalid_status.
-
parallel::execution::current_executor
-
namespace
-
namespace
hpx
-
namespace
execution
Variables
-
constexpr sequenced_policy
seq
= {}¶ Default sequential execution policy object.
-
constexpr parallel_policy
par
= {}¶ Default parallel execution policy object.
-
constexpr parallel_unsequenced_policy
par_unseq
= {}¶ Default vector execution policy object.
-
constexpr unsequenced_policy
unseq
= {}¶ Default vector execution policy object.
-
struct
parallel_policy
¶ - #include <execution_policy.hpp>
The class parallel_policy is an execution policy type used as a unique type to disambiguate parallel algorithm overloading and indicate that a parallel algorithm’s execution may be parallelized.
Public Types
-
using
executor_type
= parallel_executor¶ The type of the executor associated with this execution policy.
-
using
executor_parameters_type
= parallel::execution::extract_executor_parameters<executor_type>::type¶ The type of the associated executor parameters object which is associated with this execution policy
-
using
execution_category
= parallel_execution_tag¶ The category of the execution agents created by this execution policy.
Public Functions
-
constexpr parallel_task_policy
operator()
(task_policy_tag) const¶ Create a new parallel_policy referencing a chunk size.
- Return
The new parallel_policy
- Parameters
tag
: [in] Specify that the corresponding asynchronous execution policy should be used
-
constexpr decltype(auto)
operator()
(non_task_policy_tag) const¶ Create a new parallel_policy from itself
- Return
The new parallel_policy
- Parameters
tag
: [in] Specify that the corresponding asynchronous execution policy should be used
-
template<typename
Executor
>
constexpr decltype(auto)on
(Executor &&exec) const¶ Create a new parallel_policy referencing an executor and a chunk size.
- Return
The new parallel_policy
- Parameters
exec
: [in] The executor to use for the execution of the parallel algorithm the returned execution policy is used with
-
template<typename ...
Parameters
>
constexpr decltype(auto)with
(Parameters&&... params) const¶ Create a new parallel_policy from the given execution parameters
- Note
Requires: is_executor_parameters<Parameters>::value is true
- Return
The new parallel_policy
- Template Parameters
Parameters
: The type of the executor parameters to associate with this execution policy.
- Parameters
params
: [in] The executor parameters to use for the execution of the parallel algorithm the returned execution policy is used with.
-
executor_type &
executor
()¶ Return the associated executor object.
-
constexpr executor_type const &
executor
() const¶ Return the associated executor object.
-
executor_parameters_type &
parameters
()¶ Return the associated executor parameters object.
-
constexpr executor_parameters_type const &
parameters
() const¶ Return the associated executor parameters object.
Friends
-
friend
hpx::execution::hpx::parallel::execution::create_rebound_policy_t
-
friend
hpx::execution::hpx::serialization::access
-
template<typename
Executor_
, typenameParameters_
>
structrebind
¶ - #include <execution_policy.hpp>
Rebind the type of executor used by this execution policy. The execution category of Executor shall not be weaker than that of this execution policy
Public Types
-
template<>
usingtype
= parallel_policy_shim<Executor_, Parameters_>¶ The type of the rebound execution policy.
-
template<>
-
using
-
template<typename
Executor
, typenameParameters
>
structparallel_policy_shim
¶ - #include <execution_policy.hpp>
The class parallel_policy_shim is an execution policy type used as a unique type to disambiguate parallel algorithm overloading and indicate that a parallel algorithm’s execution may be parallelized.
Public Types
-
template<>
usingexecutor_type
= std::decay_t<Executor>¶ The type of the executor associated with this execution policy.
-
template<>
usingexecutor_parameters_type
= std::decay_t<Parameters>¶ The type of the associated executor parameters object which is associated with this execution policy
-
template<>
usingexecution_category
= typename hpx::traits::executor_execution_category<executor_type>::type¶ The category of the execution agents created by this execution policy.
Public Functions
-
constexpr parallel_task_policy_shim<Executor, Parameters>
operator()
(task_policy_tag) const¶ Create a new parallel_policy referencing a chunk size.
- Return
The new parallel_policy
- Parameters
tag
: [in] Specify that the corresponding asynchronous execution policy should be used
-
constexpr decltype(auto)
operator()
(non_task_policy_tag) const¶ Create a new parallel_policy from itself
- Return
The new parallel_policy
- Parameters
tag
: [in] Specify that the corresponding asynchronous execution policy should be used
-
template<typename
Executor_
>
constexpr decltype(auto)on
(Executor_ &&exec) const¶ Create a new parallel_policy from the given executor
- Note
Requires: is_executor<Executor>::value is true
- Return
The new parallel_policy
- Template Parameters
Executor
: The type of the executor to associate with this execution policy.
- Parameters
exec
: [in] The executor to use for the execution of the parallel algorithm the returned execution policy is used with.
-
template<typename ...
Parameters_
>
constexpr decltype(auto)with
(Parameters_&&... params) const¶ Create a new parallel_policy_shim from the given execution parameters
- Note
Requires: is_executor_parameters<Parameters>::value is true
- Return
The new parallel_policy_shim
- Template Parameters
Parameters
: The type of the executor parameters to associate with this execution policy.
- Parameters
params
: [in] The executor parameters to use for the execution of the parallel algorithm the returned execution policy is used with.
-
executor_type &
executor
()¶ Return the associated executor object.
-
constexpr executor_type const &
executor
() const¶ Return the associated executor object.
-
executor_parameters_type &
parameters
()¶ Return the associated executor parameters object.
-
constexpr executor_parameters_type const &
parameters
() const¶ Return the associated executor parameters object.
-
template<typename
Executor_
, typenameParameters_
>
structrebind
¶ - #include <execution_policy.hpp>
Rebind the type of executor used by this execution policy. The execution category of Executor shall not be weaker than that of this execution policy
Public Types
-
template<>
template<>
usingtype
= parallel_policy_shim<Executor_, Parameters_>¶ The type of the rebound execution policy.
-
template<>
-
template<>
-
struct
parallel_task_policy
¶ - #include <execution_policy.hpp>
Extension: The class parallel_task_policy is an execution policy type used as a unique type to disambiguate parallel algorithm overloading and indicate that a parallel algorithm’s execution may be parallelized.
The algorithm returns a future representing the result of the corresponding algorithm when invoked with the parallel_policy.
Public Types
-
using
executor_type
= parallel_executor¶ The type of the executor associated with this execution policy.
-
using
executor_parameters_type
= parallel::execution::extract_executor_parameters<executor_type>::type¶ The type of the associated executor parameters object which is associated with this execution policy
-
using
execution_category
= parallel_execution_tag¶ The category of the execution agents created by this execution policy.
Public Functions
-
constexpr parallel_task_policy
operator()
(task_policy_tag) const¶ Create a new parallel_task_policy from itself
- Return
The new parallel_task_policy
- Parameters
tag
: [in] Specify that the corresponding asynchronous execution policy should be used
-
constexpr decltype(auto)
operator()
(non_task_policy_tag) const¶ Create a new non task parallel policy from itself
- Return
The new non task parallel_policy
- Parameters
tag
: [in] Specify that the corresponding execution policy should be used
-
template<typename
Executor
>
constexpr decltype(auto)on
(Executor &&exec) const¶ Create a new parallel_task_policy from given executor
- Note
Requires: is_executor<Executor>::value is true
- Return
The new parallel_task_policy
- Template Parameters
Executor
: The type of the executor to associate with this execution policy.
- Parameters
exec
: [in] The executor to use for the execution of the parallel algorithm the returned execution policy is used with.
-
template<typename ...
Parameters
>
constexpr decltype(auto)with
(Parameters&&... params) const¶ Create a new parallel_policy_shim from the given execution parameters
- Note
Requires: all parameters are executor_parameters, different parameter types can’t be duplicated
- Return
The new parallel_policy_shim
- Template Parameters
Parameters
: The type of the executor parameters to associate with this execution policy.
- Parameters
params
: [in] The executor parameters to use for the execution of the parallel algorithm the returned execution policy is used with.
-
executor_type &
executor
()¶ Return the associated executor object.
-
constexpr executor_type const &
executor
() const¶ Return the associated executor object.
-
executor_parameters_type &
parameters
()¶ Return the associated executor parameters object.
-
constexpr executor_parameters_type const &
parameters
() const¶ Return the associated executor parameters object.
Friends
-
friend
hpx::execution::hpx::parallel::execution::create_rebound_policy_t
-
friend
hpx::execution::hpx::serialization::access
-
template<typename
Executor_
, typenameParameters_
>
structrebind
¶ - #include <execution_policy.hpp>
Rebind the type of executor used by this execution policy. The execution category of Executor shall not be weaker than that of this execution policy
Public Types
-
template<>
usingtype
= parallel_task_policy_shim<Executor_, Parameters_>¶ The type of the rebound execution policy.
-
template<>
-
using
-
template<typename
Executor
, typenameParameters
>
structparallel_task_policy_shim
¶ - #include <execution_policy.hpp>
Extension: The class parallel_task_policy_shim is an execution policy type used as a unique type to disambiguate parallel algorithm overloading based on combining a underlying parallel_task_policy and an executor and indicate that a parallel algorithm’s execution may be parallelized.
Public Types
-
template<>
usingexecutor_type
= std::decay_t<Executor>¶ The type of the executor associated with this execution policy.
-
template<>
usingexecutor_parameters_type
= std::decay_t<Parameters>¶ The type of the associated executor parameters object which is associated with this execution policy
-
template<>
usingexecution_category
= typename hpx::traits::executor_execution_category<executor_type>::type¶ The category of the execution agents created by this execution policy.
Public Functions
-
constexpr parallel_task_policy_shim
operator()
(task_policy_tag) const¶ Create a new parallel_task_policy_shim from itself
- Return
The new sequenced_task_policy
- Parameters
tag
: [in] Specify that the corresponding asynchronous execution policy should be used
-
constexpr decltype(auto)
operator()
(non_task_policy_tag) const¶ Create a new non task parallel policy from itself
- Return
The new non task parallel_policy_shim
- Parameters
tag
: [in] Specify that the corresponding execution policy should be used
-
template<typename
Executor_
>
constexpr decltype(auto)on
(Executor_ &&exec) const¶ Create a new parallel_task_policy from the given executor
- Note
Requires: is_executor<Executor>::value is true
- Return
The new parallel_task_policy
- Template Parameters
Executor
: The type of the executor to associate with this execution policy.
- Parameters
exec
: [in] The executor to use for the execution of the parallel algorithm the returned execution policy is used with.
-
template<typename ...
Parameters_
>
constexpr decltype(auto)with
(Parameters_&&... params) const¶ Create a new parallel_policy_shim from the given execution parameters
- Note
Requires: all parameters are executor_parameters, different parameter types can’t be duplicated
- Return
The new parallel_policy_shim
- Template Parameters
Parameters
: The type of the executor parameters to associate with this execution policy.
- Parameters
params
: [in] The executor parameters to use for the execution of the parallel algorithm the returned execution policy is used with.
-
executor_type &
executor
()¶ Return the associated executor object.
-
constexpr executor_type const &
executor
() const¶ Return the associated executor object.
-
executor_parameters_type &
parameters
()¶ Return the associated executor parameters object.
-
constexpr executor_parameters_type const &
parameters
() const¶ Return the associated executor parameters object.
-
template<typename
Executor_
, typenameParameters_
>
structrebind
¶ - #include <execution_policy.hpp>
Rebind the type of executor used by this execution policy. The execution category of Executor shall not be weaker than that of this execution policy
Public Types
-
template<>
template<>
usingtype
= parallel_task_policy_shim<Executor_, Parameters_>¶ The type of the rebound execution policy.
-
template<>
-
template<>
-
struct
parallel_unsequenced_policy
¶ - #include <execution_policy.hpp>
The class parallel_unsequenced_policy is an execution policy type used as a unique type to disambiguate parallel algorithm overloading and indicate that a parallel algorithm’s execution may be parallelized and vectorized.
Public Types
-
using
executor_type
= parallel_executor¶ The type of the executor associated with this execution policy.
-
using
executor_parameters_type
= parallel::execution::extract_executor_parameters<executor_type>::type¶ The type of the associated executor parameters object which is associated with this execution policy
-
using
execution_category
= parallel_execution_tag¶ The category of the execution agents created by this execution policy.
Public Functions
-
constexpr decltype(auto)
operator()
(non_task_policy_tag) const¶ Create a new non task policy from itself
- Return
The non task parallel unsequenced policy
-
constexpr decltype(auto)
operator()
(task_policy_tag) const¶ Create a new task policy from itself
- Return
The task parallel unsequenced policy
-
executor_type &
executor
()¶ Return the associated executor object.
-
constexpr executor_type const &
executor
() const¶ Return the associated executor object.
-
executor_parameters_type &
parameters
()¶ Return the associated executor parameters object.
-
constexpr executor_parameters_type const &
parameters
() const¶ Return the associated executor parameters object.
Friends
-
friend
hpx::execution::hpx::parallel::execution::create_rebound_policy_t
-
friend
hpx::execution::hpx::serialization::access
-
template<typename
Executor
, typenameParameters
>
structrebind
¶ - #include <execution_policy.hpp>
Rebind the type of executor used by this execution policy.
Public Types
-
template<>
usingtype
= parallel_unsequenced_policy¶ The type of the rebound execution policy.
-
template<>
-
using
-
struct
sequenced_policy
¶ - #include <execution_policy.hpp>
The class sequenced_policy is an execution policy type used as a unique type to disambiguate parallel algorithm overloading and require that a parallel algorithm’s execution may not be parallelized.
Public Types
-
using
executor_type
= sequenced_executor¶ The type of the executor associated with this execution policy.
-
using
executor_parameters_type
= parallel::execution::extract_executor_parameters<executor_type>::type¶ The type of the associated executor parameters object which is associated with this execution policy
-
using
execution_category
= sequenced_execution_tag¶ The category of the execution agents created by this execution policy.
Public Functions
-
constexpr sequenced_task_policy
operator()
(task_policy_tag) const¶ Create a new sequenced_task_policy.
- Return
The new sequenced_task_policy
- Parameters
tag
: [in] Specify that the corresponding asynchronous execution policy should be used
-
constexpr decltype(auto)
operator()
(non_task_policy_tag) const¶ Create a new sequenced_policy from itself.
- Return
The new sequenced_policy
-
template<typename
Executor
>
constexpr decltype(auto)on
(Executor &&exec) const¶ Create a new sequenced_policy from the given executor
- Note
Requires: is_executor<Executor>::value is true
- Return
The new sequenced_policy
- Template Parameters
Executor
: The type of the executor to associate with this execution policy.
- Parameters
exec
: [in] The executor to use for the execution of the parallel algorithm the returned execution policy is used with.
-
template<typename ...
Parameters
>
constexpr decltype(auto)with
(Parameters&&... params) const¶ Create a new sequenced_policy from the given execution parameters
- Note
Requires: all parameters are executor_parameters, different parameter types can’t be duplicated
- Return
The new sequenced_policy
- Template Parameters
Parameters
: The type of the executor parameters to associate with this execution policy.
- Parameters
params
: [in] The executor parameters to use for the execution of the parallel algorithm the returned execution policy is used with.
-
executor_type &
executor
()¶ Return the associated executor object.
-
constexpr executor_type const &
executor
() const¶ Return the associated executor object.
-
executor_parameters_type &
parameters
()¶ Return the associated executor parameters object.
-
constexpr executor_parameters_type const &
parameters
() const¶ Return the associated executor parameters object.
Friends
-
friend
hpx::execution::hpx::parallel::execution::create_rebound_policy_t
-
friend
hpx::execution::hpx::serialization::access
-
template<typename
Executor_
, typenameParameters_
>
structrebind
¶ - #include <execution_policy.hpp>
Rebind the type of executor used by this execution policy. The execution category of Executor shall not be weaker than that of this execution policy
Public Types
-
template<>
usingtype
= sequenced_policy_shim<Executor_, Parameters_>¶ The type of the rebound execution policy.
-
template<>
-
using
-
template<typename
Executor
, typenameParameters
>
structsequenced_policy_shim
¶ - #include <execution_policy.hpp>
The class sequenced_policy is an execution policy type used as a unique type to disambiguate parallel algorithm overloading and require that a parallel algorithm’s execution may not be parallelized.
Public Types
-
template<>
usingexecutor_type
= std::decay_t<Executor>¶ The type of the executor associated with this execution policy.
-
template<>
usingexecutor_parameters_type
= std::decay_t<Parameters>¶ The type of the associated executor parameters object which is associated with this execution policy
-
template<>
usingexecution_category
= typename hpx::traits::executor_execution_category<executor_type>::type¶ The category of the execution agents created by this execution policy.
Public Functions
-
constexpr sequenced_task_policy_shim<Executor, Parameters>
operator()
(task_policy_tag) const¶ Create a new sequenced_task_policy.
- Return
The new sequenced_task_policy_shim
- Parameters
tag
: [in] Specify that the corresponding asynchronous execution policy should be used
-
constexpr decltype(auto)
operator()
(non_task_policy_tag) const¶ Create a new sequenced_policy from itself.
- Return
The new sequenced_policy_shim
-
template<typename
Executor_
>
constexpr decltype(auto)on
(Executor_ &&exec) const¶ Create a new sequenced_policy from the given executor
- Note
Requires: is_executor<Executor>::value is true
- Return
The new sequenced_policy
- Template Parameters
Executor
: The type of the executor to associate with this execution policy.
- Parameters
exec
: [in] The executor to use for the execution of the parallel algorithm the returned execution policy is used with.
-
template<typename ...
Parameters_
>
constexpr decltype(auto)with
(Parameters_&&... params) const¶ Create a new sequenced_policy_shim from the given execution parameters
- Note
Requires: all parameters are executor_parameters, different parameter types can’t be duplicated
- Return
The new sequenced_policy_shim
- Template Parameters
Parameters
: The type of the executor parameters to associate with this execution policy.
- Parameters
params
: [in] The executor parameters to use for the execution of the parallel algorithm the returned execution policy is used with.
-
executor_type &
executor
()¶ Return the associated executor object.
-
constexpr executor_type const &
executor
() const¶ Return the associated executor object.
-
executor_parameters_type &
parameters
()¶ Return the associated executor parameters object.
-
constexpr executor_parameters_type const &
parameters
() const¶ Return the associated executor parameters object.
-
template<typename
Executor_
, typenameParameters_
>
structrebind
¶ - #include <execution_policy.hpp>
Rebind the type of executor used by this execution policy. The execution category of Executor shall not be weaker than that of this execution policy
Public Types
-
template<>
template<>
usingtype
= sequenced_policy_shim<Executor_, Parameters_>¶ The type of the rebound execution policy.
-
template<>
-
template<>
-
struct
sequenced_task_policy
¶ - #include <execution_policy.hpp>
Extension: The class sequenced_task_policy is an execution policy type used as a unique type to disambiguate parallel algorithm overloading and indicate that a parallel algorithm’s execution may not be parallelized (has to run sequentially).
The algorithm returns a future representing the result of the corresponding algorithm when invoked with the sequenced_policy.
Public Types
-
using
executor_type
= sequenced_executor¶ The type of the executor associated with this execution policy.
-
using
executor_parameters_type
= parallel::execution::extract_executor_parameters<executor_type>::type¶ The type of the associated executor parameters object which is associated with this execution policy
-
using
execution_category
= sequenced_execution_tag¶ The category of the execution agents created by this execution policy.
Public Functions
-
constexpr sequenced_task_policy
operator()
(task_policy_tag) const¶ Create a new sequenced_task_policy from itself
- Return
The new sequenced_task_policy
- Parameters
tag
: [in] Specify that the corresponding asynchronous execution policy should be used
-
constexpr decltype(auto)
operator()
(non_task_policy_tag) const¶ Create a corresponding non task policy for this task policy
- Return
The non task seqeuential policy
-
template<typename
Executor
>
constexpr decltype(auto)on
(Executor &&exec) const¶ Create a new sequenced_task_policy from the given executor
- Note
Requires: is_executor<Executor>::value is true
- Return
The new sequenced_task_policy
- Template Parameters
Executor
: The type of the executor to associate with this execution policy.
- Parameters
exec
: [in] The executor to use for the execution of the parallel algorithm the returned execution policy is used with.
-
template<typename ...
Parameters
>
constexpr decltype(auto)with
(Parameters&&... params) const¶ Create a new sequenced_task_policy from the given execution parameters
- Note
Requires: all parameters are executor_parameters, different parameter types can’t be duplicated
- Return
The new sequenced_task_policy
- Template Parameters
Parameters
: The type of the executor parameters to associate with this execution policy.
- Parameters
params
: [in] The executor parameters to use for the execution of the parallel algorithm the returned execution policy is used with.
-
executor_type &
executor
()¶ Return the associated executor object.
-
constexpr executor_type const &
executor
() const¶ Return the associated executor object.
-
executor_parameters_type &
parameters
()¶ Return the associated executor parameters object.
-
constexpr executor_parameters_type const &
parameters
() const¶ Return the associated executor parameters object.
Friends
-
friend
hpx::execution::hpx::parallel::execution::create_rebound_policy_t
-
friend
hpx::execution::hpx::serialization::access
-
template<typename
Executor_
, typenameParameters_
>
structrebind
¶ - #include <execution_policy.hpp>
Rebind the type of executor used by this execution policy. The execution category of Executor shall not be weaker than that of this execution policy
Public Types
-
template<>
usingtype
= sequenced_task_policy_shim<Executor_, Parameters_>¶ The type of the rebound execution policy.
-
template<>
-
using
-
template<typename
Executor
, typenameParameters
>
structsequenced_task_policy_shim
¶ - #include <execution_policy.hpp>
Extension: The class sequenced_task_policy_shim is an execution policy type used as a unique type to disambiguate parallel algorithm overloading based on combining a underlying sequenced_task_policy and an executor and indicate that a parallel algorithm’s execution may not be parallelized (has to run sequentially).
The algorithm returns a future representing the result of the corresponding algorithm when invoked with the sequenced_policy.
Public Types
-
template<>
usingexecutor_type
= std::decay_t<Executor>¶ The type of the executor associated with this execution policy.
Public Functions
-
constexpr sequenced_task_policy_shim const &
operator()
(task_policy_tag) const¶ Create a new sequenced_task_policy from itself
- Return
The new sequenced_task_policy
- Parameters
tag
: [in] Specify that the corresponding asynchronous execution policy should be used
-
constexpr decltype(auto)
operator()
(non_task_policy_tag) const¶ Create a corresponding non task policy for this task policy
- Return
The non task seqeuential shim policy
-
template<typename
Executor_
>
constexpr decltype(auto)on
(Executor_ &&exec) const¶ Create a new sequenced_task_policy from the given executor
- Note
Requires: is_executor<Executor>::value is true
- Return
The new sequenced_task_policy
- Template Parameters
Executor
: The type of the executor to associate with this execution policy.
- Parameters
exec
: [in] The executor to use for the execution of the parallel algorithm the returned execution policy is used with.
-
template<typename ...
Parameters_
>
constexpr decltype(auto)with
(Parameters_&&... params) const¶ Create a new sequenced_task_policy_shim from the given execution parameters
- Note
Requires: all parameters are executor_parameters, different parameter types can’t be duplicated
- Return
The new sequenced_task_policy_shim
- Template Parameters
Parameters
: The type of the executor parameters to associate with this execution policy.
- Parameters
params
: [in] The executor parameters to use for the execution of the parallel algorithm the returned execution policy is used with.
-
executor_type &
executor
()¶ Return the associated executor object.
-
constexpr executor_type const &
executor
() const¶ Return the associated executor object.
-
executor_parameters_type &
parameters
()¶ Return the associated executor parameters object.
-
constexpr executor_parameters_type const &
parameters
() const¶ Return the associated executor parameters object.
-
template<typename
Executor_
, typenameParameters_
>
structrebind
¶ - #include <execution_policy.hpp>
Rebind the type of executor used by this execution policy. The execution category of Executor shall not be weaker than that of this execution policy
Public Types
-
template<>
template<>
usingtype
= sequenced_task_policy_shim<Executor_, Parameters_>¶ The type of the rebound execution policy.
-
template<>
-
template<>
-
struct
unsequenced_policy
¶ - #include <execution_policy.hpp>
The class unsequenced_policy is an execution policy type used as a unique type to disambiguate parallel algorithm overloading and indicate that a parallel algorithm’s execution may be vectorized.
Public Types
-
using
executor_type
= sequenced_executor¶ The type of the executor associated with this execution policy.
-
using
executor_parameters_type
= parallel::execution::extract_executor_parameters<executor_type>::type¶ The type of the associated executor parameters object which is associated with this execution policy
-
using
execution_category
= sequenced_execution_tag¶ The category of the execution agents created by this execution policy.
Public Functions
-
constexpr decltype(auto)
operator()
(non_task_policy_tag) const¶ Create a new non task policy from itself
- Return
The non task unsequenced policy
-
constexpr decltype(auto)
operator()
(task_policy_tag) const¶ Create a new task policy from itself
- Return
The task unsequenced policy
-
executor_type &
executor
()¶ Return the associated executor object.
-
constexpr executor_type const &
executor
() const¶ Return the associated executor object.
-
executor_parameters_type &
parameters
()¶ Return the associated executor parameters object.
-
constexpr executor_parameters_type const &
parameters
() const¶ Return the associated executor parameters object.
Friends
-
friend
hpx::execution::hpx::parallel::execution::create_rebound_policy_t
-
friend
hpx::execution::hpx::serialization::access
-
template<typename
Executor
, typenameParameters
>
structrebind
¶ - #include <execution_policy.hpp>
Rebind the type of executor used by this execution policy.
Public Types
-
template<>
usingtype
= unsequenced_policy¶ The type of the rebound execution policy.
-
template<>
-
using
-
constexpr sequenced_policy
-
namespace
-
namespace
hpx
-
namespace
execution
-
namespace
experimental
Functions
-
template<typename
ExPolicy
>
constexpr decltype(auto)tag_invoke
(hpx::execution::experimental::with_annotation_t, ExPolicy &&policy, char const *annotation)¶
-
template<typename
ExPolicy
>
decltype(auto)tag_invoke
(hpx::execution::experimental::with_annotation_t, ExPolicy &&policy, std::string annotation)¶
-
template<typename
ExPolicy
>
constexpr decltype(auto)tag_invoke
(hpx::execution::experimental::get_annotation_t, ExPolicy &&policy)¶
-
template<typename
-
namespace
-
namespace
-
namespace
hpx
-
namespace
parallel
-
namespace
execution
Functions
-
template<typename
ExPolicy
>
constexpr decltype(auto)tag_invoke
(with_processing_units_count_t, ExPolicy &&policy, std::size_t num_cores)¶
-
template<typename
ExPolicy
, typenameParams
>
constexpr decltype(auto)tag_invoke
(with_processing_units_count_t, ExPolicy &&policy, Params &¶ms)¶
-
template<typename
ParametersProperty
, typenameExPolicy
, typenameParams
>
constexpr decltype(auto)tag_fallback_invoke
(ParametersProperty, ExPolicy &&policy, Params &¶ms)¶
-
template<typename
-
namespace
-
namespace
-
namespace
hpx
-
namespace
execution
-
namespace
experimental
Functions
-
std::ostream &
operator<<
(std::ostream &os, fork_join_executor::loop_schedule const &schedule)¶
-
class
fork_join_executor
¶ - #include <fork_join_executor.hpp>
An executor with fork-join (blocking) semantics.
The fork_join_executor creates on construction a set of worker threads that are kept alive for the duration of the executor. Copying the executor has reference semantics, i.e. copies of a fork_join_executor hold a reference to the worker threads of the original instance. Scheduling work through the executor concurrently from different threads is undefined behaviour.
The executor keeps a set of worker threads alive for the lifetime of the executor, meaning other work will not be executed while the executor is busy or waiting for work. The executor has a customizable delay after which it will yield to other work. Since starting and resuming the worker threads is a slow operation the executor should be reused whenever possible for multiple adjacent parallel algorithms or invocations of bulk_(a)sync_execute.
Public Types
-
enum
loop_schedule
¶ Type of loop schedule for use with the fork_join_executor. loop_schedule::static_ implies no work-stealing; loop_schedule::dynamic allows stealing when a worker has finished its local work.
Values:
-
static_
¶
-
dynamic
¶
-
Public Functions
-
fork_join_executor
(threads::thread_priority priority = threads::thread_priority::high, threads::thread_stacksize stacksize = threads::thread_stacksize::small_, loop_schedule schedule = loop_schedule::static_, std::chrono::nanoseconds yield_delay = std::chrono::milliseconds(1))¶ Construct a fork_join_executor.
- Parameters
priority
: The priority of the worker threads.stacksize
: The stacksize of the worker threads. Must not be nostack.schedule
: The loop schedule of the parallel regions.yield_delay
: The time after which the executor yields to other work if it hasn’t received any new work for bulk execution.
-
enum
-
std::ostream &
-
namespace
-
namespace
Defines
-
GUIDED_POOL_EXECUTOR_DEBUG
¶
-
namespace
hpx
Functions
-
static hpx::debug::enable_print<GUIDED_POOL_EXECUTOR_DEBUG> hpx::gpx_deb("GP_EXEC")
-
namespace
parallel
-
namespace
execution
-
template<typename
Hint
>
structexecutor_execution_category
<guided_pool_executor<Hint>>¶ Public Types
-
typedef hpx::execution::parallel_execution_tag
type
¶
-
typedef hpx::execution::parallel_execution_tag
-
template<typename
Hint
>
structexecutor_execution_category
<guided_pool_executor_shim<Hint>>¶ Public Types
-
typedef hpx::execution::parallel_execution_tag
type
-
typedef hpx::execution::parallel_execution_tag
-
template<typename
Tag
>
structguided_pool_executor
<pool_numa_hint<Tag>>¶ Public Functions
-
guided_pool_executor
(threads::thread_pool_base *pool, bool hp_sync = false)¶
-
guided_pool_executor
(threads::thread_pool_base *pool, threads::thread_stacksize stacksize, bool hp_sync = false)¶
-
guided_pool_executor
(threads::thread_pool_base *pool, threads::thread_priority priority, threads::thread_stacksize stacksize = threads::thread_stacksize::default_, bool hp_sync = false)¶
-
template<typename
F
, typename ...Ts
>
future<typename hpx::util::detail::invoke_deferred_result<F, Ts...>::type>async_execute
(F &&f, Ts&&... ts)¶
-
template<typename
F
, typenameFuture
, typename ...Ts
, typename = std::enable_if_t<hpx::traits::is_future<Future>::value>>
autothen_execute
(F &&f, Future &&predecessor, Ts&&... ts)¶
-
template<typename
F
, template<typename> classOuterFuture
, typename ...InnerFutures
, typename ...Ts
, typename = std::enable_if_t<detail::is_future_of_tuple_of_futures<OuterFuture<hpx::tuple<InnerFutures...>>>::value>, typename = std::enable_if_t<hpx::traits::is_future_tuple<hpx::tuple<InnerFutures...>>::value>>
autothen_execute
(F &&f, OuterFuture<hpx::tuple<InnerFutures...>> &&predecessor, Ts&&... ts)¶
-
template<typename
F
, typename ...InnerFutures
, typename = std::enable_if_t<hpx::traits::is_future_tuple<hpx::tuple<InnerFutures...>>::value>>
autoasync_execute
(F &&f, hpx::tuple<InnerFutures...> &&predecessor)¶
Private Members
-
threads::thread_pool_base *
pool_
¶
-
threads::thread_priority
priority_
¶
-
threads::thread_stacksize
stacksize_
¶
-
pool_numa_hint<Tag>
hint_
¶
-
bool
hp_sync_
¶
Friends
-
friend
hpx::parallel::execution::guided_pool_executor_shim
-
-
template<typename
H
>
structguided_pool_executor_shim
¶ Public Functions
-
guided_pool_executor_shim
(bool guided, threads::thread_pool_base *pool, bool hp_sync = false)¶
-
guided_pool_executor_shim
(bool guided, threads::thread_pool_base *pool, threads::thread_stacksize stacksize, bool hp_sync = false)¶
-
guided_pool_executor_shim
(bool guided, threads::thread_pool_base *pool, threads::thread_priority priority, threads::thread_stacksize stacksize = threads::thread_stacksize::default_, bool hp_sync = false)¶
-
-
template<typename
-
namespace
-
-
namespace
hpx
-
namespace
execution
-
namespace
experimental
-
Functions
-
static constexpr print_on hpx::execution::experimental::lim_debug("LIMEXEC")
-
template<typename
BaseExecutor
>
structlimiting_executor
¶ Public Types
-
template<>
usingexecution_category
= typename BaseExecutor::execution_category¶
-
template<>
usingexecutor_parameters_type
= typename BaseExecutor::executor_parameters_type¶
Public Functions
-
limiting_executor
(BaseExecutor &ex, std::size_t lower, std::size_t upper, bool block_on_destruction = true)¶
-
~limiting_executor
()¶
-
limiting_executor const &
context
() const¶
-
template<typename
F
, typenameFuture
, typename ...Ts
>
decltype(auto)then_execute
(F &&f, Future &&predecessor, Ts&&... ts)¶
-
template<typename
F
, typenameS
, typename ...Ts
>
decltype(auto)bulk_async_execute
(F &&f, S const &shape, Ts&&... ts)¶
-
template<typename
F
, typenameS
, typenameFuture
, typename ...Ts
>
decltype(auto)bulk_then_execute
(F &&f, S const &shape, Future &&predecessor, Ts&&... ts)¶
-
void
wait
()¶
-
void
wait_all
()¶
-
template<typename
F
, typenameB
= BaseExecutor, typenameEnable
= void>
structthrottling_wrapper
¶
-
template<>
-
-
namespace
-
namespace
-
namespace
hpx
-
namespace
execution
-
-
template<typename
Policy
>
structparallel_policy_executor
¶ - #include <parallel_executor.hpp>
A parallel_executor creates groups of parallel execution agents which execute in threads implicitly created by the executor. This executor prefers continuing with the creating thread first before executing newly created threads.
This executor conforms to the concepts of a TwoWayExecutor, and a BulkTwoWayExecutor
Public Types
-
template<>
usingexecution_category
= parallel_execution_tag¶ Associate the parallel_execution_tag executor tag type as a default with this executor.
-
template<>
usingexecutor_parameters_type
= static_chunk_size¶ Associate the static_chunk_size executor parameters type as a default with this executor.
Public Functions
-
constexpr
parallel_policy_executor
(threads::thread_priority priority, threads::thread_stacksize stacksize = threads::thread_stacksize::default_, threads::thread_schedule_hint schedulehint = {}, Policy l = parallel::execution::detail::get_default_policy<Policy>::call(), std::size_t hierarchical_threshold = hierarchical_threshold_default_)¶ Create a new parallel executor.
-
constexpr
parallel_policy_executor
(threads::thread_stacksize stacksize, threads::thread_schedule_hint schedulehint = {}, Policy l = parallel::execution::detail::get_default_policy<Policy>::call())¶
-
constexpr
parallel_policy_executor
(threads::thread_schedule_hint schedulehint, Policy l = parallel::execution::detail::get_default_policy<Policy>::call())¶
-
constexpr
parallel_policy_executor
(Policy l = parallel::execution::detail::get_default_policy<Policy>::call())¶
-
constexpr
parallel_policy_executor
(threads::thread_pool_base *pool, threads::thread_priority priority = threads::thread_priority::default_, threads::thread_stacksize stacksize = threads::thread_stacksize::default_, threads::thread_schedule_hint schedulehint = {}, Policy l = parallel::execution::detail::get_default_policy<Policy>::call(), std::size_t hierarchical_threshold = hierarchical_threshold_default_)¶
Friends
-
friend constexpr parallel_policy_executor
tag_invoke
(hpx::execution::experimental::with_hint_t, parallel_policy_executor const &exec, hpx::threads::thread_schedule_hint hint)¶
-
friend constexpr hpx::threads::thread_schedule_hint
tag_invoke
(hpx::execution::experimental::get_hint_t, parallel_policy_executor const &exec)¶
-
friend constexpr parallel_policy_executor
tag_invoke
(hpx::execution::experimental::with_priority_t, parallel_policy_executor const &exec, hpx::threads::thread_priority priority)¶
-
friend constexpr hpx::threads::thread_priority
tag_invoke
(hpx::execution::experimental::get_priority_t, parallel_policy_executor const &exec)¶
-
friend constexpr parallel_policy_executor
tag_dispatch
(hpx::execution::experimental::with_stacksize_t, parallel_policy_executor const &exec, hpx::threads::thread_stacksize stacksize)¶
-
friend constexpr hpx::threads::thread_stacksize
tag_dispatch
(hpx::execution::experimental::get_stacksize_t, parallel_policy_executor const &exec)¶
-
friend constexpr parallel_policy_executor
tag_invoke
(hpx::execution::experimental::with_annotation_t, parallel_policy_executor const &exec, char const *annotation)¶
-
parallel_policy_executor
tag_invoke
(hpx::execution::experimental::with_annotation_t, parallel_policy_executor const &exec, std::string annotation)¶
-
friend constexpr char const *
tag_invoke
(hpx::execution::experimental::get_annotation_t, parallel_policy_executor const &exec)¶
-
friend constexpr parallel_policy_executor
tag_invoke
(hpx::parallel::execution::with_processing_units_count_t, parallel_policy_executor const &exec, std::size_t num_cores)¶
-
template<typename
Parameters
>
friend constexpr std::size_ttag_invoke
(hpx::parallel::execution::processing_units_count_t, Parameters&&, parallel_policy_executor const &exec)¶
-
template<>
-
template<typename
-
namespace
-
template<>
structparallel_policy_executor_aggregated
<hpx::launch>¶ Public Types
-
template<>
usingexecution_category
= hpx::execution::parallel_execution_tag¶ Associate the parallel_execution_tag executor tag type as a default with this executor.
-
template<>
usingexecutor_parameters_type
= hpx::execution::static_chunk_size¶ Associate the static_chunk_size executor parameters type as a default with this executor.
-
template<>
-
namespace
hpx
-
namespace
parallel
-
namespace
execution
Typedefs
-
template<typename
Policy
= hpx::launch::async_policy>
structparallel_policy_executor_aggregated
¶ - #include <parallel_executor_aggregated.hpp>
A parallel_executor_aggregated creates groups of parallel execution agents that execute in threads implicitly created by the executor. This executor prefers continuing with the creating thread first before executing newly created threads.
This executor conforms to the concepts of a TwoWayExecutor, and a BulkTwoWayExecutor
Public Types
-
template<>
usingexecution_category
= hpx::execution::parallel_execution_tag¶ Associate the parallel_execution_tag executor tag type as a default with this executor.
-
template<>
usingexecutor_parameters_type
= hpx::execution::static_chunk_size¶ Associate the static_chunk_size executor parameters type as a default with this executor.
-
template<>
-
template<>
structparallel_policy_executor_aggregated
<hpx::launch> Public Types
-
template<>
usingexecution_category
= hpx::execution::parallel_execution_tag Associate the parallel_execution_tag executor tag type as a default with this executor.
-
template<>
usingexecutor_parameters_type
= hpx::execution::static_chunk_size Associate the static_chunk_size executor parameters type as a default with this executor.
-
template<>
-
template<typename
-
namespace
-
namespace
-
namespace
hpx
-
namespace
parallel
-
namespace
execution
-
class
restricted_thread_pool_executor
¶ Public Types
-
typedef hpx::execution::parallel_execution_tag
execution_category
¶ Associate the parallel_execution_tag executor tag type as a default with this executor.
-
typedef hpx::execution::static_chunk_size
executor_parameters_type
¶ Associate the static_chunk_size executor parameters type as a default with this executor.
Public Functions
-
restricted_thread_pool_executor
(std::size_t first_thread = 0, std::size_t num_threads = 1, threads::thread_priority priority = threads::thread_priority::default_, threads::thread_stacksize stacksize = threads::thread_stacksize::default_, threads::thread_schedule_hint schedulehint = {}, std::size_t hierarchical_threshold = hierarchical_threshold_default_)¶ Create a new parallel executor.
-
restricted_thread_pool_executor
(restricted_thread_pool_executor const &other)¶
Private Members
-
threads::thread_pool_base *
pool_
= nullptr¶
-
threads::thread_priority
priority_
= threads::thread_priority::default_¶
-
threads::thread_stacksize
stacksize_
= threads::thread_stacksize::default_¶
-
threads::thread_schedule_hint
schedulehint_
= {}¶
-
std::size_t
hierarchical_threshold_
= hierarchical_threshold_default_¶
-
typedef hpx::execution::parallel_execution_tag
-
class
-
namespace
-
namespace
-
namespace
hpx
-
namespace
execution
-
namespace
experimental
Functions
-
template<typename
BaseScheduler
>scheduler_executor
(BaseScheduler &&sched)¶
-
template<typename
BaseScheduler
>
structscheduler_executor
Public Functions
-
constexpr
scheduler_executor
()¶
-
template<typename
Scheduler
, typenameEnable
= std::enable_if_t<hpx::execution::experimental::is_scheduler_v<Scheduler>>>
constexprscheduler_executor
(Scheduler &&sched)¶
-
constexpr
scheduler_executor
(scheduler_executor&&)¶
-
constexpr scheduler_executor &
operator=
(scheduler_executor&&)¶
-
constexpr
scheduler_executor
(scheduler_executor const&)¶
-
constexpr scheduler_executor &
operator=
(scheduler_executor const&)¶
-
constexpr
-
template<typename
-
namespace
-
namespace
-
namespace
hpx
-
namespace
execution
-
struct
sequenced_executor
¶ - #include <sequenced_executor.hpp>
A sequential_executor creates groups of sequential execution agents which execute in the calling thread. The sequential order is given by the lexicographical order of indices in the index space.
-
struct
-
namespace
-
namespace
hpx
-
namespace
parallel
-
namespace
execution
Typedefs
-
using
thread_pool_executor
= hpx::execution::parallel_executor¶
-
using
-
namespace
-
namespace
-
namespace
hpx
-
namespace
hpx
-
namespace
execution
-
namespace
experimental
-
namespace
-
namespace