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