diff options
author | Charles Xu <charles.xu@arm.com> | 2020-04-22 08:31:43 +0200 |
---|---|---|
committer | Tim Hall <tim.hall@arm.com> | 2020-06-18 17:53:52 +0100 |
commit | 3e9c4341acf6b8334977288e2079fec0be92ecb3 (patch) | |
tree | 579178aa8d2e69feb7faa5cc3a1b4173b0fe16a2 /ethosu/vela/register_command_stream_generator.py | |
parent | 286bd5e1f99242b1f7bf6ba628fc60ac03e91162 (diff) | |
download | ethos-u-vela-3e9c4341acf6b8334977288e2079fec0be92ecb3.tar.gz |
MLBEDSW-1906: Extend IFM to full dimension
Extend IFM to full dimension for the performance
metrics calculation.
Change-Id: Iae923e37280ab0f22b7a272f28970973a5142534
Signed-off-by: Charles Xu <charles.xu@arm.com>
Diffstat (limited to 'ethosu/vela/register_command_stream_generator.py')
-rw-r--r-- | ethosu/vela/register_command_stream_generator.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/ethosu/vela/register_command_stream_generator.py b/ethosu/vela/register_command_stream_generator.py index 14898607..c0402b32 100644 --- a/ethosu/vela/register_command_stream_generator.py +++ b/ethosu/vela/register_command_stream_generator.py @@ -46,6 +46,7 @@ from .numeric_util import quantise_float32 from .numeric_util import round_away_zero from .numeric_util import round_up from .numeric_util import round_up_to_int +from .numeric_util import full_shape from .operation import NpuBlockType from .shared_buffer_allocation import SharedBufferAllocation from .tensor import MemArea @@ -266,10 +267,6 @@ def get_op_kernel(ps): return Kernel(k_w, k_h, strides[2], strides[1], dilation[2], dilation[1]) -def full_shape(shape, fill): - return ([fill] * (4 - len(shape))) + shape - - def has_prev_op_dependency(prev_cmd, cmd): if prev_cmd is None: return False @@ -282,14 +279,14 @@ def has_prev_op_dependency(prev_cmd, cmd): def get_op_ofm_rect(cmd): - start = full_shape(cmd.ofm_box.start_coord, 0) - end = full_shape(cmd.ofm_box.end_coord, 1) + start = full_shape(4, cmd.ofm_box.start_coord, 0) + end = full_shape(4, cmd.ofm_box.end_coord, 1) return Rect(start[-2], start[-3], start[-1], end[-2] - 1, end[-3] - 1, end[-1] - 1) def get_op_ifm_rect(cmd): - start = full_shape(cmd.ifm_box.start_coord, 0) - end = full_shape(cmd.ifm_box.end_coord, 1) + start = full_shape(4, cmd.ifm_box.start_coord, 0) + end = full_shape(4, cmd.ifm_box.end_coord, 1) return Rect(start[-2], start[-3], start[-1], end[-2] - 1, end[-3] - 1, end[-1] - 1) |