• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 "include/common/debug/rdr/base_recorder.h"
23 
24 namespace mindspore {
25 class GraphExecOrderRecorder : public BaseRecorder {
26  public:
GraphExecOrderRecorder()27   GraphExecOrderRecorder() : BaseRecorder() {}
GraphExecOrderRecorder(const std::string & module,const std::string & name,const std::vector<CNodePtr> & final_exec_order)28   GraphExecOrderRecorder(const std::string &module, const std::string &name,
29                          const std::vector<CNodePtr> &final_exec_order)
30       : BaseRecorder(module, name), exec_order_(final_exec_order) {}
~GraphExecOrderRecorder()31   ~GraphExecOrderRecorder() {}
SetExecOrder(const std::vector<CNodePtr> & final_exec_order)32   void SetExecOrder(const std::vector<CNodePtr> &final_exec_order) { exec_order_ = final_exec_order; }
33   virtual void Export();
34 
35  private:
36   std::vector<CNodePtr> exec_order_;
37 };
38 using GraphExecOrderRecorderPtr = std::shared_ptr<GraphExecOrderRecorder>;
39 
40 namespace RDR {
41 bool RecordGraphExecOrder(const SubModuleId module, const std::string &name,
42                           const std::vector<CNodePtr> &final_exec_order);
43 }  // namespace RDR
44 }  // namespace mindspore
45 #endif  // MINDSPORE_CCSRC_DEBUG_RDR_GRAPH_EXEC_ORDER_RECORDER_H_
46