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

Method IsAvailable

compiler/lib/KernelGen/BareMetal/MatrixInv.cpp:13–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11using namespace BareMetal;
12
13bool MatrixInvKernel::IsAvailable(TContext* context) const {
14 bool ok_dtype = context->getAttrOprand("operand:0").dtype == "f32";
15 auto src_shape = context->getAttrOprand("operand:0").shape;
16 bool ok_shape = src_shape.size() >= 2 &&
17 src_shape[src_shape.size() - 1] == src_shape[src_shape.size() - 2];
18 return ok_dtype && ok_shape;
19}
20
21//! kernel gen
22std::string MatrixInvKernel::GetKernelSymbol(TContext* context) const {

Callers

nothing calls this directly

Calls 1

getAttrOprandMethod · 0.80

Tested by

no test coverage detected