From b3262b37ce0b46ddce2aa233fd937de177e59043 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Sat, 9 Aug 2025 10:38:17 +0200 Subject: [PATCH] teflon: Add support for the ResizeNearestNeighbor operation Acked-by: Christian Gmeiner Part-of: --- src/gallium/frontends/teflon/tfl_device.c | 9 +++++++++ src/gallium/include/pipe/p_state.h | 1 + 2 files changed, 10 insertions(+) diff --git a/src/gallium/frontends/teflon/tfl_device.c b/src/gallium/frontends/teflon/tfl_device.c index 71903bea149..13e2fc4a8c2 100644 --- a/src/gallium/frontends/teflon/tfl_device.c +++ b/src/gallium/frontends/teflon/tfl_device.c @@ -269,6 +269,10 @@ fill_operation(struct teflon_delegate *delegate, TfLiteContext *tf_context, TfLi break; } + case kTfLiteBuiltinResizeNearestNeighbor: { + operation->type = PIPE_ML_OPERATION_TYPE_RESIZE; + break; + } default: return false; } @@ -420,6 +424,9 @@ dump_graph(struct pipe_tensor *tensors, unsigned tensor_count, struct pipe_ml_op case PIPE_ML_OPERATION_TYPE_STRIDED_SLICE: teflon_debug("%-6s ", "STRIDED_SLICE"); break; + case PIPE_ML_OPERATION_TYPE_RESIZE: + teflon_debug("%-6s ", "RESIZE"); + break; } for (unsigned j = 0; j < operations[i].input_count; j++) { @@ -629,6 +636,8 @@ tflite_builtin_op_name(TfLiteBuiltinOperator op) return "MEAN"; case kTfLiteBuiltinStridedSlice: return "STRIDED_SLICE"; + case kTfLiteBuiltinResizeNearestNeighbor: + return "RESIZE"; default: return "unknown"; } diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index f67d813339c..f9b9174566a 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -1055,6 +1055,7 @@ enum pipe_ml_operation_type { PIPE_ML_OPERATION_TYPE_SUBTRACT, PIPE_ML_OPERATION_TYPE_TRANSPOSE, PIPE_ML_OPERATION_TYPE_STRIDED_SLICE, + PIPE_ML_OPERATION_TYPE_RESIZE, }; enum pipe_ml_pooling_type {