From f2800fe13b9344fd7434a0fc5a635a43329212a2 Mon Sep 17 00:00:00 2001 From: "Rob Herring (Arm)" Date: Wed, 18 Mar 2026 17:20:03 -0500 Subject: [PATCH] teflon: Add hard swish operation Add the plumbing for hard swish operations. Signed-off-by: Rob Herring (Arm) 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 43199d0f193..f18df0800d1 100644 --- a/src/gallium/frontends/teflon/tfl_device.c +++ b/src/gallium/frontends/teflon/tfl_device.c @@ -258,6 +258,9 @@ fill_operation(struct teflon_delegate *delegate, TfLiteContext *tf_context, TfLi case kTfLiteBuiltinTanh: operation->type = PIPE_ML_OPERATION_TYPE_TANH; break; + case kTfLiteBuiltinHardSwish: + operation->type = PIPE_ML_OPERATION_TYPE_HSWISH; + break; case kTfLiteBuiltinSub: operation->type = PIPE_ML_OPERATION_TYPE_SUBTRACT; break; @@ -486,6 +489,9 @@ dump_graph(struct pipe_tensor *tensors, unsigned tensor_count, struct pipe_ml_op case PIPE_ML_OPERATION_TYPE_TANH: teflon_debug("%-15s ", "TANH"); break; + case PIPE_ML_OPERATION_TYPE_HSWISH: + teflon_debug("%-15s ", "HSWISH"); + break; case PIPE_ML_OPERATION_TYPE_SUBTRACT: teflon_debug("%-15s ", "SUB"); break; diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index ccba0f74050..cd2b8217f2b 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -1062,6 +1062,7 @@ enum pipe_ml_operation_type { PIPE_ML_OPERATION_TYPE_ABSOLUTE, PIPE_ML_OPERATION_TYPE_LOGISTIC, PIPE_ML_OPERATION_TYPE_TANH, + PIPE_ML_OPERATION_TYPE_HSWISH, PIPE_ML_OPERATION_TYPE_SUBTRACT, PIPE_ML_OPERATION_TYPE_TRANSPOSE, PIPE_ML_OPERATION_TYPE_STRIDED_SLICE,