| 53 | } |
| 54 | |
| 55 | static StringRef GetClientBuilder(const Operator& op) { |
| 56 | static const auto* kOpToXLABuilderMap = |
| 57 | new llvm::StringMap<StringRef>{{"ReverseOp", "Rev"}, |
| 58 | {"ConcatenateOp", "ConcatInDim"}, |
| 59 | {"ConvOp", "ConvGeneralDilated"}}; |
| 60 | |
| 61 | StringRef op_name = op.getCppClassName(); |
| 62 | |
| 63 | // Default case where the client builder method names closely follow the op |
| 64 | // names in the dialect. For e.g., AddOp -> xla::Add method. |
| 65 | if (!kOpToXLABuilderMap->count(op_name)) return op_name.drop_back(2); |
| 66 | |
| 67 | // Otherwise, if the op to client builder method mapping is provided. |
| 68 | return kOpToXLABuilderMap->lookup(op_name); |
| 69 | } |
| 70 | |
| 71 | static void BuildOperator(const Operator& op, raw_ostream* output) { |
| 72 | auto& os = *output; |
no test coverage detected