Skip to content

Commit

Permalink
start to implement the label
Browse files Browse the repository at this point in the history
  • Loading branch information
lambda7xx committed Nov 4, 2023
1 parent 43d7a6e commit dde8733
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/utils/include/utils/graph/labelled/labelled_open.decl.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ struct LabelledOpenMultiDiGraph {
OutputLabel>() const;

operator OpenMultiDiGraphView() const;
operator LabelledOpenMultiDiGraphView() const;

friend void swap(LabelledOpenMultiDiGraph &lhs,
LabelledOpenMultiDiGraph &rhs) {
Expand Down Expand Up @@ -111,7 +112,7 @@ struct LabelledOpenMultiDiGraph {
create();

private:
LabelledOpenMultiDiGraph(cow_ptr_t<Interface> ptr);
LabelledOpenMultiDiGraph(cow_ptr_t<Interface> ptr): ptr(ptr) {}

private:
cow_ptr_t<Interface> ptr;
Expand Down
11 changes: 11 additions & 0 deletions lib/utils/include/utils/graph/labelled/unordered_labelled_graphs.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "output_labelled_interfaces.h"
#include "standard_labelled_interfaces.h"
#include "utils/graph/open_graphs.h"
#include "views.h"

namespace FlexFlow {

Expand Down Expand Up @@ -107,6 +108,16 @@ struct UnorderedLabelledOpenMultiDiGraph
this->add_edge(e);
this->output_map.insert({e, label});
}

void add_edge(InputMultiDiEdge const &e) {
OpenMultiDiEdge edge{e};
this->base_graph.add_edge(edge);
}

void add_edge(OutputMultiDiEdge const &e) {
OpenMultiDiEdge edge{e};
this->base_graph.add_edge(edge);
}

InputLabel const &at(InputMultiDiEdge const &e) const {
return this->input_map.at(e);
Expand Down

0 comments on commit dde8733

Please sign in to comment.