MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / config_id_to_string

Function config_id_to_string

src/gopt/impl/global_layout_transform/utils.h:32–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30}
31
32static 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
64static inline TensorFormats opr_format_to_tensor_formats(
65 OprTensorFormatsConfiguration::OprFormat opr_format) {

Callers 4

solveMethod · 0.85
to_stringMethod · 0.85
applyMethod · 0.85

Calls 1

cbFunction · 0.70

Tested by

no test coverage detected