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

Method GetKernelSymbol

compiler/lib/KernelGen/BareMetal/PowC.cpp:21–32  ·  view source on GitHub ↗

kernel gen

Source from the content-addressed store, hash-verified

19
20//! kernel gen
21std::string PowCKernel::GetKernelSymbol(TContext* context) const {
22 std::stringstream ss;
23 auto exp_str = std::to_string(context->getAttrFloat("exp"));
24 if (exp_str.find('.') != std::string::npos) {
25 exp_str[exp_str.find('.')] = '_';
26 }
27 if (exp_str.find('-') != std::string::npos) {
28 exp_str[exp_str.find('-')] = 'N';
29 }
30 ss << "kernel_powc_" << exp_str << "_" << context->getAttrOprand("operand:0").dtype;
31 return ss.str();
32}
33
34std::string PowCKernel::GetKernelBody(TContext* context) const {
35 std::stringstream ss;

Callers

nothing calls this directly

Calls 2

getAttrOprandMethod · 0.80
to_stringFunction · 0.50

Tested by

no test coverage detected