diff options
author | Louis Verhaard <louis.verhaard@arm.com> | 2020-05-25 15:05:26 +0200 |
---|---|---|
committer | Tim Hall <tim.hall@arm.com> | 2020-06-18 17:53:52 +0100 |
commit | 7db78969dc8ead72f3ded81b6d2a6a7ed798ea62 (patch) | |
tree | 011bcf579cc8e0f007f9564a98cc5c05df34322b /ethosu/vela/shared_buffer_allocation.py | |
parent | 78792223369fa34dacd0e69e189af035283da2ae (diff) | |
download | ethos-u-vela-7db78969dc8ead72f3ded81b6d2a6a7ed798ea62.tar.gz |
MLBEDSW-2067: added custom exceptions
Added custom exceptions to handle different types of input errors.
Also performed minor formatting changes using flake8/black.
Change-Id: Ie5b05361507d5e569aff045757aec0a4a755ae98
Signed-off-by: Louis Verhaard <louis.verhaard@arm.com>
Diffstat (limited to 'ethosu/vela/shared_buffer_allocation.py')
-rw-r--r-- | ethosu/vela/shared_buffer_allocation.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ethosu/vela/shared_buffer_allocation.py b/ethosu/vela/shared_buffer_allocation.py index 335b863f..2bfe5941 100644 --- a/ethosu/vela/shared_buffer_allocation.py +++ b/ethosu/vela/shared_buffer_allocation.py @@ -22,6 +22,7 @@ from .architecture_features import Block from .architecture_features import Kernel from .architecture_features import SharedBufferArea from .architecture_features import SHRAMElements +from .errors import OptionError from .operation import NpuBlockType @@ -163,8 +164,11 @@ def find_block_configs_suitable_for_pass_and_shared_buffer(arch, ps): if arch.override_block_config: config = alloc.try_block(arch.override_block_config) - assert config, "Block config override cannot be used" - return [config] + raise OptionError( + "--force-block-config", + str(arch.override_block_config), + "This forced block config value cannot be used; it is not compatible", + ) # Constrain the search space if the OFM is smaller than the max block size # - Add other block search constraints here if required |