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

Method IsAvailable

compiler/lib/KernelGen/GeneralIntrinsic/Resize.cpp:13–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

getAttrOprandMethod · 0.80
getAttrStrMethod · 0.80

Tested by

no test coverage detected