20 #ifndef HEDGEHOG_ABSTRACT_EXECUTION_PIPELINE_H 21 #define HEDGEHOG_ABSTRACT_EXECUTION_PIPELINE_H 25 #include "../core/defaults/core_default_execution_pipeline.h" 96 template<
class GraphOutput,
class ...GraphInputs>
101 static_assert(traits::isUnique<GraphInputs...>,
"A node can't accept multiple inputs with the same type.");
102 static_assert(
sizeof... (GraphInputs) >= 1,
"A node need to have one output type and at least one output type.");
104 std::shared_ptr<
Graph<GraphOutput, GraphInputs...>>
124 size_t const &numberGraphDuplications,
126 std::vector<int> deviceIds(numberGraphDuplications, 0);
127 if (iota) { std::iota(deviceIds.begin(), deviceIds.end(), 0); }
130 "AbstractExecutionPipeline",
this,
132 numberGraphDuplications, deviceIds,
false);
144 size_t const &numberGraphDuplications,
145 std::vector<int>
const deviceIds,
bool automaticStart =
false)
148 "AbstractExecutionPipeline",
150 std::dynamic_pointer_cast<
core::CoreGraph<GraphOutput, GraphInputs...>>(
graph->
core()),
151 numberGraphDuplications,
152 deviceIds, automaticStart)) {}
165 size_t const &numberGraphDuplications,
166 std::vector<int>
const &deviceIds,
167 bool automaticStart =
false)
172 std::dynamic_pointer_cast<
core::CoreGraph<GraphOutput, GraphInputs...>>(
graph->
core()),
173 numberGraphDuplications,
187 std::shared_ptr<
Graph<GraphOutput, GraphInputs...>>
const &
graph()
const {
return graph_; }
191 #endif //HEDGEHOG_ABSTRACT_EXECUTION_PIPELINE_H std::shared_ptr< Graph< GraphOutput, GraphInputs... > > graph_
Original Graph that will be duplicated.
virtual ~AbstractExecutionPipeline()=default
Default destructor.
Sender Behavior definition, node has an output type.
Node core for the default execution pipeline.
Node interface made for duplicating a graph, for example in the case of multi-GPU computation...
std::shared_ptr< core::CoreDefaultExecutionPipeline< GraphOutput, GraphInputs... > > coreExecutionPipeline_
Execution Pipeline core.
AbstractExecutionPipeline(std::shared_ptr< Graph< GraphOutput, GraphInputs... >> graph, size_t const &numberGraphDuplications, bool iota=false)
Constructor to set an execution pipeline with a graph and the total number of graphs.
std::shared_ptr< Graph< GraphOutput, GraphInputs... > > const & graph() const
Inner graph accessor.
Main Hedgehog object that does computation.
AbstractExecutionPipeline()=delete
Deleted default constructor, an execution pipeline need to be constructed with a compatible graph...
MultiReceivers Behavior definition, node has a list of input types.
std::shared_ptr< core::CoreNode > core() override
Execution Pipeline accessor core.
AbstractExecutionPipeline(std::shared_ptr< Graph< GraphOutput, GraphInputs... >> graph, size_t const &numberGraphDuplications, std::vector< int > const deviceIds, bool automaticStart=false)
Constructor to set an execution pipeline with a graph, the total number of graphs, the device Ids, and set the execution to automatically start.
Core associated to the Graph.
AbstractExecutionPipeline(std::string_view const &name, std::shared_ptr< Graph< GraphOutput, GraphInputs... >> const &graph, size_t const &numberGraphDuplications, std::vector< int > const &deviceIds, bool automaticStart=false)
Constructor to set an execution pipeline with a graph, the total number of graphs, the device Ids and set the execution to automatically start.
Behavior definition for dispatching data to a Graph managed by an AbstractExecutionPipeline.