|
| AbstractExecutionPipeline (std::shared_ptr< Graph< Separator, AllTypes... > > const graph, size_t const &numberGraphs, std::string const name="Execution pipeline") |
| Create an execution pipeline that duplicates a graph , numberGraphs - 1 times. The graph id and the device id associated to each graph are generated in sequence. The given name is "Execution pipeline" by default.
|
|
| AbstractExecutionPipeline (std::shared_ptr< Graph< Separator, AllTypes... > > const graph, std::vector< int > const &deviceIds, std::string const name="Execution pipeline") |
| Create an execution pipeline from a graph and the given device ids. If there are n device ids given, the graph will be duplicated n-1 times (for a total of n graphs), and each device ids will be associated to each graph. The given name is "Execution pipeline" by default.
|
|
| ~AbstractExecutionPipeline () override=default |
| Default destructor.
|
|
| Node (std::shared_ptr< hh::core::abstraction::NodeAbstraction > core) |
| Constructor's node.
|
|
virtual | ~Node ()=default |
| Default destructor.
|
|
std::shared_ptr< hh::core::abstraction::NodeAbstraction > const & | core () const |
| Core accessor.
|
|
std::string | name () const |
| Node's name accessor.
|
|
| Copyable (size_t const numberThreads) |
| Copyable constructor, set the number of threads for a node.
|
|
virtual | ~Copyable ()=default |
| Default destructor.
|
|
size_t | numberThreads () const |
| Number of threads accessor.
|
|
std::vector< AbstractExecutionPipeline< Separator, AllTypes... > const * > | group () const |
| Get the group of nodes that hold the current nodes.
|
|
virtual std::shared_ptr< AbstractExecutionPipeline< Separator, AllTypes... > > | copy () |
| Copy method called to either create a group of node or duplicate a node when an execution pipeline is created.
|
|
template<
size_t Separator, class ... AllTypes>
class hh::AbstractExecutionPipeline< Separator, AllTypes >
Execution pipeline abstraction.
Duplicate a graph with the same input and output types and associate each of the duplicates to a specified device id (GPU). If none is provided, the devices are generated in sequence (for 3 duplicates, 4 graphs total, the device ids are 0,1,2,3). When implementing, the switch rules need to be provided. They are used to redirect an input data sent to the execution pipeline to a specific graph. Each of the graphs inside an execution pipeline has an id (generated in sequence) used to discriminate the graphs in the switch rules. If the Execution pipeline is duplicated (because it is part of a graph which is also in another execution pipeline), the copy method needs to be implemented.
class IntFloatDoubleExecutionPipeline
public:
size_t const &numberGraphs)
~IntFloatDoubleExecutionPipeline() override = default;
bool sendToGraph(std::shared_ptr<int> &data, size_t const &graphId) override {
}
bool sendToGraph(std::shared_ptr<float> &data, size_t const &graphId) override {
}
bool sendToGraph(std::shared_ptr<double> &data, size_t const &graphId) override {
}
};
auto insideGraph = std::make_shared<hh::Graph<3, int, float, double, int, float, double>>();
auto innerInputInt = std::make_shared<IntFloatDoubleTask>();
auto innerTaskFloat = std::make_shared<IntFloatDoubleTask>();
auto innerOutput = std::make_shared<IntFloatDoubleTask>();
auto innerSM = std::make_shared<hh::StateManager<1, int, int>>(std::make_shared<IntState>());
auto innerGraph = std::make_shared<IntFloatDoubleGraph>();
insideGraph->input<int>(innerInputInt);
insideGraph->input<float>(innerTaskFloat);
insideGraph->inputs(innerSM);
insideGraph->inputs(innerGraph);
insideGraph->edges(innerInputInt, innerOutput);
insideGraph->edges(innerSM, innerOutput);
insideGraph->edges(innerTaskFloat, innerOutput);
insideGraph->outputs(innerOutput);
insideGraph->outputs(innerGraph);
auto ep = std::make_shared<IntFloatDoubleExecutionPipeline>(insideGraph, 5);
Execution pipeline abstraction.
Hedgehog graph abstraction.
- Attention
- The duplicated graph needs to be totally created before set to an execution pipeline, it won't be modifiable thereafter.
- Template Parameters
-
Separator | Separator position between input types and output types |
AllTypes | List of input and output types |
Definition at line 89 of file abstract_execution_pipeline.h.