teflon: Add hard swish operation

Add the plumbing for hard swish operations.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39975>
This commit is contained in:
Rob Herring (Arm) 2026-03-18 17:20:03 -05:00 committed by Marge Bot
parent a305dfd54b
commit f2800fe13b
2 changed files with 7 additions and 0 deletions

View file

@ -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;

View file

@ -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,