• 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  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef MINDSPORE_CCSRC_PROFILER_DEVICE_ASCEND_PROFILING_H
17 #define MINDSPORE_CCSRC_PROFILER_DEVICE_ASCEND_PROFILING_H
18 #include <string>
19 #include <memory>
20 #include "profiler/device/profiling.h"
21 
22 namespace mindspore {
23 namespace profiler {
24 namespace ascend {
25 class AscendProfiler : public Profiler {
26  public:
27   static std::shared_ptr<AscendProfiler> &GetInstance();
AscendProfiler()28   AscendProfiler() : profiling_options_("") {}
29   ~AscendProfiler() = default;
30   AscendProfiler(const AscendProfiler &) = delete;
31   AscendProfiler &operator=(const AscendProfiler &) = delete;
Init(const std::string & profileDataPath)32   void Init(const std::string &profileDataPath) { return; }
33   void Stop();
34   void StepProfilingEnable(const bool enable_flag) override;
OpDataProducerEnd()35   void OpDataProducerEnd() { return; }
36   void Start(const std::string &profiling_options);
GetProfilingEnableFlag()37   bool GetProfilingEnableFlag() const { return enable_flag_; }
GetProfilingOptions()38   std::string GetProfilingOptions() const { return profiling_options_; }
SaveProfileData()39   void SaveProfileData() { return; }
ClearInst()40   void ClearInst() { return; }
41 
42  private:
43   static std::shared_ptr<AscendProfiler> ascend_profiler_;
44   std::string profiling_options_;
45 };
46 }  // namespace ascend
47 }  // namespace profiler
48 }  // namespace mindspore
49 #endif
50