1 /** 2 * Copyright 2021 Huawei Technologies Co., Ltd 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 #ifndef MINDSPORE_CCSRC_DEBUG_RDR_GRAPH_EXEC_ORDER_RECORDER_H_ 17 #define MINDSPORE_CCSRC_DEBUG_RDR_GRAPH_EXEC_ORDER_RECORDER_H_ 18 #include <vector> 19 #include <string> 20 #include <memory> 21 22 #include "debug/rdr/base_recorder.h" 23 24 namespace mindspore { 25 class CNode; 26 using CNodePtr = std::shared_ptr<CNode>; 27 class GraphExecOrderRecorder : public BaseRecorder { 28 public: GraphExecOrderRecorder()29 GraphExecOrderRecorder() : BaseRecorder() {} GraphExecOrderRecorder(const std::string & module,const std::string & name,const std::vector<CNodePtr> & final_exec_order)30 GraphExecOrderRecorder(const std::string &module, const std::string &name, 31 const std::vector<CNodePtr> &final_exec_order) 32 : BaseRecorder(module, name), exec_order_(final_exec_order) {} ~GraphExecOrderRecorder()33 ~GraphExecOrderRecorder() {} SetExecOrder(const std::vector<CNodePtr> & final_exec_order)34 void SetExecOrder(const std::vector<CNodePtr> &final_exec_order) { exec_order_ = final_exec_order; } 35 virtual void Export(); 36 37 private: 38 std::vector<CNodePtr> exec_order_; 39 }; 40 using GraphExecOrderRecorderPtr = std::shared_ptr<GraphExecOrderRecorder>; 41 } // namespace mindspore 42 #endif // MINDSPORE_CCSRC_DEBUG_RDR_GRAPH_EXEC_ORDER_RECORDER_H_ 43