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

Method IsCVAvailable

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

Source from the content-addressed store, hash-verified

80}
81
82bool ResizeKernel::IsCVAvailable(TContext* context) const {
83 auto src_dtype = context->getAttrOprand("operand:0").dtype;
84 bool dtype_ok = src_dtype == "ui8" || Utils::is_float_dtype(src_dtype);
85 bool mode_ok = context->getAttrStr("imode") == "LINEAR" &&
86 context->getAttrStr("format") == "NHWC";
87 return dtype_ok && mode_ok;
88}
89
90//! kernel gen
91std::string ResizeKernel::GetCVKernelSubSymbol(TContext* context) const {

Callers

nothing calls this directly

Calls 3

is_float_dtypeFunction · 0.85
getAttrOprandMethod · 0.80
getAttrStrMethod · 0.80

Tested by

no test coverage detected