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

Method IsCVAvailable

compiler/lib/KernelGen/BareMetal/CvtColor.cpp:249–255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

247} // namespace
248
249bool CvtColorKernel::IsCVAvailable(TContext* context) const {
250 auto src_dtype = context->getAttrOprand("operand:0").dtype;
251 bool dtype_ok = Utils::is_int_dtype(src_dtype, 8) ||
252 (context->getAttrStr("mode") == "GRAY2RGB" && src_dtype == "f32");
253 bool mode_ok = g_cvt_reg.usable(context->getAttrStr("mode"));
254 return dtype_ok && mode_ok;
255}
256
257//! kernel gen
258std::string CvtColorKernel::GetCVKernelSubSymbol(TContext* context) const {

Callers

nothing calls this directly

Calls 4

is_int_dtypeFunction · 0.85
getAttrOprandMethod · 0.80
getAttrStrMethod · 0.80
usableMethod · 0.45

Tested by

no test coverage detected