Imported Upstream version 1.7.0
[platform/core/ml/nnfw.git] / runtime / onert / core / include / ir / OpSequences.h
index 2af9579..6ed8499 100644 (file)
@@ -36,11 +36,10 @@ public:
    * @brief Create an instance of OpSequence with given op and push it to objects
    *
    * @param[in] op_idx Operation index that is emplaced
-   * @param[in] op Operation that is emplaced
    * @param[in] layout OpSequence's layout
    * @return OpSequenceIndex
    */
-  OpSequenceIndex emplace(const OperationIndex &op_index, const Operation &op, Layout layout);
+  OpSequenceIndex emplace(const OperationIndex &op_index, Layout layout);
 
   /**
    * @brief Push an instance of OpSequence to objects
@@ -49,7 +48,6 @@ public:
    * @return OpSequenceIndex
    */
   OpSequenceIndex emplace(std::unique_ptr<OpSequence> &&op_seq);
-
   /**
    * @brief Check if an operation does exist in any OpSequences
    *
@@ -68,8 +66,9 @@ public:
    * @brief Dump OpSequences
    *
    * @param msg Message that will be displayed
+   * @param graph Graph that has information used for dump
    */
-  void dump(const std::string &msg) const;
+  void dump(const std::string &msg, const Operations &operations) const;
   /**
    * @brief Remove an operation from OpSequence
    *
@@ -78,7 +77,11 @@ public:
   void removeFromOpSequence(const OperationIndex &operation_index);
 
 private:
+  void cacheSequenceIndex(const OpSequenceIndex &seq_index, const OperationIndex &op_index) const;
+  OpSequenceIndex *findSequenceIndex(const OperationIndex &operation_index) const;
+
   OpSequenceIndex findOperation(const OperationIndex &operation_index) const;
+  mutable std::unordered_map<OperationIndex, OpSequenceIndex> _seq_indexes;
 };
 
 } // namespace ir