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

Method SumReducer

compiler/lib/KernelGen/GeneralIntrinsic/Reduce.cpp:230–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228 std::string init_vaule = "0";
229 std::string core_str;
230 SumReducer(std::string ctype) : Rdeucer(ctype) {
231 std::string suffix_ins;
232 if (m_ctype == "float") {
233 suffix_ins = "Float32";
234 } else if (m_ctype == "gi_float16_t") {
235 suffix_ins = "Float16";
236 } else {
237 CC_ABORT << "unsupported dtype for min reduce";
238 }
239
240 core_str = "GiAdd" + suffix_ins;
241 }
242 std::string gen_init(bool c_remain) override {
243 if (!c_remain)
244 return simd_type + " answer_vec = " + init_str + "(" + init_vaule + ");\n";

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected