| 1018 | } |
| 1019 | |
| 1020 | void StartFiles(bool internal, const string& dot_h_fname, WritableFile* h, |
| 1021 | WritableFile* cc, string* op_header_guard) { |
| 1022 | const string header = |
| 1023 | R"header(// This file is MACHINE GENERATED! Do not edit. |
| 1024 | |
| 1025 | #include "tensorflow/cc/framework/ops.h" |
| 1026 | #include "tensorflow/cc/framework/scope.h" |
| 1027 | #include "tensorflow/core/framework/tensor.h" |
| 1028 | #include "tensorflow/core/framework/tensor_shape.h" |
| 1029 | #include "tensorflow/core/framework/types.h" |
| 1030 | #include "tensorflow/core/lib/gtl/array_slice.h" |
| 1031 | )header"; |
| 1032 | |
| 1033 | // TODO(keveman): Make namespaces configurable. |
| 1034 | const string namespace_begin = internal ? R"namespace( |
| 1035 | namespace tensorflow { |
| 1036 | namespace ops { |
| 1037 | namespace internal { |
| 1038 | // NOTE: This namespace has internal TensorFlow details that |
| 1039 | // are not part of TensorFlow's public API. |
| 1040 | |
| 1041 | )namespace" |
| 1042 | : R"namespace( |
| 1043 | namespace tensorflow { |
| 1044 | namespace ops { |
| 1045 | |
| 1046 | )namespace"; |
| 1047 | |
| 1048 | const string op_header = GetPath(dot_h_fname); |
| 1049 | *op_header_guard = ToGuard(op_header); |
| 1050 | const string cc_header = strings::StrCat( |
| 1051 | R"include(// This file is MACHINE GENERATED! Do not edit. |
| 1052 | |
| 1053 | |
| 1054 | #include "tensorflow/cc/ops/const_op.h" |
| 1055 | )include", |
| 1056 | "#include \"", op_header, "\"\n", namespace_begin); |
| 1057 | |
| 1058 | const string filename = GetFilename(dot_h_fname); |
| 1059 | const string doxygen = strings::StrCat("/// @defgroup ", filename, " ", |
| 1060 | ToTitle(filename), "\n", "/// @{\n\n"); |
| 1061 | |
| 1062 | TF_CHECK_OK(h->Append( |
| 1063 | strings::StrCat("// This file is MACHINE GENERATED! Do not edit.\n\n" |
| 1064 | "#ifndef ", |
| 1065 | *op_header_guard, |
| 1066 | "\n" |
| 1067 | "#define ", |
| 1068 | *op_header_guard, "\n\n"))); |
| 1069 | TF_CHECK_OK(h->Append(header)); |
| 1070 | TF_CHECK_OK(h->Append(namespace_begin)); |
| 1071 | TF_CHECK_OK(h->Append(doxygen)); |
| 1072 | TF_CHECK_OK(cc->Append(cc_header)); |
| 1073 | } |
| 1074 | |
| 1075 | void FinishFiles(bool internal, WritableFile* h, WritableFile* cc, |
| 1076 | const string& op_header_guard) { |
no test coverage detected