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

Method GetWorkspaceBody

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

Source from the content-addressed store, hash-verified

26}
27
28std::string MatrixInvKernel::GetWorkspaceBody(TContext* context) const {
29 std::stringstream ss;
30 ss << GenCommonRet() << " " << GetWorkspaceSignature(context);
31 std::string workspace_temp = R"({
32 TINYNN_ASSERT(workspace);
33 const Layout in_layout = inputs[0]->layout;
34 const uint32_t n = in_layout.dims[in_layout.nr_dim - 1];
35 *workspace = 2 * n * n * sizeof(float);
36 return TinyNN_SUCCESS;
37 })";
38 ss << workspace_temp;
39 return ss.str();
40}
41
42std::string MatrixInvKernel::GetKernelBody(TContext* context) const {
43 std::stringstream ss;

Callers

nothing calls this directly

Calls 1

GenCommonRetFunction · 0.85

Tested by

no test coverage detected