| 115 | } |
| 116 | |
| 117 | std::string Utils::DtypeHelper::inline_min_func() { |
| 118 | switch (m_dtype) { |
| 119 | case DtypeEnum::float32: |
| 120 | return R"( |
| 121 | static inline float min(float a, float b){ |
| 122 | return a < b? a:b; |
| 123 | })"; |
| 124 | case DtypeEnum::int32: |
| 125 | return R"( |
| 126 | static 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 | |
| 135 | std::vector<std::string> Utils::split_string(const std::string& s, const char delim) { |
| 136 | std::istringstream iss(s); |