execution

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

namespace hpx
namespace execution
namespace experimental

Variables

hpx::execution::experimental::bulk_t bulk
struct bulk_t : public hpx::functional::detail::tag_priority<bulk_t>

Friends

template<typename Sender, typename Shape, typename F>
friend constexpr auto tag_override_invoke(bulk_t, Sender &&sender, Shape const &shape, F &&f)
template<typename Sender, typename Shape, typename F>
friend constexpr auto tag_fallback_invoke(bulk_t, Sender &&sender, Shape const &shape, F &&f)
template<typename Sender, typename Shape, typename F>
friend constexpr auto tag_fallback_invoke(bulk_t, Sender &&sender, Shape &&shape, F &&f)
template<typename Shape, typename F>
friend constexpr auto tag_fallback_invoke(bulk_t, Shape &&shape, F &&f)
namespace hpx
namespace execution
namespace experimental

Variables

hpx::execution::experimental::ensure_started_t ensure_started
struct ensure_started_t : public hpx::functional::detail::tag_fallback<ensure_started_t>

Friends

template<typename Sender, typename Allocator = hpx::util::internal_allocator<>>
friend constexpr auto tag_override_invoke(ensure_started_t, Sender &&sender, Allocator const &allocator = {})
template<typename Sender, typename Allocator = hpx::util::internal_allocator<>>
friend constexpr auto tag_fallback_invoke(ensure_started_t, Sender &&sender, Allocator const &allocator = {})
template<typename Sender, typename Allocator>
friend constexpr auto tag_fallback_invoke(ensure_started_t, detail::split_sender<Sender, Allocator, detail::submission_type::eager> sender, Allocator const& = {})
template<typename Allocator = hpx::util::internal_allocator<>>
friend constexpr auto tag_fallback_invoke(ensure_started_t, Allocator const &allocator = {})
namespace hpx
namespace execution
namespace experimental

Variables

hpx::execution::experimental::execute_t execute
struct execute_t : public hpx::functional::detail::tag_fallback<execute_t>

Friends

template<typename Scheduler, typename F>
friend constexpr auto tag_fallback_invoke(execute_t, Scheduler &&scheduler, F &&f)
namespace hpx
namespace execution
namespace experimental

Variables

constexpr struct hpx::execution::experimental::just_t just
constexpr struct hpx::execution::experimental::just_error_t just_error
constexpr struct hpx::execution::experimental::just_stopped_t just_stopped
struct just_error_t

Public Functions

template<typename Error>
constexpr auto operator()(Error &&error) const
struct just_stopped_t

Public Functions

template<typename ...Ts>
constexpr auto operator()(Ts&&... ts) const
struct just_t

Public Functions

template<typename ...Ts>
constexpr auto operator()(Ts&&... ts) const
namespace hpx
namespace execution
namespace experimental

Variables

constexpr struct hpx::execution::experimental::keep_future_t keep_future
struct keep_future_t

Public Functions

template<typename Future>
constexpr auto operator()(Future &&future) const
constexpr auto operator()() const
namespace hpx
namespace execution
namespace experimental

Variables

hpx::execution::experimental::let_error_t let_error
struct let_error_t : public hpx::functional::detail::tag_priority<let_error_t>

Friends

template<typename PredecessorSender, typename F>
friend constexpr auto tag_override_invoke(let_error_t, PredecessorSender &&predecessor_sender, F &&f)
template<typename PredecessorSender, typename F>
friend constexpr auto tag_fallback_invoke(let_error_t, PredecessorSender &&predecessor_sender, F &&f)
template<typename F>
friend constexpr auto tag_fallback_invoke(let_error_t, F &&f)
namespace hpx
namespace execution
namespace experimental

Variables

hpx::execution::experimental::let_stopped_t let_stopped
struct let_stopped_t : public hpx::functional::detail::tag_priority<let_stopped_t>

Friends

template<typename PredecessorSender, typename F>
friend constexpr auto tag_override_invoke(let_stopped_t, PredecessorSender &&predecessor_sender, F &&f)
template<typename PredecessorSender, typename F>
friend constexpr auto tag_fallback_invoke(let_stopped_t, PredecessorSender &&predecessor_sender, F &&f)
template<typename F>
friend constexpr auto tag_fallback_invoke(let_stopped_t, F &&f)
namespace hpx
namespace execution
namespace experimental

Variables

hpx::execution::experimental::let_value_t let_value
struct let_value_t : public hpx::functional::detail::tag_priority<let_value_t>

Friends

template<typename PredecessorSender, typename F>
friend constexpr auto tag_override_invoke(let_value_t, PredecessorSender &&predecessor_sender, F &&f)
template<typename PredecessorSender, typename F>
friend constexpr auto tag_fallback_invoke(let_value_t, PredecessorSender &&predecessor_sender, F &&f)
template<typename F>
friend constexpr auto tag_fallback_invoke(let_value_t, F &&f)
namespace hpx
namespace execution
namespace experimental

Variables

hpx::execution::experimental::make_future_t make_future
struct make_future_t : public hpx::functional::detail::tag_fallback<make_future_t>

Friends

template<typename Sender, typename Allocator = hpx::util::internal_allocator<>>
friend constexpr auto tag_fallback_invoke(make_future_t, Sender &&sender, Allocator const &allocator = Allocator{})
template<typename Allocator = hpx::util::internal_allocator<>>
friend constexpr auto tag_fallback_invoke(make_future_t, Allocator const &allocator = Allocator{})
namespace hpx
namespace execution
namespace experimental

Variables

hpx::execution::experimental::schedule_from_t schedule_from
struct schedule_from_t : public hpx::functional::detail::tag_fallback<schedule_from_t>

Friends

template<typename Scheduler, typename Sender>
friend constexpr auto tag_fallback_invoke(schedule_from_t, Scheduler &&scheduler, Sender &&predecessor_sender)
namespace hpx
namespace execution
namespace experimental

Variables

hpx::execution::experimental::split_t split
struct split_t : public hpx::functional::detail::tag_priority<split_t>

Friends

template<typename Sender, typename Allocator = hpx::util::internal_allocator<>>
friend constexpr auto tag_override_invoke(split_t, Sender &&sender, Allocator const &allocator = {})
template<typename Sender, typename Allocator = hpx::util::internal_allocator<>>
friend constexpr auto tag_fallback_invoke(split_t, Sender &&sender, Allocator const &allocator = {})
template<typename Sender, typename Allocator>
friend constexpr auto tag_fallback_invoke(split_t, detail::split_sender<Sender, Allocator, detail::submission_type::lazy> sender, Allocator const& = {})
template<typename Allocator = hpx::util::internal_allocator<>>
friend constexpr auto tag_fallback_invoke(split_t, Allocator const &allocator = {})
namespace hpx
namespace execution
namespace experimental

Variables

hpx::execution::experimental::start_detached_t start_detached
struct start_detached_t : public hpx::functional::detail::tag_priority<start_detached_t>

Friends

template<typename Sender, typename Allocator = hpx::util::internal_allocator<>>
friend constexpr auto tag_override_invoke(start_detached_t, Sender &&sender, Allocator const &allocator = Allocator{})
template<typename Sender, typename Allocator = hpx::util::internal_allocator<>>
friend constexpr void tag_fallback_invoke(start_detached_t, Sender &&sender, Allocator const &allocator = Allocator{})
template<typename Allocator = hpx::util::internal_allocator<>>
friend constexpr auto tag_fallback_invoke(start_detached_t, Allocator const &allocator = Allocator{})
namespace hpx
namespace this_thread
namespace experimental

Variables

hpx::this_thread::experimental::sync_wait_t sync_wait
struct sync_wait_t : public hpx::functional::detail::tag_fallback<sync_wait_t>

Friends

template<typename Sender>
friend constexpr auto tag_fallback_invoke(sync_wait_t, Sender &&sender)
friend constexpr auto tag_fallback_invoke(sync_wait_t)
namespace hpx
namespace execution
namespace experimental

Variables

hpx::execution::experimental::then_t then
struct then_t : public hpx::functional::detail::tag_priority<then_t>

Friends

template<typename Sender, typename F>
friend constexpr auto tag_override_invoke(then_t, Sender &&sender, F &&f)
template<typename Sender, typename F>
friend constexpr auto tag_fallback_invoke(then_t, Sender &&sender, F &&f)
template<typename F>
friend constexpr auto tag_fallback_invoke(then_t, F &&f)
namespace hpx
namespace execution
namespace experimental

Variables

hpx::execution::experimental::transfer_t transfer
struct transfer_t : public hpx::functional::detail::tag_priority<transfer_t>

Friends

template<typename Sender, typename Scheduler>
friend constexpr auto tag_override_invoke(transfer_t, Sender &&sender, Scheduler &&scheduler)
template<typename Sender, typename Scheduler>
friend constexpr auto tag_fallback_invoke(transfer_t, Sender &&predecessor_sender, Scheduler &&scheduler)
template<typename Scheduler>
friend constexpr auto tag_fallback_invoke(transfer_t, Scheduler &&scheduler)
namespace hpx
namespace execution
namespace experimental

Variables

hpx::execution::experimental::transfer_just_t transfer_just
struct transfer_just_t : public hpx::functional::detail::tag_fallback<transfer_just_t>

Friends

template<typename Scheduler, typename ...Ts>
friend constexpr auto tag_fallback_invoke(transfer_just_t, Scheduler &&scheduler, Ts&&... ts)
namespace hpx
namespace execution
namespace experimental

Variables

hpx::execution::experimental::when_all_t when_all
hpx::execution::experimental::when_all_with_variant_t when_all_with_variant
hpx::execution::experimental::transfer_when_all_t transfer_when_all
hpx::execution::experimental::transfer_when_all_with_variant_t transfer_when_all_with_variant
struct transfer_when_all_t : public hpx::functional::detail::tag_fallback<transfer_when_all_t>

Friends

template<typename Sched, typename ...Senders>
friend constexpr auto tag_fallback_invoke(transfer_when_all_t, Sched &&sched, Senders&&... senders)
struct when_all_t : public hpx::functional::detail::tag_fallback<when_all_t>

Friends

template<typename ...Senders>
friend constexpr auto tag_fallback_invoke(when_all_t, Senders&&... senders)
namespace hpx
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::chrono::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.

namespace hpx
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.

namespace hpx
namespace parallel
namespace execution

Variables

hpx::parallel::execution::has_pending_closures_t has_pending_closures
hpx::parallel::execution::get_pu_mask_t get_pu_mask
hpx::parallel::execution::set_scheduler_mode_t set_scheduler_mode
struct get_pu_mask_t : public hpx::functional::detail::tag_fallback<get_pu_mask_t>
#include <execution_information.hpp>

Retrieve the bitmask describing the processing units the given thread is allowed to run on

All threads::executors invoke sched.get_pu_mask().

Note

If the executor does not support this operation, this call will always invoke hpx::threads::get_pu_mask()

Parameters
  • exec: [in] The executor object to use for querying the number of pending tasks.

  • topo: [in] The topology object to use to extract the requested information.

  • thream_num: [in] The sequence number of the thread to retrieve information for.

Private Functions

template<typename Executor>
decltype(auto) friend tag_fallback_invoke(get_pu_mask_t, Executor&&, threads::topology &topo, std::size_t thread_num)
template<typename Executor>
decltype(auto) friend tag_invoke(get_pu_mask_t, Executor &&exec, threads::topology &topo, std::size_t thread_num)
struct has_pending_closures_t : public hpx::functional::detail::tag_fallback<has_pending_closures_t>
#include <execution_information.hpp>

Retrieve whether this executor has operations pending or not.

Note

If the executor does not expose this information, this call will always return false

Parameters
  • exec: [in] The executor object to use to extract the requested information for.

Private Functions

template<typename Executor>
decltype(auto) friend tag_fallback_invoke(has_pending_closures_t, Executor&&)
template<typename Executor>
decltype(auto) friend tag_invoke(has_pending_closures_t, Executor &&exec)
struct set_scheduler_mode_t : public hpx::functional::detail::tag_fallback<set_scheduler_mode_t>
#include <execution_information.hpp>

Set various modes of operation on the scheduler underneath the given executor.

Note

This calls exec.set_scheduler_mode(mode) if it exists; otherwise it does nothing.

Parameters
  • exec: [in] The executor object to use.

  • mode: [in] The new mode for the scheduler to pick up

Friends

template<typename Executor, typename Mode>
void tag_fallback_invoke(set_scheduler_mode_t, Executor&&, Mode const&)
template<typename Executor, typename Mode>
void tag_invoke(set_scheduler_mode_t, Executor &&exec, Mode const &mode)
namespace hpx
namespace parallel
namespace execution

Functions

template<typename ...Params>
constexpr executor_parameters_join<Params...>::type join_executor_parameters(Params&&... params)
template<typename Param>
constexpr Param &&join_executor_parameters(Param &&param)
template<typename ...Params>
struct executor_parameters_join

Public Types

template<>
using type = detail::executor_parameters<std::decay_t<Params>...>
template<typename Param>
struct executor_parameters_join<Param>

Public Types

template<>
using type = Param
namespace hpx
namespace parallel
namespace execution

Variables

hpx::parallel::execution::get_chunk_size_t get_chunk_size
hpx::parallel::execution::maximal_number_of_chunks_t maximal_number_of_chunks
hpx::parallel::execution::reset_thread_distribution_t reset_thread_distribution
hpx::parallel::execution::processing_units_count_t processing_units_count
hpx::parallel::execution::with_processing_units_count_t with_processing_units_count
hpx::parallel::execution::mark_begin_execution_t mark_begin_execution
hpx::parallel::execution::mark_end_of_scheduling_t mark_end_of_scheduling
hpx::parallel::execution::mark_end_execution_t mark_end_execution
struct get_chunk_size_t : public hpx::functional::detail::tag_fallback<get_chunk_size_t>
#include <execution_parameters_fwd.hpp>

Return the number of invocations of the given function f which should be combined into a single task

Note

The parameter f is expected to be a nullary function returning a std::size_t representing the number of iteration the function has already executed (i.e. which don’t have to be scheduled anymore).

Parameters
  • params: [in] The executor parameters object to use for determining the chunk size for the given number of tasks num_tasks.

  • exec: [in] The executor object which will be used for scheduling of the loop iterations.

  • f: [in] The function which will be optionally scheduled using the given executor.

  • cores: [in] The number of cores the number of chunks should be determined for.

  • num_tasks: [in] The number of tasks the chunk size should be determined for

Private Functions

template<typename Parameters, typename Executor, typename F>
decltype(auto) friend tag_fallback_invoke(get_chunk_size_t, Parameters &&params, Executor &&exec, F &&f, std::size_t cores, std::size_t num_tasks)
struct mark_begin_execution_t : public hpx::functional::detail::tag_fallback<mark_begin_execution_t>
#include <execution_parameters_fwd.hpp>

Mark the begin of a parallel algorithm execution

Note

This calls params.mark_begin_execution(exec) if it exists; otherwise it does nothing.

Parameters
  • params: [in] The executor parameters object to use as a fallback if the executor does not expose

Private Functions

template<typename Parameters, typename Executor>
decltype(auto) friend tag_fallback_invoke(mark_begin_execution_t, Parameters &&params, Executor &&exec)
struct mark_end_execution_t : public hpx::functional::detail::tag_fallback<mark_end_execution_t>
#include <execution_parameters_fwd.hpp>

Mark the end of a parallel algorithm execution

Note

This calls params.mark_end_execution(exec) if it exists; otherwise it does nothing.

Parameters
  • params: [in] The executor parameters object to use as a fallback if the executor does not expose

Private Functions

template<typename Parameters, typename Executor>
decltype(auto) friend tag_fallback_invoke(mark_end_execution_t, Parameters &&params, Executor &&exec)
struct mark_end_of_scheduling_t : public hpx::functional::detail::tag_fallback<mark_end_of_scheduling_t>
#include <execution_parameters_fwd.hpp>

Mark the end of scheduling tasks during parallel algorithm execution

Note

This calls params.mark_begin_execution(exec) if it exists; otherwise it does nothing.

Parameters
  • params: [in] The executor parameters object to use as a fallback if the executor does not expose

Private Functions

template<typename Parameters, typename Executor>
decltype(auto) friend tag_fallback_invoke(mark_end_of_scheduling_t, Parameters &&params, Executor &&exec)
struct maximal_number_of_chunks_t : public hpx::functional::detail::tag_fallback<maximal_number_of_chunks_t>
#include <execution_parameters_fwd.hpp>

Return the largest reasonable number of chunks to create for a single algorithm invocation.

Parameters
  • params: [in] The executor parameters object to use for determining the number of chunks for the given number of cores.

  • exec: [in] The executor object which will be used for scheduling of the loop iterations.

  • cores: [in] The number of cores the number of chunks should be determined for.

  • num_tasks: [in] The number of tasks the chunk size should be determined for

Private Functions

template<typename Parameters, typename Executor>
decltype(auto) friend tag_fallback_invoke(maximal_number_of_chunks_t, Parameters &&params, Executor &&exec, std::size_t cores, std::size_t num_tasks)
struct processing_units_count_t : public hpx::functional::detail::tag_fallback<processing_units_count_t>
#include <execution_parameters_fwd.hpp>

Retrieve the number of (kernel-)threads used by the associated executor.

Note

This calls params.processing_units_count(Executor&&) if it exists; otherwise it forwards the request to the executor parameters object.

Parameters
  • params: [in] The executor parameters object to use as a fallback if the executor does not expose

Private Functions

template<typename Parameters, typename Executor>
decltype(auto) friend tag_fallback_invoke(processing_units_count_t, Parameters &&params, Executor &&exec)
struct reset_thread_distribution_t : public hpx::functional::detail::tag_fallback<reset_thread_distribution_t>
#include <execution_parameters_fwd.hpp>

Reset the internal round robin thread distribution scheme for the given executor.

Note

This calls params.reset_thread_distribution(exec) if it exists; otherwise it does nothing.

Parameters
  • params: [in] The executor parameters object to use for resetting the thread distribution scheme.

  • exec: [in] The executor object to use.

Private Functions

template<typename Parameters, typename Executor>
decltype(auto) friend tag_fallback_invoke(reset_thread_distribution_t, Parameters &&params, Executor &&exec)
struct with_processing_units_count_t : public hpx::functional::detail::tag_fallback<with_processing_units_count_t>
#include <execution_parameters_fwd.hpp>

Generate a policy that supports setting the number of cores for execution.

namespace hpx
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.

namespace hpx
namespace execution
struct num_cores
#include <num_cores.hpp>

Control number of cores in executors which need a functionality for setting the number of cores to be used by an algorithm directly

Public Functions

constexpr num_cores(std::size_t cores = 1)

Construct a num_cores executor parameters object

Note

make sure the minimal number of cores is 1

namespace hpx
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::chrono::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::chrono::steady_duration const &time_cs, hpx::chrono::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.

namespace hpx
namespace parallel
namespace execution
template<typename R, typename ...Ts>
class polymorphic_executor<R(Ts...)> : private hpx::parallel::execution::detail::polymorphic_executor_base

Public Types

template<typename T>
using future_type = hpx::future<R>

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, typename PE = typename std::decay<Exec>::type, typename Enable = typename std::enable_if<!std::is_same<PE, polymorphic_executor>::value>::type>
polymorphic_executor(Exec &&exec)
template<typename Exec, typename PE = typename std::decay<Exec>::type, typename Enable = typename std::enable_if<!std::is_same<PE, polymorphic_executor>::value>::type>
polymorphic_executor &operator=(Exec &&exec)
void reset()
template<typename F>
void post(F &&f, Ts... ts) const
template<typename F>
R sync_execute(F &&f, Ts... ts) const
template<typename F>
hpx::future<R> async_execute(F &&f, Ts... ts) const
template<typename F, typename Future>
hpx::future<R> then_execute(F &&f, Future &&predecessor, Ts&&... ts) const
template<typename F, typename Shape>
std::vector<R> bulk_sync_execute(F &&f, Shape const &s, Ts&&... ts) const
template<typename F, typename Shape>
std::vector<hpx::future<R>> bulk_async_execute(F &&f, Shape const &s, Ts&&... ts) const
template<typename F, typename Shape>
hpx::future<std::vector<R>> bulk_then_execute(F &&f, Shape const &s, hpx::shared_future<void> const &predecessor, Ts&&... ts) const

Private Types

template<>
using base_type = detail::polymorphic_executor_base
template<>
using vtable = detail::polymorphic_executor_vtable<R(Ts...)>

Private Functions

void assign(std::nullptr_t)
template<typename Exec>
void assign(Exec &&exec)

Private Static Functions

static constexpr vtable const *get_empty_vtable()
template<typename T>
static constexpr vtable const *get_vtable()
namespace hpx
namespace parallel
namespace execution

Variables

constexpr create_rebound_policy_t create_rebound_policy = {}
struct create_rebound_policy_t

Public Functions

template<typename ExPolicy, typename Executor, typename Parameters>
constexpr decltype(auto) operator()(ExPolicy&&, Executor &&exec, Parameters &&parameters) const
template<typename ExPolicy, typename Executor, typename Parameters>
struct rebind_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

template<>
using type = typename policy_type::template rebind::type

The type of the rebound execution policy.

namespace hpx
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.

namespace hpx
namespace execution
namespace experimental

Functions

constexpr auto tag_fallback_invoke(get_allocator_t)

Variables

hpx::execution::experimental::get_allocator_t get_allocator
struct get_allocator_t : public hpx::functional::detail::tag_fallback<get_allocator_t>

Friends

friend constexpr auto tag_fallback_invoke(get_allocator_t)
namespace hpx
namespace execution
namespace experimental

Functions

constexpr auto tag_fallback_invoke(get_delegatee_scheduler_t)

Variables

hpx::execution::experimental::get_delegatee_scheduler_t get_delegatee_scheduler
struct get_delegatee_scheduler_t : public hpx::functional::detail::tag_fallback<get_delegatee_scheduler_t>

Friends

friend constexpr auto tag_fallback_invoke(get_delegatee_scheduler_t)
namespace hpx
namespace execution
namespace experimental

Functions

constexpr auto tag_fallback_invoke(get_scheduler_t)

Variables

hpx::execution::experimental::get_scheduler_t get_scheduler
struct get_scheduler_t : public hpx::functional::detail::tag_fallback<get_scheduler_t>

Friends

friend constexpr auto tag_fallback_invoke(get_scheduler_t)
namespace hpx
namespace execution
namespace experimental

Typedefs

template<typename T>
using stop_token_of_t = std::remove_cv_t<std::remove_reference_t<decltype(get_stop_token(std::declval<T>()))>>

Functions

constexpr auto tag_fallback_invoke(get_stop_token_t)

Variables

hpx::execution::experimental::get_stop_token_t get_stop_token
struct get_stop_token_t : public hpx::functional::detail::tag_fallback<get_stop_token_t>

Friends

template<typename Env>
friend constexpr auto tag_fallback_invoke(get_stop_token_t, Env&&)
friend constexpr auto tag_fallback_invoke(get_stop_token_t)
namespace hpx
namespace execution
namespace experimental

Variables

hpx::execution::experimental::read_t read
struct read_t : public hpx::functional::tag<read_t>

Friends

template<typename Tag>
friend constexpr auto tag_invoke(read_t, Tag)
namespace hpx
namespace parallel
namespace execution

Typedefs

template<typename Executor, typename T, typename ...Ts>
using executor_future_t = typename executor_future<Executor, T, Ts...>::type
template<typename Executor>
struct executor_context

Public Types

template<>
using type = std::decay_t<decltype(std::declval<Executor const&>().context())>
template<typename Executor>
struct executor_execution_category

Public Types

template<>
using type = hpx::util::detected_or_t<hpx::execution::unsequenced_execution_tag, execution_category, Executor>

Private Types

template<typename T>
using execution_category = typename T::execution_category
template<typename Executor>
struct executor_index

Public Types

template<>
using type = hpx::util::detected_or_t<typename executor_shape<Executor>::type, index_type, Executor>

Private Types

template<typename T>
using index_type = typename T::index_type
template<typename Executor>
struct executor_parameters_type

Public Types

template<>
using type = hpx::util::detected_or_t<hpx::execution::static_chunk_size, parameters_type, Executor>

Private Types

template<typename T>
using parameters_type = typename T::parameters_type
template<typename Executor>
struct executor_shape

Public Types

template<>
using type = hpx::util::detected_or_t<std::size_t, shape_type, Executor>

Private Types

template<typename T>
using shape_type = typename T::shape_type
namespace traits

Typedefs

template<typename Executor>
using executor_context_t = typename executor_context<Executor>::type
template<typename Executor>
using executor_execution_category_t = typename executor_execution_category<Executor>::type
template<typename Executor>
using executor_shape_t = typename executor_shape<Executor>::type
template<typename Executor>
using executor_index_t = typename executor_index<Executor>::type
template<typename Executor, typename T, typename ...Ts>
using executor_future_t = typename executor_future<Executor, T, Ts...>::type
template<typename Executor>
using executor_parameters_type_t = typename executor_parameters_type<Executor>::type

Variables

template<typename T>
constexpr bool has_post_member_v = has_post_member<T>::value
template<typename T>
constexpr bool has_sync_execute_member_v = has_sync_execute_member<T>::value
template<typename T>
constexpr bool has_async_execute_member_v = has_async_execute_member<T>::value
template<typename T>
constexpr bool has_then_execute_member_v = has_then_execute_member<T>::value
template<typename T>
constexpr bool has_bulk_sync_execute_member_v = has_bulk_sync_execute_member<T>::value
template<typename T>
constexpr bool has_bulk_async_execute_member_v = has_bulk_async_execute_member<T>::value
template<typename T>
constexpr bool has_bulk_then_execute_member_v = has_bulk_then_execute_member<T>::value
namespace hpx
namespace traits

Typedefs

template<typename Executor, typename Future, typename F>
using future_then_executor_result_t = typename future_then_executor_result<Executor, Future, F>::type
namespace hpx

Variables

template<typename T>
constexpr bool is_execution_policy_v = is_execution_policy<T>::value
template<typename T>
constexpr bool is_parallel_execution_policy_v = is_parallel_execution_policy<T>::value
template<typename T>
constexpr bool is_sequenced_execution_policy_v = is_sequenced_execution_policy<T>::value
template<typename T>
constexpr bool is_async_execution_policy_v = is_async_execution_policy<T>::value
template<typename T>
struct is_async_execution_policy : public hpx::detail::is_async_execution_policy<std::decay<T>::type>
#include <is_execution_policy.hpp>

Extension: Detect whether given execution policy makes algorithms asynchronous

  1. 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.

  2. 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>.

  3. The behavior of a program that adds specializations for is_async_execution_policy is undefined.

template<typename T>
struct is_execution_policy : public hpx::detail::is_execution_policy<std::decay<T>::type>
#include <is_execution_policy.hpp>

  1. 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.

  2. 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>.

  3. The behavior of a program that adds specializations for is_execution_policy is undefined.

template<typename T>
struct is_parallel_execution_policy : public hpx::detail::is_parallel_execution_policy<std::decay<T>::type>
#include <is_execution_policy.hpp>

Extension: Detect whether given execution policy enables parallelization

  1. 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.

  2. 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>.

  3. The behavior of a program that adds specializations for is_parallel_execution_policy is undefined.

template<typename T>
struct is_sequenced_execution_policy : public hpx::detail::is_sequenced_execution_policy<std::decay<T>::type>
#include <is_execution_policy.hpp>

Extension: Detect whether given execution policy does not enable parallelization

  1. 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.

  2. 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>.

  3. The behavior of a program that adds specializations for is_sequenced_execution_policy is undefined.

namespace hpx
namespace parallel
namespace traits

Functions

std::size_t count_bits(bool value)