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.

tensorprint_utils.h 1.4 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. #ifndef MINDSPORE_CCSRC_UTILS_TENSORPRINT_UTILS_H_
  17. #define MINDSPORE_CCSRC_UTILS_TENSORPRINT_UTILS_H_
  18. #include <map>
  19. #include <string>
  20. #include "ir/dtype/type.h"
  21. #ifndef NO_DLIB
  22. #include "acl/acl_tdt.h"
  23. #include "tdt/tsd_client.h"
  24. #include "tdt/data_common.h"
  25. #include "tdt/tdt_host_interface.h"
  26. #include "proto/print.pb.h"
  27. namespace mindspore {
  28. class TensorPrint {
  29. public:
  30. explicit TensorPrint(const std::string &path, const acltdtChannelHandle *acl_handle)
  31. : print_file_path_(path), acl_handle_(acl_handle) {}
  32. ~TensorPrint() = default;
  33. void operator()();
  34. private:
  35. std::string print_file_path_;
  36. const acltdtChannelHandle *acl_handle_;
  37. };
  38. } // namespace mindspore
  39. #endif
  40. #endif // MINDSPORE_CCSRC_UTILS_TENSOR_PRINT_H_