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

Method inline_max_func

compiler/lib/KernelGen/Utils/Utils.cpp:99–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99std::string Utils::DtypeHelper::inline_max_func() {
100 switch (m_dtype) {
101 case DtypeEnum::float32:
102 return R"(
103static inline float max(float a, float b){
104 return a > b? a:b;
105})";
106 case DtypeEnum::int32:
107 return R"(
108static inline int max(int a, int b){
109 return a > b? a:b;
110})";
111 default:
112 CC_ASSERT(0) << "not support dtype " << (int)m_dtype;
113 }
114 return "";
115}
116
117std::string Utils::DtypeHelper::inline_min_func() {
118 switch (m_dtype) {

Callers 1

gen_helperFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected