MCPcopy Create free account
hub / github.com/MegEngine/MegCC / IsAvailable

Method IsAvailable

compiler/lib/CodeGen/Elemwise.cpp:33–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31using namespace mlir;
32
33bool 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
43std::string ElemwiseKernel::GetKernelSymbol(TContext* context) const {
44 std::stringstream ss;

Callers

nothing calls this directly

Calls 1

getAttrStrMethod · 0.80

Tested by

no test coverage detected