ethosu: Handle IFM2 H/W/D broadcast

If the IFM and IFM2 dimensions are not the same, then the H/W/D broadcast
needs to be enabled.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40525>
This commit is contained in:
Rob Herring (Arm) 2026-03-19 14:18:57 -05:00 committed by Marge Bot
parent 1cb46e9304
commit 3780fb8494
2 changed files with 12 additions and 5 deletions

View file

@ -1,13 +1,9 @@
Models.Op/efficientdet_efficientdet_tflite_lite0_int8_v1,Fail
Models.Op/movenetlightning_112,Fail
Models.Op/movenetlightning_115,Fail
Models.Op/movenetlightning_118,Fail
Models.Op/movenetlightning_141,Fail
Models.Op/movenetlightning_152,Fail
Models.Op/movenetlightning_movenet_single_pose_lightning_ptq,Fail
Models.Op/movenetthunder_112,Fail
Models.Op/movenetthunder_115,Fail
Models.Op/movenetthunder_118,Fail
Models.Op/movenetthunder_141,Fail
Models.Op/movenetthunder_152,Fail
Models.Op/movenetthunder_movenet_single_pose_thunder_ptq,Fail

View file

@ -381,10 +381,21 @@ emit_ifm2(struct ethosu_subgraph *subgraph, struct ethosu_operation *operation,
static void
emit_ifm2_broadcast(struct ethosu_subgraph *subgraph, struct ethosu_operation *operation, bool has_scalar)
{
unsigned ifm2_broadcast = has_scalar ? NPU_SET_IFM2_BROADCAST_BROADCAST_SCALAR(1) : 0;
unsigned ifm2_broadcast = 0;
ifm2_broadcast |= NPU_SET_IFM2_BROADCAST_OPERAND_ORDER(operation->eltwise.ifm_reversed);
if (has_scalar) {
ifm2_broadcast |= NPU_SET_IFM2_BROADCAST_BROADCAST_SCALAR(1);
} else {
if (operation->ifm.shape.height != operation->ifm2.shape.height)
ifm2_broadcast |= NPU_SET_IFM2_BROADCAST_BROADCAST_HEIGHT__MASK;
if (operation->ifm.shape.width != operation->ifm2.shape.width)
ifm2_broadcast |= NPU_SET_IFM2_BROADCAST_BROADCAST_WIDTH__MASK;
if (operation->ifm.shape.depth != operation->ifm2.shape.depth)
ifm2_broadcast |= NPU_SET_IFM2_BROADCAST_BROADCAST_DEPTH__MASK;
}
EMIT0(NPU_SET_IFM2_BROADCAST, ifm2_broadcast);
}