diff options
author | Teresa Charlin <teresa.charlinreyes@arm.com> | 2024-02-01 17:36:48 +0000 |
---|---|---|
committer | TeresaARM <teresa.charlinreyes@arm.com> | 2024-02-07 13:24:09 +0000 |
commit | a52bca23d225144e92f521341718a70489d5c217 (patch) | |
tree | 2dc88b168900ec89e51dafe564856736ce88f277 /src/backends/gpuFsa/layers/GpuFsaDepthwiseConvolution2d.cpp | |
parent | cf9622f84e22dfb4af1835f02780eb0d8310a624 (diff) | |
download | armnn-a52bca23d225144e92f521341718a70489d5c217.tar.gz |
IVGCVSW-7623: GpuFsa Op: Add Pool2d operator
* Add Pool2d EndToEnd tests to all backends
* Add utility functions for the attributes in a separate file
* Remove some unnecessary includes
Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com>
Change-Id: I0f82ebbf7b3301c6368462fb4fb4d4d02b246fc6
Diffstat (limited to 'src/backends/gpuFsa/layers/GpuFsaDepthwiseConvolution2d.cpp')
-rw-r--r-- | src/backends/gpuFsa/layers/GpuFsaDepthwiseConvolution2d.cpp | 34 |
1 files changed, 8 insertions, 26 deletions
diff --git a/src/backends/gpuFsa/layers/GpuFsaDepthwiseConvolution2d.cpp b/src/backends/gpuFsa/layers/GpuFsaDepthwiseConvolution2d.cpp index a3c3dd9e44..21077afbfb 100644 --- a/src/backends/gpuFsa/layers/GpuFsaDepthwiseConvolution2d.cpp +++ b/src/backends/gpuFsa/layers/GpuFsaDepthwiseConvolution2d.cpp @@ -4,22 +4,25 @@ // #include "GpuFsaDepthwiseConvolution2d.hpp" +#include "UtilsGpuFsa.hpp" + #include <backendsCommon/WorkloadUtils.hpp> #include <aclCommon/ArmComputeTensorUtils.hpp> -#include <arm_compute/dynamic_fusion/runtime/gpu/cl/ClWorkloadRuntime.h> #include <arm_compute/dynamic_fusion/sketch/gpu/GpuWorkloadContext.h> +#include <arm_compute/dynamic_fusion/sketch/gpu/GpuWorkloadSketch.h> #include <arm_compute/dynamic_fusion/sketch/gpu/operators/GpuDepthwiseConv2d.h> #include <arm_compute/dynamic_fusion/sketch/gpu/operators/GpuOutput.h> #include <vector> +using namespace arm_compute::experimental::dynamic_fusion; +using namespace armnn::armcomputetensorutils; + namespace armnn { -using namespace armcomputetensorutils; - arm_compute::Status GpuFsaDepthwiseConvolution2dValidate(const TensorInfo& input, const DepthwiseConvolution2dDescriptor& descriptor, const TensorInfo& weights, @@ -71,17 +74,7 @@ arm_compute::Status GpuFsaDepthwiseConvolution2dValidate(const TensorInfo& input biasSketchInfoPtr = workloadContext.create_tensor_info(aclBiasInfo); } - // Set DepthwiseConv2d attributes using descriptor - const arm_compute::Size2D aclDilationInfo = BuildArmComputeSize2D(descriptor.m_DilationX, - descriptor.m_DilationY); - const arm_compute::Padding2D aclPadInfo = BuildArmComputePaddingInfo(descriptor); - const arm_compute::Size2D aclStrideInfo = BuildArmComputeSize2D(descriptor.m_StrideX, descriptor.m_StrideY); - - DepthwiseConv2dAttributes depthwiseConv2dAttributes{}; - depthwiseConv2dAttributes.pad(aclPadInfo); - depthwiseConv2dAttributes.stride(aclStrideInfo); - depthwiseConv2dAttributes.dilation(aclDilationInfo); - depthwiseConv2dAttributes.depth_multiplier(aclDepthMultiplier); + DepthwiseConv2dAttributes depthwiseConv2dAttributes = CreateDWConv2dAttributes(descriptor, aclDepthMultiplier); // Validate operator, check status and update reasonIfUnsupported arm_compute::Status aclStatus = GpuDepthwiseConv2d::validate_op(sketch, @@ -110,7 +103,6 @@ void GpuFsaDepthwiseConvolution2dCreateOp(GpuFsaPreCompiledBlob* blob, * as the TensorInfos used when creating the Tensors must match those used to create the Sketch. Otherwise the runtime * doesn't know which Tensors to use. */ - using namespace arm_compute::experimental::dynamic_fusion; GpuWorkloadSketch* sketch = blob->sketch.get(); GpuWorkloadContext* workloadContext = blob->workloadContext.get(); std::vector<arm_compute::ITensorInfo*> inputTensorInfos = {}; @@ -157,17 +149,7 @@ void GpuFsaDepthwiseConvolution2dCreateOp(GpuFsaPreCompiledBlob* blob, biasSketchInfoPtr = inputTensorInfos[2]; } - // Set DepthwiseConv2d attributes using descriptor - const arm_compute::Size2D aclDilationInfo = BuildArmComputeSize2D(descriptor.m_DilationX, - descriptor.m_DilationY); - const arm_compute::Padding2D aclPadInfo = BuildArmComputePaddingInfo(descriptor); - const arm_compute::Size2D aclStrideInfo = BuildArmComputeSize2D(descriptor.m_StrideX, descriptor.m_StrideY); - - DepthwiseConv2dAttributes depthwiseConv2dAttributes{}; - depthwiseConv2dAttributes.pad(aclPadInfo); - depthwiseConv2dAttributes.stride(aclStrideInfo); - depthwiseConv2dAttributes.dilation(aclDilationInfo); - depthwiseConv2dAttributes.depth_multiplier(aclDepthMultiplier); + DepthwiseConv2dAttributes depthwiseConv2dAttributes = CreateDWConv2dAttributes(descriptor, aclDepthMultiplier); // Validate operator, check status and update reasonIfUnsupported arm_compute::Status aclStatus = GpuDepthwiseConv2d::validate_op(*sketch, |