1 // Copyright 2020 Google LLC 2 // 3 // This source code is licensed under the BSD-style license found in the 4 // LICENSE file in the root directory of this source tree. 5 6 #include <math.h> 7 #include <stddef.h> 8 #include <stdint.h> 9 10 #include <xnnpack/common.h> 11 #include <xnnpack/log.h> 12 #include <xnnpack/subgraph.h> 13 14 15 // This function is defined inline when logging is disabled 16 #if XNN_LOG_LEVEL > 0 xnn_node_type_to_string(enum xnn_node_type type)17const char* xnn_node_type_to_string(enum xnn_node_type type) { 18 switch (type) { 19 case xnn_node_type_invalid: 20 return "Invalid"; 21 case xnn_node_type_abs: 22 return "Abs"; 23 case xnn_node_type_add2: 24 return "Add2"; 25 case xnn_node_type_argmax_pooling_2d: 26 return "ArgMax Pooling 2D"; 27 case xnn_node_type_average_pooling_2d: 28 return "Average Pooling 2D"; 29 case xnn_node_type_bankers_rounding: 30 return "Bankers Rounding"; 31 case xnn_node_type_ceiling: 32 return "Ceiling"; 33 case xnn_node_type_clamp: 34 return "Clamp"; 35 case xnn_node_type_convert: 36 return "Convert"; 37 case xnn_node_type_convolution_2d: 38 return "Convolution 2D"; 39 case xnn_node_type_deconvolution_2d: 40 return "Deconvolution 2D"; 41 case xnn_node_type_depthwise_convolution_2d: 42 return "Depthwise Convolution 2D"; 43 case xnn_node_type_depth_to_space: 44 return "Depth To Space"; 45 case xnn_node_type_divide: 46 return "Divide"; 47 case xnn_node_type_elu: 48 return "ELU"; 49 case xnn_node_type_fully_connected: 50 return "Fully Connected"; 51 case xnn_node_type_floor: 52 return "Floor"; 53 case xnn_node_type_global_average_pooling_2d: 54 return "Global Average Pooling 2D"; 55 case xnn_node_type_hardswish: 56 return "HardSwish"; 57 case xnn_node_type_leaky_relu: 58 return "Leaky ReLU"; 59 case xnn_node_type_maximum2: 60 return "Maximum2"; 61 case xnn_node_type_minimum2: 62 return "Minimum2"; 63 case xnn_node_type_multiply2: 64 return "Multiply2"; 65 case xnn_node_type_max_pooling_2d: 66 return "Max Pooling 2D"; 67 case xnn_node_type_negate: 68 return "Negate"; 69 case xnn_node_type_prelu: 70 return "PReLU"; 71 case xnn_node_type_sigmoid: 72 return "Sigmoid"; 73 case xnn_node_type_softmax: 74 return "Softmax"; 75 case xnn_node_type_static_constant_pad: 76 return "Static Constant Pad"; 77 case xnn_node_type_static_reshape: 78 return "Static Reshape"; 79 case xnn_node_type_static_resize_bilinear_2d: 80 return "Static Resize Bilinear 2D"; 81 case xnn_node_type_square: 82 return "Square"; 83 case xnn_node_type_square_root: 84 return "Square Root"; 85 case xnn_node_type_squared_difference: 86 return "Squared Difference"; 87 case xnn_node_type_subtract: 88 return "Subtract"; 89 case xnn_node_type_unpooling_2d: 90 return "Unpooling 2D"; 91 } 92 XNN_UNREACHABLE; 93 return NULL; 94 } 95 #endif // XNN_LOG_LEVEL > 0 96