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_convolution_2d: 36 return "Convolution 2D"; 37 case xnn_node_type_deconvolution_2d: 38 return "Deconvolution 2D"; 39 case xnn_node_type_depthwise_convolution_2d: 40 return "Depthwise Convolution 2D"; 41 case xnn_node_type_depth_to_space: 42 return "Depth To Space"; 43 case xnn_node_type_divide: 44 return "Divide"; 45 case xnn_node_type_elu: 46 return "ELU"; 47 case xnn_node_type_fully_connected: 48 return "Fully Connected"; 49 case xnn_node_type_floor: 50 return "Floor"; 51 case xnn_node_type_global_average_pooling_2d: 52 return "Global Average Pooling 2D"; 53 case xnn_node_type_hardswish: 54 return "HardSwish"; 55 case xnn_node_type_leaky_relu: 56 return "Leaky ReLU"; 57 case xnn_node_type_maximum2: 58 return "Maximum2"; 59 case xnn_node_type_minimum2: 60 return "Minimum2"; 61 case xnn_node_type_multiply2: 62 return "Multiply2"; 63 case xnn_node_type_max_pooling_2d: 64 return "Max Pooling 2D"; 65 case xnn_node_type_negate: 66 return "Negate"; 67 case xnn_node_type_prelu: 68 return "PReLU"; 69 case xnn_node_type_sigmoid: 70 return "Sigmoid"; 71 case xnn_node_type_softmax: 72 return "Softmax"; 73 case xnn_node_type_static_constant_pad: 74 return "Static Constant Pad"; 75 case xnn_node_type_static_reshape: 76 return "Static Reshape"; 77 case xnn_node_type_static_resize_bilinear_2d: 78 return "Static Resize Bilinear 2D"; 79 case xnn_node_type_square: 80 return "Square"; 81 case xnn_node_type_square_root: 82 return "Square Root"; 83 case xnn_node_type_squared_difference: 84 return "Squared Difference"; 85 case xnn_node_type_subtract: 86 return "Subtract"; 87 case xnn_node_type_unpooling_2d: 88 return "Unpooling 2D"; 89 } 90 XNN_UNREACHABLE; 91 return NULL; 92 } 93 #endif // XNN_LOG_LEVEL > 0 94