| 12 | using namespace AutoBareMetal; |
| 13 | |
| 14 | bool ElmwiseKernel::IsAvailable(TContext* context) const { |
| 15 | auto auto_kern = codegen::GenCode(KernelPack::KernType::ElemwiseKernel); |
| 16 | auto mode = context->getAttrStr("mode"); |
| 17 | auto nr_operands = context->getAttrInt("nr_operands"); |
| 18 | bool nr_operands_ok = nr_operands == 2; |
| 19 | bool mode_ok_unary = mode == "RELU"; |
| 20 | bool mode_ok_binary = false; |
| 21 | bool mode_ok_other = false; |
| 22 | bool mode_kern_ok = auto_kern->IsAvailable(context); |
| 23 | return nr_operands_ok && (mode_ok_unary || mode_ok_binary || mode_ok_other) && |
| 24 | mode_kern_ok; |
| 25 | } |
| 26 | |
| 27 | std::string ElmwiseKernel::GetKernelSymbol(TContext* context) const { |
| 28 | std::stringstream ss; |
nothing calls this directly
no test coverage detected