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

Method IsAvailable

compiler/lib/KernelGen/Arm/ArmCommon/Resize.cpp:14–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12using namespace ArmCommon;
13
14bool ResizeKernel::IsAvailable(TContext* context) const {
15 auto src_dtype = context->getAttrOprand("operand:0").dtype;
16 bool dtype_ok = src_dtype == "f32";
17 bool mode_ok = context->getAttrStr("imode") == "LINEAR";
18 bool format_ok = context->getAttrStr("format") == "NCHW" ||
19 context->getAttrStr("format") == "NCHW44";
20 return dtype_ok && mode_ok && format_ok;
21}
22//! kernel gen
23std::string ResizeKernel::GetKernelSymbol(TContext* context) const {
24 std::stringstream ss;

Callers

nothing calls this directly

Calls 2

getAttrOprandMethod · 0.80
getAttrStrMethod · 0.80

Tested by

no test coverage detected