• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright 2020 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 
17 #ifndef MINDSPORE_MINDSPORE_CCSRC_RUNTIME_DEVICE_ASCEND_PROFILING_REPORTER_OP_NAME_TASK_STREAM_REPORTER_H_
18 #define MINDSPORE_MINDSPORE_CCSRC_RUNTIME_DEVICE_ASCEND_PROFILING_REPORTER_OP_NAME_TASK_STREAM_REPORTER_H_
19 
20 #include <utility>
21 #include <string>
22 #include <map>
23 #include "runtime/device/ascend/profiling/reporter/desc_reporter.h"
24 
25 namespace mindspore {
26 namespace device {
27 namespace ascend {
28 class OpNameTaskStreamReporter : public DescReporter {
29  public:
OpNameTaskStreamReporter(uint32_t device_id,const std::string & file_name,std::map<std::pair<uint32_t,uint32_t>,std::string> stream_id_task_id_op_name_map)30   OpNameTaskStreamReporter(uint32_t device_id, const std::string &file_name,
31                            std::map<std::pair<uint32_t, uint32_t>, std::string> stream_id_task_id_op_name_map)
32       : DescReporter(device_id, file_name), stream_id_task_id_op_name_map_(std::move(stream_id_task_id_op_name_map)) {}
33   ~OpNameTaskStreamReporter() override = default;
34   void ReportData() override;
35 
36  private:
37   std::map<std::pair<uint32_t, uint32_t>, std::string> stream_id_task_id_op_name_map_;
38 };
39 }  // namespace ascend
40 }  // namespace device
41 }  // namespace mindspore
42 #endif  // MINDSPORE_MINDSPORE_CCSRC_RUNTIME_DEVICE_ASCEND_PROFILING_REPORTER_OP_NAME_TASK_STREAM_REPORTER_H_
43