dispenso 1.4.1
A library for task parallelism
Loading...
Searching...
No Matches
graph_executor.h
Go to the documentation of this file.
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
14#pragma once
16#include <dispenso/detail/graph_executor_impl.h>
17#include <dispenso/graph.h>
19#include <dispenso/platform.h>
20
21namespace dispenso {
25class SingleThreadExecutor : public ::detail::ExecutorBase {
26 public:
32 template <typename G>
33 void operator()(const G& graph);
34
35 private:
36 std::vector<const Node*> nodesToExecute_;
37 std::vector<const Node*> nodesToExecuteNext_;
38};
43class ParallelForExecutor : public ::detail::ExecutorBase {
44 public:
51 template <typename TaskSetT, typename G>
52 void operator()(TaskSetT& taskSet, const G& graph);
53
54 private:
57};
62class ConcurrentTaskSetExecutor : public ::detail::ExecutorBase {
63 public:
71 template <typename G>
72 void operator()(dispenso::ConcurrentTaskSet& tasks, const G& graph, bool wait = true);
73
74 private:
75 std::vector<const Node*> startNodes_;
76};
77
81class ForwardPropagator : public ::detail::ExecutorBase {
82 public:
87 template <class G>
88 void operator()(const G& graph);
89
90 private:
91 template <class N>
92 void propagateIncompleteStateBidirectionally();
93
94 std::vector<const Node*> nodesToVisit_;
95 std::vector<const Node*> nodesToVisitNext_;
96 std::unordered_set<const Node*> visited_;
97 std::unordered_set<const std::vector<const BiPropNode*>*> groups_;
98};
99} // 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)