Class Executor¶
Defined in File executor.hpp
Class Documentation¶
-
class
ripple
::
Executor
¶ The Executor class maintains a pool of threads, which maintain a queue of nodes which can be executed by the workers.
Each node defines work to be executed and connecetivity information which defines its dependencies between other nodes.
Public Functions
-
auto
set_steal_policy
(StealPolicy policy) noexcept -> void¶ Sets the stealing policy for the executor.
- See
- Parameters
policy
: The policy to use for stealing nodes.
-
auto
execute
(Graph &graph) noexcept -> void¶ Executes a graph.
This emplaced all nodes using this thread while other threads start stealing.
- Parameters
graph
: The graph to execute.
-
auto
execute_n
(Graph &graph, size_t n) noexcept -> void¶ Executes the graph n times.
- Parameters
graph
: The graph to execute.n
: The number of times to execute the graph.
-
template<typename
Pred
, typename ...Args
>
autoexecute_until
(Graph &graph, Pred &&pred, Args&&... args) noexcept -> void¶ Executes the graph until the predicate returns false.
- Parameters
graph
: The graph to execute.pred
: The predicate which returns if the execution must end.args
: The arguments for the predicate.
- Template Parameters
Pred
: The type of the predicate.Args
: The type of the predicate arguments.
-
auto
barrier
() noexcept -> void¶ Creates a fence, waiting for all threads to finish execution, synchronizing the gpu work.
-
auto
fence
() noexcept -> void¶ Creates a fence, waiting for all threads to finish execution, synchronizing the gpu work.
-
auto
num_executed_nodes
() const noexcept -> uint32_t¶ Gets the number of nodes which have executed.
-
auto
has_unfinished_work
() noexcept -> bool¶ Determines if there is unfinished work to be executed.
- Return
true if there is unfinished work.
-
auto
set_active_threads
(int cpu_threads, int gpu_threads) noexcept -> void¶ Sets the number of active gpu threads.
- Parameters
cpu_threads
: The number of threads with cpu priority.gpu_threads
: The number of threads with gpu priority.
-
auto