diff options
author | Jacob Bohlin <jacob.bohlin@arm.com> | 2021-02-11 16:04:53 +0100 |
---|---|---|
committer | Jacob Bohlin <jacob.bohlin@arm.com> | 2021-02-12 08:46:12 +0100 |
commit | 2a58530de2686a3dc1cbe791f1f951b9ea7c39aa (patch) | |
tree | 53d980b6b4e1e62152736b00612b57d57038b998 /ethosu/vela/shared_buffer_allocation.py | |
parent | 2446e59a9083f36f85beb88fdec6379d90b85cad (diff) | |
download | ethos-u-vela-2a58530de2686a3dc1cbe791f1f951b9ea7c39aa.tar.gz |
MLBEDSW-3600: Cascading support for ResizeBilinear
Signed-off-by: Jacob Bohlin <jacob.bohlin@arm.com>
Change-Id: I7899263ff5bb3d0de00681ee8351a02eecff1553
Diffstat (limited to 'ethosu/vela/shared_buffer_allocation.py')
-rw-r--r-- | ethosu/vela/shared_buffer_allocation.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/ethosu/vela/shared_buffer_allocation.py b/ethosu/vela/shared_buffer_allocation.py index 20438648..ea4aaf0c 100644 --- a/ethosu/vela/shared_buffer_allocation.py +++ b/ethosu/vela/shared_buffer_allocation.py @@ -1,4 +1,4 @@ -# Copyright (C) 2020 Arm Limited or its affiliates. All rights reserved. +# Copyright (C) 2020-2021 Arm Limited or its affiliates. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 # @@ -279,10 +279,13 @@ def find_suitable_block_configs(arch, alloc: SharedBufferAllocation) -> List[Tup max_block_height = min(arch.ofm_block_max.height, max_block_height) max_block_depth = min(arch.ofm_block_max.depth, max_block_depth) + min_block_height = max(arch.ofm_ublock.height, 2 if alloc.ifm_resampling_mode != resampling_mode.NONE else 1) + min_block_width = max(arch.ofm_ublock.width, 2 if alloc.ifm_resampling_mode != resampling_mode.NONE else 1) + valid_block_configs = [] # Try a range of block shapes against this pass - for w in range(arch.ofm_ublock.width, max_block_width + arch.ofm_ublock.width, arch.ofm_ublock.width): - for h in range(arch.ofm_ublock.height, max_block_height + arch.ofm_ublock.height, arch.ofm_ublock.height): + for w in range(min_block_width, max_block_width + min_block_width, min_block_width): + for h in range(min_block_height, max_block_height + min_block_height, min_block_height): # Try valid OFM block depths for c in range(arch.ofm_ublock.depth, max_block_depth + arch.ofm_ublock.depth, arch.ofm_ublock.depth): # OFM block depth has the constraint that if it causes the OFM to be |