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

Method GetKernelSymbol

compiler/lib/KernelGen/BareMetal/ConvBackDataKernel.cpp:102–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100}
101
102std::string ConvBackDataGeneral::GetKernelSymbol(TContext* ctx) const {
103 std::stringstream extra_ss;
104 extra_ss << "_" << SymbolHelper::gen_io_str(ctx);
105 if (ctx->haveAttr("nonlineMode") && ctx->getAttrStr("nonlineMode") != "IDENTITY") {
106 extra_ss << "_" << ctx->getAttrStr("nonlineMode");
107 }
108 std::string name_temp =
109 "kernel_convBackData_${kernel_h}x${kernel_w}_${format}_${sparse}_p$"
110 "{pad_h}x${pad_w}_s${stride_h}x${stride_w}_d${dilate_h}x${dilate_w}"
111 "${extra}";
112 return StringTemplate::StringTemplateArgs(ctx)
113 .add_ctx_int("kernel_h")
114 .add_ctx_int("kernel_w")
115 .add("format", get_format(ctx))
116 .add_ctx_str("sparse")
117 .add_ctx_int("pad_h")
118 .add_ctx_int("pad_w")
119 .add_ctx_int("stride_h")
120 .add_ctx_int("stride_w")
121 .add_ctx_int("dilate_h")
122 .add_ctx_int("dilate_w")
123 .add("extra", extra_ss.str())
124 .render(name_temp);
125}
126
127std::string ConvBackDataGeneral::GetKernelBody(TContext* context) const {
128 std::stringstream ss;

Callers

nothing calls this directly

Calls 6

StringTemplateArgsClass · 0.85
haveAttrMethod · 0.80
getAttrStrMethod · 0.80
get_formatFunction · 0.70
renderMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected