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

Method MinReducer

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

Source from the content-addressed store, hash-verified

75 std::string core_str;
76 std::string post_str;
77 MinReducer(std::string ctype) : Rdeucer(ctype) {
78 std::string suffix_ins;
79 if (m_ctype == "float") {
80 suffix_ins = "Float32";
81 init_vaule = "__FLT_MAX__";
82 } else if (m_ctype == "gi_float16_t") {
83 suffix_ins = "Float16";
84 init_vaule = "65504";
85 } else {
86 CC_ABORT << "unsupported dtype for min reduce";
87 }
88
89 core_str = "GiMinimum" + suffix_ins;
90 }
91 std::string gen_init(bool c_remain) override {
92 if (!c_remain)
93 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