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.

debugger_utils.h 2.0 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /**
  2. * Copyright 2021-2022 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. #include <iostream>
  17. #include <vector>
  18. #include <string>
  19. #include "debug/debugger/debugger.h"
  20. #include "kernel/kernel.h"
  21. #include "runtime/hardware/device_context.h"
  22. #ifdef ENABLE_D
  23. #include "toolchain/adx_datadump_callback.h"
  24. using Adx::DumpChunk;
  25. #endif
  26. using mindspore::device::DeviceContext;
  27. using mindspore::kernel::KernelLaunchInfo;
  28. namespace mindspore {
  29. std::vector<size_t> CheckRealOutput(const std::string &node_name, const size_t &output_size);
  30. void LoadInputs(const CNodePtr &cnode, const KernelLaunchInfo *launch_info, uint32_t exec_order, uint32_t root_graph_id,
  31. const DeviceContext *device_context);
  32. void LoadOutputs(const CNodePtr &cnode, const KernelLaunchInfo *launch_info, uint32_t exec_order,
  33. uint32_t root_graph_id, const DeviceContext *device_context);
  34. bool CheckReadData(const CNodePtr &cnode);
  35. void ReadDataAndDump(const CNodePtr &cnode, const KernelLaunchInfo *launch_info, uint32_t exec_order,
  36. const DeviceContext *device_context);
  37. std::string CheckDatasetSinkMode(const KernelGraphPtr &graph_ptr);
  38. void LoadDataForDebugger(const KernelGraphPtr &graph_ptr);
  39. void SuperKernelE2eDump(const KernelGraphPtr &graph);
  40. #ifdef ENABLE_D
  41. // Callback function to dump ascend async mode
  42. int32_t DumpDataCallBack(const DumpChunk *dump_chunk, int32_t size);
  43. #endif
  44. } // namespace mindspore