Add multiple output support for dynamic fusion
* The dependency graph now can schedule any acyclic graph into
a sequential list of operators. This is needed as the output
operators now form branches in the graph.
* Fix the definition of input, output and intermediate tensors
in GpuKernelComponentGroup to support non-linear but sequential
list of operators.
* Add constraint on GpuOperatorGroup to enforce strictly linear
fusion style, but allow output operator as the only form of
branch.
Resolves: COMPMID-5771
Signed-off-by: Viet-Hoa Do <viet-hoa.do@arm.com>
Change-Id: I68de3a31a2456145081f0a397e4e61dd66327682
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/8823
Reviewed-by: Gunes Bayir <gunes.bayir@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
diff --git a/src/dynamic_fusion/sketch/gpu/GpuOperatorGroup.h b/src/dynamic_fusion/sketch/gpu/GpuOperatorGroup.h
index 35abe6c..308a9d7 100644
--- a/src/dynamic_fusion/sketch/gpu/GpuOperatorGroup.h
+++ b/src/dynamic_fusion/sketch/gpu/GpuOperatorGroup.h
@@ -77,17 +77,19 @@
static constexpr size_t max_fused_operators = 32;
/** Try adding (without actually adding) an operator to the group
*
- * @param[in] op Operator to be added
+ * @param[in] op Operator to be added
+ * @param[in] is_output Whether this operator is the output operator.
*
* @return true If @p op can be added while maintaining the invariants
* @return false Otherwise
*/
- bool try_add_operator(const Operator &op) const;
+ bool try_add_operator(const Operator &op, bool is_output = false) const;
/** Add an operator to the group
*
- * @param[in] op Operator to be added
+ * @param[in] op Operator to be added
+ * @param[in] is_output Whether this operator is the output operator.
*/
- void add_operator(const Operator &op);
+ void add_operator(const Operator &op, bool is_output = false);
/** Create a new operator
*
* @param[in] operator_type @ref GpuOperatorType of the new operator