mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-03 08:30:44 +02:00
ethosu: Fix U85 AvgPool for greater than 8x8 kernel sizes
The U85 uses average mode for kernel sizes less than or equal to 8x8 and sum mode for larger (in either dimension) kernel sizes. According to the U85 TRM, the average and sum modes have the following constraints: average - Average pooling up to 8x8, inbuilt scale only sum - Sum or average pooling, per-channel, or global scale Reviewed-by: Tomeu Vizoso <tomeu@tomeuvizoso.net> Signed-off-by: Rob Herring (Arm) <robh@kernel.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40719>
This commit is contained in:
parent
cabc55e9a5
commit
e89a672ab7
1 changed files with 6 additions and 1 deletions
|
|
@ -171,7 +171,12 @@ ethosu_lower_pooling(struct ethosu_subgraph *subgraph,
|
|||
operation->pooling.type = ETHOSU_POOLING_TYPE_MAX;
|
||||
break;
|
||||
case PIPE_ML_POOLING_TYPE_AVG:
|
||||
operation->pooling.type = ETHOSU_POOLING_TYPE_AVG;
|
||||
if (ethosu_ml_device(subgraph->base.device)->is_u65 ||
|
||||
((poperation->pooling.filter_height <= 8) &&
|
||||
(poperation->pooling.filter_width <= 8)))
|
||||
operation->pooling.type = ETHOSU_POOLING_TYPE_AVG;
|
||||
else
|
||||
operation->pooling.type = ETHOSU_POOLING_TYPE_SUM;
|
||||
break;
|
||||
default:
|
||||
assert(0 && "Unsupported pooling type");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue