diff --git a/ethosu/regor/architecture/ethosu55/ethos_u55.cpp b/ethosu/regor/architecture/ethosu55/ethos_u55.cpp index 3fea9e9f467f6e4dd238ac2d014a977c33dc9b3b..39c8112043116ac64d1cb038050bc13ae7dee0eb 100644 --- a/ethosu/regor/architecture/ethosu55/ethos_u55.cpp +++ b/ethosu/regor/architecture/ethosu55/ethos_u55.cpp @@ -727,12 +727,20 @@ void ArchEthosU55::Call(std::function callBack) int EthosU55OpGroup::Add(const ArchitectureOpGroupQuery &op, const std::vector &dependsOn) { LOG_TRACE1("Trying to add op {}\n", OpTypeToString(op.type)); - if ( _opsCount >= 2 ) { // Can only fuse 2 ops return 0; } + else if ( _opsCount == 1 ) + { + // Can not fuse to DMA or Compound operators + auto hwOp = ArchEthosU55::GetHWOp(_ops[0].type); + if ( hwOp == EthosU55NpuOp::Dma || hwOp == EthosU55NpuOp::Compound ) + { + return 0; + } + } if ( !CanRunOnNPU(op) ) { diff --git a/ethosu/regor/architecture/ethosu85/ethos_u85.cpp b/ethosu/regor/architecture/ethosu85/ethos_u85.cpp index 45e158746fbe08cee72a903365a341e35010cc67..5ff354547bd5d3da4695882caf737ffdfd1cae8b 100644 --- a/ethosu/regor/architecture/ethosu85/ethos_u85.cpp +++ b/ethosu/regor/architecture/ethosu85/ethos_u85.cpp @@ -1419,6 +1419,11 @@ int EthosU85OpGroup::ExternalIfms(const ArchitectureOpGroupQuery &op) bool EthosU85OpGroup::Fuse(const ArchitectureOpGroupQuery &op, const std::vector &dependsOn) { assert(_opsCount > 0); + if ( !_supportsFusing ) + { + return false; + } + if ( _chainLength > 1 ) { // TODO MLBEDSW-9142: support fusing on chained ops @@ -1584,6 +1589,7 @@ int EthosU85OpGroup::Add(const ArchitectureOpGroupQuery &op, const std::vector