hpx/execution/executors/create_rebound_policy.hpp#

Defined in header hpx/execution/executors/create_rebound_policy.hpp.

See Public API for a list of names and headers that are part of the public HPX API.

create_rebound_policy and the per-axis construction customization points it dispatches to.

rebind_executor.hpp includes this header, so code that includes rebind_executor.hpp directly still gets create_rebound_policy.

namespace hpx
namespace execution
namespace experimental

Variables

template<typename Policy, typename Executor> concept rebound_policy_executor_constructible  =hpx::executor_any<Executor> &&{{construct_rebound_policy_executor<std::decay_t<Policy>,std::decay_t<Executor>>::call(std::forward<  Policy  >(  policy  ),std::forward<  Executor  >(  exec  ))} -> std::same_as<rebind_policy_executor_t<Policy, Executor>>;}

Whether a policy of type Policy can be rebound to an executor of type Executor through create_rebound_policy_executor.

Satisfied if Executor is an executor and construct_rebound_policy_executor accepts the forwarded policy and executor and returns rebind_policy_executor_t<Policy, Executor>, so in particular only if that type exists.

template<typename Policy, typename Parameters> concept rebound_policy_parameters_constructible  =hpx::executor_parameters<Parameters> &&{{construct_rebound_policy_parameters<std::decay_t<Policy>,std::decay_t<Parameters>>::call(std::forward<  Policy  >(  policy  ),std::forward<  Parameters  >(  params  ))} -> std::same_as<rebind_policy_parameters_t<Policy, Parameters>>;}

Whether a policy of type Policy can be rebound to executor parameters of type Parameters through create_rebound_policy_parameters.

Mirrors rebound_policy_executor_constructible along the parameters axis.

constexpr struct hpx::execution::experimental::create_rebound_policy_executor_t create_rebound_policy_executor#
constexpr struct hpx::execution::experimental::create_rebound_policy_parameters_t create_rebound_policy_parameters#
constexpr struct hpx::execution::experimental::create_rebound_policy_t create_rebound_policy#
template<typename Policy, typename Executor>
struct construct_rebound_policy_executor#
#include <create_rebound_policy.hpp>

Customization point controlling how an execution policy rebound to a new executor is constructed from the original policy.

rebind_policy_executor only computes the rebound type. A policy that carries additional state, or that cannot be constructed from just (executor, parameters), specializes this template to build the rebound policy itself. call receives the original policy, forwarded with the value category it was passed with, so any such state can be carried over, and the new executor.

call must return exactly rebind_policy_executor_t<Policy, Executor>. It must also be SFINAE-friendly: create_rebound_policy_executor checks the call in a requires expression, so a specialization that can’t handle some arguments has to make the call expression itself ill-formed, for example by constraining call or by giving it a return type that depends on its own template parameters. A failure inside the body of call, or in a member declaration that depends only on Policy and Executor, is a hard error.

The default constructs the rebound policy from the new executor and the original policy’s parameters().

Template Parameters:
  • Policy – The (decayed) execution policy type being rebound.

  • Executor – The (decayed) executor type Policy is rebound to.

Public Static Functions

template<typename Policy_, typename Executor_>
static inline constexpr rebind_policy_executor_t<Policy, Executor_> call(Policy_ &&policy, Executor_ &&exec)#
template<typename Policy, typename Parameters>
struct construct_rebound_policy_parameters#
#include <create_rebound_policy.hpp>

Customization point controlling how an execution policy rebound to new executor parameters is constructed from the original policy.

Mirrors construct_rebound_policy_executor along the parameters axis, with the same requirements: call must return exactly rebind_policy_parameters_t<Policy, Parameters> and be SFINAE-friendly.

The default constructs the rebound policy from the original policy’s executor() and the new parameters.

Template Parameters:
  • Policy – The (decayed) execution policy type being rebound.

  • Parameters – The (decayed) executor parameters type Policy is rebound to.

Public Static Functions

template<typename Policy_, typename Parameters_>
static inline constexpr rebind_policy_parameters_t<Policy, Parameters_> call(Policy_ &&policy, Parameters_ &&parameters)#
struct create_rebound_policy_executor_t#
#include <create_rebound_policy.hpp>

Rebind the executor of policy to exec and construct the result through construct_rebound_policy_executor.

Only participates in overload resolution if rebound_policy_executor_constructible<Policy, Executor> is satisfied.

Public Functions

template<typename Policy, typename Executor>
inline constexpr rebind_policy_executor_t<Policy, Executor> operator()(Policy &&policy, Executor &&exec) const#
struct create_rebound_policy_parameters_t#
#include <create_rebound_policy.hpp>

Rebind the executor parameters of policy to parameters and construct the result through construct_rebound_policy_parameters.

Only participates in overload resolution if rebound_policy_parameters_constructible<Policy, Parameters> is satisfied.

Public Functions

template<typename Policy, typename Parameters>
inline constexpr rebind_policy_parameters_t<Policy, Parameters> operator()(Policy &&policy, Parameters &&parameters) const#
struct create_rebound_policy_t#

Public Functions

template<typename ExPolicy, typename Executor, typename Parameters>
inline constexpr decltype(auto) operator()(ExPolicy &&policy, Executor &&exec, Parameters &&parameters) const#

Rebind both the executor and the executor parameters of policy, one axis at a time through create_rebound_policy_executor and create_rebound_policy_parameters.

The executor is rebound first, so the specializations of both axes are honored and state that policy carries is kept, the same as when rebinding a single axis.

template<typename ExPolicy, typename Executor>
inline constexpr decltype(auto) operator()(ExPolicy &&policy, Executor &&exec) const#

Rebind only the executor of policy, through create_rebound_policy_executor.

template<typename ExPolicy, typename Parameters>
inline constexpr decltype(auto) operator()(ExPolicy &&policy, Parameters &&parameters) const#

Rebind only the executor parameters of policy, through create_rebound_policy_parameters.