diff options
Diffstat (limited to 'ethosu/vela/pass_packing.py')
-rw-r--r-- | ethosu/vela/pass_packing.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/ethosu/vela/pass_packing.py b/ethosu/vela/pass_packing.py index 5a9f9575..e43a9191 100644 --- a/ethosu/vela/pass_packing.py +++ b/ethosu/vela/pass_packing.py @@ -39,6 +39,7 @@ class PassFlags(enum.Flag): StartupInit = 64 MemoryOnly = 128 PostFusingLimited = 256 + Memcpy = 512 mac_main_ops = set( @@ -95,6 +96,7 @@ memory_only_ops = set( Op.ExpandDims, ) ) +memcpy_ops = set((Op.Memcpy,)) test_sequence = [ @@ -160,6 +162,16 @@ test_sequence = [ ), ( # ops_set + memcpy_ops, + # incompatible_pack_flags + PassFlags.Cpu | PassFlags.MemoryOnly | PassFlags.Mac | PassFlags.Main | PassFlags.PostFusingLimited, + # flags_to_set + PassFlags.Npu | PassFlags.Memcpy | PassFlags.Main, + # flags_to_clear + PassFlags.Empty, + ), + ( + # ops_set cpu_ops, # incompatible_pack_flags PassFlags.Npu | PassFlags.MemoryOnly | PassFlags.Main, @@ -248,7 +260,11 @@ def pack_into_passes(nng, arch, verbose_packing=False): if flags_to_set & PassFlags.Npu: if flags_to_set & ( - PassFlags.Mac | PassFlags.ElementWise | PassFlags.Post | PassFlags.PostFusingLimited + PassFlags.Mac + | PassFlags.ElementWise + | PassFlags.Post + | PassFlags.PostFusingLimited + | PassFlags.Memcpy ): assert len(curr_op.inputs) >= 1 ifm_tensor = curr_op.ifm |