From 68a04b129c8c341d4c1a621c04cfe5306390300c Mon Sep 17 00:00:00 2001 From: Jacob Bohlin Date: Mon, 13 Jul 2020 11:39:36 +0200 Subject: MLBEDSW-2641: Fix crash for network with only CPU ops Signed-off-by: Jacob Bohlin Change-Id: Ia9c70d62c6abc827cbdf73a8bb37afd595796741 --- ethosu/vela/insert_dma.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ethosu/vela/insert_dma.py') diff --git a/ethosu/vela/insert_dma.py b/ethosu/vela/insert_dma.py index 5c05fc8f..4ea4621d 100644 --- a/ethosu/vela/insert_dma.py +++ b/ethosu/vela/insert_dma.py @@ -27,8 +27,9 @@ binary_elementwise_op = set(("AddAct", "MulAct", "SubAct", "Maximum", "Minimum") def insert_dma_cmd(op, arch): - if op.type == "DMA": - return op # Already rewritten + if op.type == "DMA" or not op.run_on_npu: + return op + for idx, tens in enumerate(op.inputs): if tens.mem_type not in (MemType.Scratch, MemType.Scratch_fast): -- cgit v1.2.1