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_CCSRC_RUNTIME_DEVICE_ASCEND_PROFILING_REPORTER_TASK_DESC_REPORTER_H_ 18 #define MINDSPORE_CCSRC_RUNTIME_DEVICE_ASCEND_PROFILING_REPORTER_TASK_DESC_REPORTER_H_ 19 20 #include <utility> 21 #include <string> 22 #include <vector> 23 #include "runtime/device/ascend/profiling/reporter/desc_reporter.h" 24 25 namespace mindspore { 26 namespace device { 27 namespace ascend { 28 class TaskDescReporter : public DescReporter { 29 public: TaskDescReporter(int device_id,const std::string & file_name,std::vector<CNodePtr> cnode_list)30 TaskDescReporter(int device_id, const std::string &file_name, std::vector<CNodePtr> cnode_list) 31 : DescReporter(device_id, file_name), cnode_list_(std::move(cnode_list)) {} 32 ~TaskDescReporter() override = default; 33 void ReportData() override; set_task_ids(const std::vector<uint32_t> & task_ids)34 void set_task_ids(const std::vector<uint32_t> &task_ids) { task_ids_ = task_ids; } set_stream_ids(const std::vector<uint32_t> & stream_ids)35 void set_stream_ids(const std::vector<uint32_t> &stream_ids) { stream_ids_ = stream_ids; } 36 37 private: 38 std::vector<uint32_t> task_ids_; 39 std::vector<uint32_t> stream_ids_; 40 void CheckStreamTaskValid(size_t task_id, size_t stream_id) const; 41 std::vector<CNodePtr> cnode_list_; 42 }; 43 } // namespace ascend 44 } // namespace device 45 } // namespace mindspore 46 #endif // MINDSPORE_CCSRC_RUNTIME_DEVICE_ASCEND_PROFILING_REPORTER_TASK_DESC_REPORTER_H_ 47