diff --git a/src/gallium/frontends/teflon/tfl_device.c b/src/gallium/frontends/teflon/tfl_device.c index 5cd21dc1e95..9f00b5ad082 100644 --- a/src/gallium/frontends/teflon/tfl_device.c +++ b/src/gallium/frontends/teflon/tfl_device.c @@ -376,74 +376,79 @@ dump_graph(struct pipe_tensor *tensors, unsigned tensor_count, struct pipe_ml_op } teflon_debug("\n"); - teflon_debug("%3s %-6s %25s %25s %s\n", "idx", "type", "inputs", "outputs", "operation type-specific"); - teflon_debug("================================================================================================\n"); + teflon_debug("%3s %-15s %-20s %-20s\n", "idx", "type", "inputs", "outputs"); + teflon_debug("==========================================================================\n"); for (int i = 0; i < operation_count; i++) { teflon_debug("%3d ", i); switch (operations[i].type) { case PIPE_ML_OPERATION_TYPE_ADD: - teflon_debug("%-6s ", "ADD"); + teflon_debug("%-15s ", "ADD"); break; case PIPE_ML_OPERATION_TYPE_CONVOLUTION: - teflon_debug("%-6s ", operations[i].conv.depthwise ? "DWCONV" : "CONV"); + teflon_debug("%-15s ", operations[i].conv.depthwise ? "DWCONV" : "CONV"); break; case PIPE_ML_OPERATION_TYPE_CONCATENATION: - teflon_debug("%-6s ", "CONCAT"); + teflon_debug("%-15s ", "CONCAT"); break; case PIPE_ML_OPERATION_TYPE_POOLING: - teflon_debug("%-6s ", "POOL"); + teflon_debug("%-15s ", "POOL"); break; case PIPE_ML_OPERATION_TYPE_SPLIT: - teflon_debug("%-6s ", "SPLIT"); + teflon_debug("%-15s ", "SPLIT"); break; case PIPE_ML_OPERATION_TYPE_PAD: - teflon_debug("%-6s ", "PAD"); + teflon_debug("%-15s ", "PAD"); break; case PIPE_ML_OPERATION_TYPE_FULLY_CONNECTED: - teflon_debug("%-6s ", "FCON"); + teflon_debug("%-15s ", "FCON"); break; case PIPE_ML_OPERATION_TYPE_RESHAPE: - teflon_debug("%-6s ", "RESHAPE"); + teflon_debug("%-15s ", "RESHAPE"); break; case PIPE_ML_OPERATION_TYPE_RELU: - teflon_debug("%-6s ", "RELU"); + teflon_debug("%-15s ", "RELU"); break; case PIPE_ML_OPERATION_TYPE_ABSOLUTE: - teflon_debug("%-6s ", "ABS"); + teflon_debug("%-15s ", "ABS"); break; case PIPE_ML_OPERATION_TYPE_LOGISTIC: - teflon_debug("%-6s ", "LOG"); + teflon_debug("%-15s ", "LOG"); break; case PIPE_ML_OPERATION_TYPE_SUBTRACT: - teflon_debug("%-6s ", "SUB"); + teflon_debug("%-15s ", "SUB"); break; case PIPE_ML_OPERATION_TYPE_TRANSPOSE: - teflon_debug("%-6s ", "TRANSPOSE"); + teflon_debug("%-15s ", "TRANSPOSE"); break; case PIPE_ML_OPERATION_TYPE_STRIDED_SLICE: - teflon_debug("%-6s ", "STRIDED_SLICE"); + teflon_debug("%-15s ", "STRIDED_SLICE"); break; case PIPE_ML_OPERATION_TYPE_RESIZE: - teflon_debug("%-6s ", "RESIZE"); + teflon_debug("%-15s ", "RESIZE"); break; } + char *input_buf = ralloc_strdup(NULL, ""); + for (unsigned j = 0; j < operations[i].input_count; j++) { - teflon_debug("%d", operations[i].input_tensors[j]->index); + ralloc_asprintf_append(&input_buf, "%d", operations[i].input_tensors[j]->index); if (j < operations[i].input_count - 1) - teflon_debug(","); + ralloc_asprintf_append(&input_buf, ","); } - teflon_debug(" "); + char *output_buf = ralloc_strdup(NULL, ""); for (unsigned j = 0; j < operations[i].output_count; j++) { - teflon_debug("%d", operations[i].output_tensors[j]->index); + ralloc_asprintf_append(&output_buf, "%d", operations[i].output_tensors[j]->index); if (j < operations[i].output_count - 1) - teflon_debug(","); + ralloc_asprintf_append(&output_buf, ","); } - teflon_debug("\n"); + teflon_debug("%-20s %-20s\n", input_buf, output_buf); + ralloc_free(input_buf); + ralloc_free(output_buf); + } teflon_debug("\n"); } @@ -740,7 +745,7 @@ PrepareDelegate(TfLiteContext *tf_context, TfLiteDelegate *tf_delegate) for (int i = 0; i < tf_context->tensors_size; i++) fill_tensor(delegate, tf_context, &delegate->tensors[i], i); - teflon_debug("%3s %7s %3s %-11s %s\n", "idx", "type", "ver", "support", "inputs"); + teflon_debug("%3s %-15s %3s %-11s %s\n", "idx", "type", "ver", "support", "inputs"); teflon_debug("================================================================================================\n"); // Get a list of supported nodes. @@ -756,7 +761,7 @@ PrepareDelegate(TfLiteContext *tf_context, TfLiteDelegate *tf_delegate) supported = check_op_support(tf_delegate, tf_context, node, registration); - teflon_debug("%3d %7s v%-2d %-11s in:", node_index, + teflon_debug("%3d %-15s v%-2d %-11s in:", node_index, tflite_builtin_op_name(registration->builtin_code), registration->version, supported ? "supported" : "unsupported");