| 97 | } |
| 98 | |
| 99 | std::string Utils::DtypeHelper::inline_max_func() { |
| 100 | switch (m_dtype) { |
| 101 | case DtypeEnum::float32: |
| 102 | return R"( |
| 103 | static inline float max(float a, float b){ |
| 104 | return a > b? a:b; |
| 105 | })"; |
| 106 | case DtypeEnum::int32: |
| 107 | return R"( |
| 108 | static 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 | |
| 117 | std::string Utils::DtypeHelper::inline_min_func() { |
| 118 | switch (m_dtype) { |