From 005ab1f0feeafd6909e5e59f5c263f93254fd786 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Fri, 11 Apr 2025 07:58:10 +0200 Subject: [PATCH] teflon: Add support for Subtract Part-of: --- src/gallium/frontends/teflon/tfl_device.c | 6 ++++++ src/gallium/include/pipe/p_state.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/gallium/frontends/teflon/tfl_device.c b/src/gallium/frontends/teflon/tfl_device.c index e31e1215d3a..94983cc7b2e 100644 --- a/src/gallium/frontends/teflon/tfl_device.c +++ b/src/gallium/frontends/teflon/tfl_device.c @@ -234,6 +234,9 @@ fill_operation(struct teflon_delegate *delegate, TfLiteContext *tf_context, TfLi case kTfLiteBuiltinLogistic: operation->type = PIPE_ML_OPERATION_TYPE_LOGISTIC; break; + case kTfLiteBuiltinSub: + operation->type = PIPE_ML_OPERATION_TYPE_SUBTRACT; + break; default: return false; } @@ -376,6 +379,9 @@ dump_graph(struct pipe_tensor *tensors, unsigned tensor_count, struct pipe_ml_op case PIPE_ML_OPERATION_TYPE_LOGISTIC: teflon_debug("%-6s ", "LOG"); break; + case PIPE_ML_OPERATION_TYPE_SUBTRACT: + teflon_debug("%-6s ", "SUB"); + break; } for (unsigned j = 0; j < operations[i].input_count; j++) { diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index 699a5d94e70..137c9347af9 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -1052,6 +1052,7 @@ enum pipe_ml_operation_type { PIPE_ML_OPERATION_TYPE_RELU, PIPE_ML_OPERATION_TYPE_ABSOLUTE, PIPE_ML_OPERATION_TYPE_LOGISTIC, + PIPE_ML_OPERATION_TYPE_SUBTRACT, }; /**