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

Method MaxReducer

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

Source from the content-addressed store, hash-verified

153 std::string init_vaule;
154 std::string core_str;
155 MaxReducer(std::string ctype) : Rdeucer(ctype) {
156 std::string suffix_ins;
157 if (m_ctype == "float") {
158 suffix_ins = "Float32";
159 init_vaule = "-__FLT_MAX__";
160 } else if (m_ctype == "gi_float16_t") {
161 suffix_ins = "Float16";
162 init_vaule = "-65504";
163 } else {
164 CC_ABORT << "unsupported dtype for min reduce";
165 }
166
167 core_str = "GiMaximum" + suffix_ins;
168 }
169 std::string gen_init(bool c_remain) override {
170 if (!c_remain)
171 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