| 31 | using namespace mlir; |
| 32 | |
| 33 | bool ElemwiseKernel::IsAvailable(TContext* context) const { |
| 34 | auto mode = context->getAttrStr("mode"); |
| 35 | auto nr_operands = context->getAttrInt("nr_operands"); |
| 36 | bool nr_operands_ok = nr_operands == 2; |
| 37 | bool mode_ok_unary = mode == "RELU"; |
| 38 | bool mode_ok_binary = false; |
| 39 | bool mode_ok_other = false; |
| 40 | return nr_operands_ok && (mode_ok_unary || mode_ok_binary || mode_ok_other); |
| 41 | } |
| 42 | |
| 43 | std::string ElemwiseKernel::GetKernelSymbol(TContext* context) const { |
| 44 | std::stringstream ss; |
nothing calls this directly
no test coverage detected