dispenso
A library for task parallelism
 
Loading...
Searching...
No Matches
graph_executor.h
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#pragma once
10#include <dispenso/detail/graph_executor_impl.h>
11#include <dispenso/graph.h>
13#include <dispenso/platform.h>
14
15namespace dispenso {
19class SingleThreadExecutor : public ::detail::ExecutorBase {
20 public:
26 template <typename G>
27 void operator()(const G& graph);
28
29 private:
30 std::vector<const Node*> nodesToExecute_;
31 std::vector<const Node*> nodesToExecuteNext_;
32};
37class ParallelForExecutor : public ::detail::ExecutorBase {
38 public:
45 template <typename TaskSetT, typename G>
46 void operator()(TaskSetT& taskSet, const G& graph);
47
48 private:
51};
56class ConcurrentTaskSetExecutor : public ::detail::ExecutorBase {
57 public:
65 template <typename G>
66 void operator()(dispenso::ConcurrentTaskSet& tasks, const G& graph, bool wait = true);
67
68 private:
69 std::vector<const Node*> startNodes_;
70};
71
75class ForwardPropagator : public ::detail::ExecutorBase {
76 public:
81 template <class G>
82 void operator()(const G& graph);
83
84 private:
85 template <class N>
86 void propagateIncompleteStateBidirectionally();
87
88 std::vector<const Node*> nodesToVisit_;
89 std::vector<const Node*> nodesToVisitNext_;
90 std::unordered_set<const Node*> visited_;
91 std::unordered_set<const std::vector<const BiPropNode*>*> groups_;
92};
93} // namespace dispenso
void operator()(dispenso::ConcurrentTaskSet &tasks, const G &graph, bool wait=true)
void operator()(const G &graph)
void operator()(TaskSetT &taskSet, const G &graph)
void operator()(const G &graph)
detail::OpResult< T > OpResult
Definition pipeline.h:29