diff --git a/ethosu/regor/architecture/ethosu85/ethos_u85_constraints.cpp b/ethosu/regor/architecture/ethosu85/ethos_u85_constraints.cpp index 631a7eb143cc6328903d187c098addc16c11f2d3..11768bf9f06413c5d195cc25b7a380d477355a3d 100644 --- a/ethosu/regor/architecture/ethosu85/ethos_u85_constraints.cpp +++ b/ethosu/regor/architecture/ethosu85/ethos_u85_constraints.cpp @@ -271,6 +271,7 @@ bool EthosU85Constraints::SupportedDtypes(OpType opType, DataType ifmType, DataT else { readonly_span_t ifmTypes = s_defaultAllTypes; + readonly_span_t ifm2Types = s_defaultAllTypes; ofmTypes = s_defaultAllTypes; if ( !std::any_of(ifmTypes.begin(), ifmTypes.end(), [&](auto t) { return t == ifmType; }) ) @@ -278,10 +279,14 @@ bool EthosU85Constraints::SupportedDtypes(OpType opType, DataType ifmType, DataT // Unsupported ifm data type return false; } - if ( IsBinaryElementwise(opType) && ifm2Type != ifmType ) + + if ( IsBinaryElementwise(opType) ) { - // ifm2 data type must match ifm data type - return false; + if ( !std::any_of(ifm2Types.begin(), ifm2Types.end(), [&](auto t) { return t == ifm2Type; }) ) + { + // Unsupported ifm2 data type + return false; + } } }