hpx/execution_base/execution.hpp¶
See Public API for a list of names and headers that are part of the public HPX API.
-
namespace
hpx
Variables
-
hpx::sync_execute_t
sync_execute
¶
-
hpx::async_execute_t
async_execute
¶
-
hpx::then_execute_t
then_execute
¶
-
hpx::bulk_sync_execute_t
bulk_sync_execute
¶
-
hpx::bulk_async_execute_t
bulk_async_execute
¶
-
hpx::bulk_then_execute_t
bulk_then_execute
¶
-
struct
async_execute_t
: public hpx::functional::detail::tag_fallback<async_execute_t>¶ - #include <execution.hpp>
Customization point for asynchronous execution agent creation.
This asynchronously creates a single function invocation f() using the associated executor.
- Note
Executors have to implement only
async_execute()
. All other functions will be emulated by this or other customization points in terms of this single basic primitive. However, some executors will naturally specialize all operations for maximum efficiency.- Note
This is valid for one way executors (calls make_ready_future(exec.sync_execute(f, ts…) if it exists) and for two way executors (calls exec.async_execute(f, ts…) if it exists).
- Return
f(ts…)’s result through a future
- Parameters
exec
: [in] The executor object to use for scheduling of the function f.f
: [in] The function which will be scheduled using the given executor.ts
: [in] Additional arguments to use to invoke f.
Private Functions
-
template<typename
Executor
, typenameF
, typename ...Ts
>
decltype(auto) friendtag_fallback_invoke
(async_execute_t, Executor &&exec, F &&f, Ts&&... ts)¶
-
struct
bulk_async_execute_t
: public hpx::functional::detail::tag_fallback<bulk_async_execute_t>¶ - #include <execution.hpp>
Bulk form of asynchronous execution agent creation.
This asynchronously creates a group of function invocations f(i) whose ordering is given by the execution_category associated with the executor.
- Note
This is deliberately different from the bulk_async_execute customization points specified in P0443.The bulk_async_execute customization point defined here is more generic and is used as the workhorse for implementing the specified APIs.
Here i takes on all values in the index space implied by shape. All exceptions thrown by invocations of f(i) are reported in a manner consistent with parallel algorithm execution through the returned future.
- Return
The return type of executor_type::bulk_async_execute if defined by executor_type. Otherwise a vector of futures holding the returned values of each invocation of f.
- Note
This calls exec.bulk_async_execute(f, shape, ts…) if it exists; otherwise it executes async_execute(f, shape, ts…) as often as needed.
- Parameters
exec
: [in] The executor object to use for scheduling of the function f.f
: [in] The function which will be scheduled using the given executor.shape
: [in] The shape objects which defines the iteration boundaries for the arguments to be passed to f.ts
: [in] Additional arguments to use to invoke f.
Private Functions
-
template<typename
Executor
, typenameF
, typenameShape
, typename ...Ts
>
decltype(auto) friendtag_fallback_invoke
(bulk_async_execute_t, Executor &&exec, F &&f, Shape const &shape, Ts&&... ts)¶
-
template<typename
Executor
, typenameF
, typenameShape
, typename ...Ts
>
decltype(auto) friendtag_fallback_invoke
(bulk_async_execute_t, Executor &&exec, F &&f, Shape const &shape, Ts&&... ts)
-
struct
bulk_sync_execute_t
: public hpx::functional::detail::tag_fallback<bulk_sync_execute_t>¶ - #include <execution.hpp>
Bulk form of synchronous execution agent creation.
This synchronously creates a group of function invocations f(i) whose ordering is given by the execution_category associated with the executor. The function synchronizes the execution of all scheduled functions with the caller.
- Note
This is deliberately different from the bulk_sync_execute customization points specified in P0443.The bulk_sync_execute customization point defined here is more generic and is used as the workhorse for implementing the specified APIs.
Here i takes on all values in the index space implied by shape. All exceptions thrown by invocations of f(i) are reported in a manner consistent with parallel algorithm execution through the returned future.
- Return
The return type of executor_type::bulk_sync_execute if defined by executor_type. Otherwise a vector holding the returned values of each invocation of f except when f returns void, which case void is returned.
- Note
This calls exec.bulk_sync_execute(f, shape, ts…) if it exists; otherwise it executes sync_execute(f, shape, ts…) as often as needed.
- Parameters
exec
: [in] The executor object to use for scheduling of the function f.f
: [in] The function which will be scheduled using the given executor.shape
: [in] The shape objects which defines the iteration boundaries for the arguments to be passed to f.ts
: [in] Additional arguments to use to invoke f.
Private Functions
-
template<typename
Executor
, typenameF
, typenameShape
, typename ...Ts
>
decltype(auto) friendtag_fallback_invoke
(bulk_sync_execute_t, Executor &&exec, F &&f, Shape const &shape, Ts&&... ts)¶
-
template<typename
Executor
, typenameF
, typenameShape
, typename ...Ts
>
decltype(auto) friendtag_fallback_invoke
(bulk_sync_execute_t, Executor &&exec, F &&f, Shape const &shape, Ts&&... ts)
-
struct
bulk_then_execute_t
: public hpx::functional::detail::tag_fallback<bulk_then_execute_t>¶ - #include <execution.hpp>
Bulk form of execution agent creation depending on a given future.
This creates a group of function invocations f(i) whose ordering is given by the execution_category associated with the executor.
- Note
This is deliberately different from the then_sync_execute customization points specified in P0443.The bulk_then_execute customization point defined here is more generic and is used as the workhorse for implementing the specified APIs.
Here i takes on all values in the index space implied by shape. All exceptions thrown by invocations of f(i) are reported in a manner consistent with parallel algorithm execution through the returned future.
- Return
The return type of executor_type::bulk_then_execute if defined by executor_type. Otherwise a vector holding the returned values of each invocation of f.
- Note
This calls exec.bulk_then_execute(f, shape, pred, ts…) if it exists; otherwise it executes sync_execute(f, shape, pred.share(), ts…) (if this executor is also an OneWayExecutor), or async_execute(f, shape, pred.share(), ts…) (if this executor is also a TwoWayExecutor) - as often as needed.
- Parameters
exec
: [in] The executor object to use for scheduling of the function f.f
: [in] The function which will be scheduled using the given executor.shape
: [in] The shape objects which defines the iteration boundaries for the arguments to be passed to f.predecessor
: [in] The future object the execution of the given function depends on.ts
: [in] Additional arguments to use to invoke f.
-
struct
post_t
: public hpx::functional::detail::tag_fallback<post_t>¶ - #include <execution.hpp>
Customization point for asynchronous fire & forget execution agent creation.
This asynchronously (fire & forget) creates a single function invocation f() using the associated executor.
- Note
This is valid for two way executors (calls exec.post(f, ts…), if available, otherwise it calls exec.async_execute(f, ts…) while discarding the returned future), and for non-blocking two way executors (calls exec.post(f, ts…) if it exists).
- Parameters
exec
: [in] The executor object to use for scheduling of the function f.f
: [in] The function which will be scheduled using the given executor.ts
: [in] Additional arguments to use to invoke f.
-
struct
sync_execute_t
: public hpx::functional::detail::tag_fallback<sync_execute_t>¶ - #include <execution.hpp>
Customization point for synchronous execution agent creation.
This synchronously creates a single function invocation f() using the associated executor. The execution of the supplied function synchronizes with the caller
- Return
f(ts…)’s result
- Note
This is valid for one way executors only, it will call exec.sync_execute(f, ts…) if it exists.
- Parameters
exec
: [in] The executor object to use for scheduling of the function f.f
: [in] The function which will be scheduled using the given executor.ts
: [in] Additional arguments to use to invoke f.
Private Functions
-
template<typename
Executor
, typenameF
, typename ...Ts
>
decltype(auto) friendtag_fallback_invoke
(sync_execute_t, Executor &&exec, F &&f, Ts&&... ts)¶
-
struct
then_execute_t
: public hpx::functional::detail::tag_fallback<then_execute_t>¶ - #include <execution.hpp>
Customization point for execution agent creation depending on a given future.
This creates a single function invocation f() using the associated executor after the given future object has become ready.
- Return
f(ts…)’s result through a future
- Note
This is valid for two way executors (calls exec.then_execute(f, predecessor, ts…) if it exists) and for one way executors (calls predecessor.then(bind(f, ts…))).
- Parameters
exec
: [in] The executor object to use for scheduling of the function f.f
: [in] The function which will be scheduled using the given executor.predecessor
: [in] The future object the execution of the given function depends on.ts
: [in] Additional arguments to use to invoke f.
-
namespace
execution
-
struct
parallel_execution_tag
¶ - #include <execution.hpp>
Function invocations executed by a group of parallel execution agents execute in unordered fashion. Any such invocations executing in the same thread are indeterminately sequenced with respect to each other.
- Note
parallel_execution_tag is weaker than sequenced_execution_tag.
-
struct
sequenced_execution_tag
¶ - #include <execution.hpp>
Function invocations executed by a group of sequential execution agents execute in sequential order.
-
struct
unsequenced_execution_tag
¶ - #include <execution.hpp>
Function invocations executed by a group of vector execution agents are permitted to execute in unordered fashion when executed in different threads, and un-sequenced with respect to one another when executed in the same thread.
- Note
unsequenced_execution_tag is weaker than parallel_execution_tag.
-
struct
-
hpx::sync_execute_t