• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright 2022 The TensorFlow Authors. All Rights Reserved.
2 
3 Licensed under the Apache License, Version 2.0 (the "License");
4 you may not use this file except in compliance with the License.
5 You may obtain a copy of the License at
6 
7     http://www.apache.org/licenses/LICENSE-2.0
8 
9 Unless required by applicable law or agreed to in writing, software
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 TENSORFLOW_CORE_PROFILER_CONVERT_HLO_TO_TOOLS_DATA_H_
17 #define TENSORFLOW_CORE_PROFILER_CONVERT_HLO_TO_TOOLS_DATA_H_
18 
19 #include <string>
20 #include <utility>
21 #include <vector>
22 
23 #include "absl/strings/string_view.h"
24 #include "tensorflow/core/platform/statusor.h"
25 #include "tensorflow/core/profiler/convert/tool_options.h"
26 
27 namespace tensorflow {
28 namespace profiler {
29 
30 // Convert HLO proto to tool specific data.
31 // <options> must provide a "hlo_module_name" field to identify which HLO proto
32 // is used for the conversion.
33 // The file path of the HLO proto is automatically inferred from <xspace_paths>
34 // and <options>.
35 // Return the serialized string of tool specific data when the conversion is
36 // successful, else return an error status.
37 StatusOr<std::string> ConvertHloProtoToToolData(
38     const std::vector<std::string>& xspace_paths,
39     const absl::string_view tool_name, const ToolOptions& options);
40 
41 }  // namespace profiler
42 }  // namespace tensorflow
43 
44 #endif  // TENSORFLOW_CORE_PROFILER_CONVERT_HLO_TO_TOOLS_DATA_H_
45