From 81fdaddaf36cb4c7ff0d2c52a370dd977a13dc72 Mon Sep 17 00:00:00 2001 From: SiCong Li Date: Wed, 23 Nov 2022 09:58:18 +0000 Subject: Add is_supported_op interface * This retains the behaviors of the current library's validate() method. I.e. is_supported_op() is used to check the support level and validity of an operator configuration without any consideration of fusion. - validate_op() interface still checks both the op validity and the fusion validity - This arrangement ensures that any users of the original validate() interface can expect to use is_supported_op() in exactly the same way with no performance or behavioral difference. * Force adding const tensors to ArgumentPack when adding to OperatorGroup. This is because OperatorGroup is only for validating fusion, and does not mutate TensorInfos at all Partially resolves COMPMID-5736 Change-Id: I4157677f55848d66a08ec00e6a76d13a24b722b7 Signed-off-by: SiCong Li Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/8687 Benchmark: Arm Jenkins Tested-by: Arm Jenkins Reviewed-by: Gian Marco Iodice --- .../dynamic_fusion/sketch/gpu/operators/GpuConv2d.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'arm_compute/dynamic_fusion') diff --git a/arm_compute/dynamic_fusion/sketch/gpu/operators/GpuConv2d.h b/arm_compute/dynamic_fusion/sketch/gpu/operators/GpuConv2d.h index fe9108d356..76decfd6cf 100644 --- a/arm_compute/dynamic_fusion/sketch/gpu/operators/GpuConv2d.h +++ b/arm_compute/dynamic_fusion/sketch/gpu/operators/GpuConv2d.h @@ -34,6 +34,7 @@ namespace experimental namespace dynamic_fusion { /** Forward declaration */ +class GpuWorkloadContext; class GpuWorkloadSketch; /** Operator interface. */ @@ -59,7 +60,7 @@ public: * @param[in] src Source tensor * @param[in] wei Weight tensor * @param[in] bia (Optional) Bias tensor - * @param[out] dst Destination tensor + * @param[out] dst Destination tensor. If an uninitialized ITensorInfo is passed in, it will be auto-initialized * @param[in] attributes Operator attributes */ static void create_op(GpuWorkloadSketch &sketch, @@ -68,7 +69,16 @@ public: ITensorInfo *bia, ITensorInfo *dst, const Attributes &attributes); - /** Validate the operator and check if it can be fused into the workload sketch. + /** Check if the operator configuration is supported, irrespective of fusion + * Similar to @ref GpuConv2d::create_op() + */ + static Status is_supported_op(const GpuWorkloadContext &context, + const ITensorInfo *src, + const ITensorInfo *wei, + const ITensorInfo *bia, + const ITensorInfo *dst, + const Attributes &attributes); + /** Check if the operator configuration is supported and if it can be fused into the workload sketch. * Similar to @ref GpuConv2d::create_op() */ static Status validate_op(const GpuWorkloadSketch &sketch, -- cgit v1.2.1