| 30 | } |
| 31 | |
| 32 | static inline const char* config_id_to_string( |
| 33 | OprTensorFormatsConfiguration::OprFormatConfigID config_id) { |
| 34 | using OprFormatConfigID = OprTensorFormatsConfiguration::OprFormatConfigID; |
| 35 | #define cb(_fmt) \ |
| 36 | case OprFormatConfigID::_fmt: \ |
| 37 | return #_fmt |
| 38 | switch (config_id) { |
| 39 | cb(NCHW); |
| 40 | cb(NHWC); |
| 41 | cb(NCHW4); |
| 42 | cb(NCHW8); |
| 43 | cb(NCHW4_NCHW32); |
| 44 | cb(NCHW4_NCHW); |
| 45 | cb(NCHW32); |
| 46 | cb(NCHW32_NCHW4); |
| 47 | cb(NCHW64); |
| 48 | cb(CHWN4); |
| 49 | cb(NCHW44); |
| 50 | cb(NCHW44_HYBRID); |
| 51 | cb(NCHW88); |
| 52 | cb(NCHW88_HYBRID); |
| 53 | cb(NCHW44_DOT); |
| 54 | cb(NCHW44_DOT_HYBRID); |
| 55 | cb(NHWCD4); |
| 56 | default: |
| 57 | mgb_assert( |
| 58 | false, "Invalid config id(got:%u)", |
| 59 | static_cast<uint32_t>(config_id)); |
| 60 | } |
| 61 | #undef cb |
| 62 | } |
| 63 | |
| 64 | static inline TensorFormats opr_format_to_tensor_formats( |
| 65 | OprTensorFormatsConfiguration::OprFormat opr_format) { |
no test coverage detected