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

Method MeanReducer

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

Source from the content-addressed store, hash-verified

376 std::string core_str;
377 std::string post_str;
378 MeanReducer(std::string ctype) : Rdeucer(ctype) {
379 std::string suffix_ins;
380 if (m_ctype == "float") {
381 suffix_ins = "Float32";
382 } else if (m_ctype == "gi_float16_t") {
383 suffix_ins = "Float16";
384 } else {
385 CC_ABORT << "unsupported dtype for min reduce";
386 }
387
388 core_str = "GiAdd" + suffix_ins;
389 post_str = "GiMultiplyScaler" + suffix_ins;
390 }
391 std::string gen_init(bool c_remain) override {
392 if (!c_remain)
393 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