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

Method inline_min_func

compiler/lib/KernelGen/Utils/Utils.cpp:117–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115}
116
117std::string Utils::DtypeHelper::inline_min_func() {
118 switch (m_dtype) {
119 case DtypeEnum::float32:
120 return R"(
121static inline float min(float a, float b){
122 return a < b? a:b;
123})";
124 case DtypeEnum::int32:
125 return R"(
126static inline int min(int a, int b){
127 return a < b? a:b;
128})";
129 default:
130 CC_ASSERT(0) << "not support dtype " << (int)m_dtype;
131 }
132 return "";
133}
134
135std::vector<std::string> Utils::split_string(const std::string& s, const char delim) {
136 std::istringstream iss(s);

Callers 1

gen_helperFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected