diff options
author | SiCong Li <sicong.li@arm.com> | 2022-11-23 09:58:18 +0000 |
---|---|---|
committer | Gunes Bayir <gunes.bayir@arm.com> | 2022-12-22 17:42:47 +0000 |
commit | 81fdaddaf36cb4c7ff0d2c52a370dd977a13dc72 (patch) | |
tree | c9e25c9e4b69db153c9594b751ada977594cab8b /arm_compute/dynamic_fusion/sketch/gpu/operators/GpuConv2d.h | |
parent | 8ee689312a64e10d9e39d745fe79b9c5ecb96820 (diff) | |
download | ComputeLibrary-81fdaddaf36cb4c7ff0d2c52a370dd977a13dc72.tar.gz |
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 <sicong.li@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/8687
Benchmark: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com>
Diffstat (limited to 'arm_compute/dynamic_fusion/sketch/gpu/operators/GpuConv2d.h')
-rw-r--r-- | arm_compute/dynamic_fusion/sketch/gpu/operators/GpuConv2d.h | 14 |
1 files changed, 12 insertions, 2 deletions
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, |