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_DEVICE_QUEUE_TRACING_H 18 #define MINDSPORE_DEVICE_QUEUE_TRACING_H 19 20 #include <string> 21 #include <vector> 22 #include "minddata/dataset/engine/perf/profiling.h" 23 24 namespace mindspore { 25 namespace dataset { 26 class DeviceQueueTracing : public Tracing { 27 public: 28 // Constructor 29 DeviceQueueTracing() = default; 30 31 // Destructor 32 ~DeviceQueueTracing() override = default; 33 34 // Record tracing data 35 // @return Status The status code returned 36 void Record(const int32_t type, const int32_t extra_info, const int32_t batch_num, const int32_t value, 37 const uint64_t time_stamp); 38 Name()39 std::string Name() const override { return kDeviceQueueTracingName; }; 40 41 Status Init(const std::string &dir_path, const std::string &device_id) override; 42 43 Status ChangeFileMode() override; 44 }; 45 } // namespace dataset 46 } // namespace mindspore 47 48 #endif // MINDSPORE_DEVICE_QUEUE_TRACING_H 49