// Copyright (c) OpenMMLab. All rights reserved. #ifndef MMDEPLOY_CSRC_EXPERIMENTAL_EXECUTION_PIPELINE2_H_ #define MMDEPLOY_CSRC_EXPERIMENTAL_EXECUTION_PIPELINE2_H_ #include #include "core/graph.h" #include "core/module.h" #include "core/operator.h" #include "core/value.h" #include "execution/schedulers/registry.h" #include "execution/when_all_value.h" namespace mmdeploy::graph { class Pipeline : public Node { friend class PipelineParser; public: Sender Process(Sender args) override; struct Coords { // source node index int index; // source output port -> destination input port mapping vector> mapping; }; class State; private: vector> nodes_; vector use_count_; vector> input_coords_; vector ret_coords_; }; class PipelineParser { public: Result> Parse(const Value& config); private: Result> GetInputCoords(const vector& names); Result UpdateOutputCoords(int index, const vector& names); // use count for each node's output vector use_count_; // name -> (node_id, port_id) std::map> output_name_to_coords_; }; } // namespace mmdeploy::graph #endif // MMDEPLOY_CSRC_EXPERIMENTAL_EXECUTION_PIPELINE2_H_