You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

profiling_kernel_mod.h 1.7 kB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /**
  2. * Copyright 2019 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_MINDSPORE_CCSRC_KERNEL_RTS_PROFILING_KERNEL_MOD_H_
  17. #define MINDSPORE_MINDSPORE_CCSRC_KERNEL_RTS_PROFILING_KERNEL_MOD_H_
  18. #include <vector>
  19. #include "kernel/rts/rt_kernel.h"
  20. namespace mindspore {
  21. namespace kernel {
  22. class ProfilingKernelMod : public RtKernel {
  23. public:
  24. ProfilingKernelMod() = default;
  25. ~ProfilingKernelMod() override = default;
  26. bool Launch(const std::vector<AddressPtr> &inputs, const std::vector<AddressPtr> &workspace,
  27. const std::vector<AddressPtr> &outputs, void *stream_ptr) override;
  28. std::vector<TaskInfoPtr> GenTask(const std::vector<AddressPtr> &inputs, const std::vector<AddressPtr> &workspace,
  29. const std::vector<AddressPtr> &outputs, uint32_t stream_id) override;
  30. bool Init(const AnfNodePtr &anf_node) override;
  31. private:
  32. uint64_t log_id_{0};
  33. bool notify_{true};
  34. uint32_t flags_{0};
  35. };
  36. MS_REG_RTKERNEL(profiling, ProfilingKernelMod);
  37. } // namespace kernel
  38. } // namespace mindspore
  39. #endif // MINDSPORE_MINDSPORE_CCSRC_KERNEL_RTS_PROFILING_KERNEL_MOD_H_