diff options
author | Mike Kelly <mike.kelly@arm.com> | 2020-11-12 10:58:48 +0000 |
---|---|---|
committer | Jim Flynn <jim.flynn@arm.com> | 2020-11-13 14:25:30 +0000 |
commit | 07810fc2fcdd34db74222d90cc73ef12a88e7b78 (patch) | |
tree | 8becef8453674822d079815b06ae37310b97d2cf /src/backends/cl/workloads/ClDepthwiseConvolutionWorkload.cpp | |
parent | 8502adeafbbb1db0acefa62560d93453e38dcadb (diff) | |
download | armnn-07810fc2fcdd34db74222d90cc73ef12a88e7b78.tar.gz |
IVGCVSW-5328-5329 Fuse Activation
* Added Fused Activation Optimization to both CL and Neon backends.
* Added Fused Activation support to all the CL and Neon workloads
that support it.
* Changed ProfilingTest network to be a Convolution layer
followed by an Abs layer rather than an Activation layer.
* Added IBackendInternal::OptimizeSubgraphView function that can accept a
ModelOptions.
* Network will now call OptimizeSubgraphView passing in the ModelOptions.
Signed-off-by: Keith Davis <keith.davis@arm.com>
Signed-off-by: Mike Kelly <mike.kelly@arm.com>
Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com>
Change-Id: Ib536ac3cbafc7d9b35c139ad9a65b7735262cd9d
Diffstat (limited to 'src/backends/cl/workloads/ClDepthwiseConvolutionWorkload.cpp')
-rw-r--r-- | src/backends/cl/workloads/ClDepthwiseConvolutionWorkload.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/backends/cl/workloads/ClDepthwiseConvolutionWorkload.cpp b/src/backends/cl/workloads/ClDepthwiseConvolutionWorkload.cpp index 8704b1276f..53f16848eb 100644 --- a/src/backends/cl/workloads/ClDepthwiseConvolutionWorkload.cpp +++ b/src/backends/cl/workloads/ClDepthwiseConvolutionWorkload.cpp @@ -8,11 +8,13 @@ #include <ResolveType.hpp> #include "ClWorkloadUtils.hpp" +#include <armnn/Exceptions.hpp> #include <aclCommon/ArmComputeUtils.hpp> #include <aclCommon/ArmComputeTensorUtils.hpp> #include <cl/ClTensorHandle.hpp> #include <backendsCommon/CpuTensorHandle.hpp> #include <backendsCommon/WorkloadUtils.hpp> +#include <backendsCommon/WorkloadData.hpp> #include <arm_compute/runtime/CL/functions/CLDepthwiseConvolutionLayer.h> @@ -25,7 +27,8 @@ arm_compute::Status ClDepthwiseConvolutionWorkloadValidate(const TensorInfo& inp const TensorInfo& output, const DepthwiseConvolution2dDescriptor& descriptor, const TensorInfo& weights, - const Optional<TensorInfo>& biases) + const Optional<TensorInfo>& biases, + const ActivationDescriptor* activationDescriptor) { const arm_compute::TensorInfo aclInputInfo = BuildArmComputeTensorInfo(input, descriptor.m_DataLayout); const arm_compute::TensorInfo aclOutputInfo = BuildArmComputeTensorInfo(output, descriptor.m_DataLayout); @@ -56,13 +59,16 @@ arm_compute::Status ClDepthwiseConvolutionWorkloadValidate(const TensorInfo& inp descriptor.m_DilationX, descriptor.m_DilationY); + const arm_compute::ActivationLayerInfo activationInfo = ConvertActivationDescriptorToAclActivationLayerInfo( + activationDescriptor); + return arm_compute::CLDepthwiseConvolutionLayer::validate(&aclInputInfo, &aclWeightsInfo, optionalAclBiasesInfo, &aclOutputInfo, aclPadStrideInfo, aclDepthMultiplier, - arm_compute::ActivationLayerInfo(), + activationInfo, aclDilationInfo); } @@ -114,6 +120,8 @@ ClDepthwiseConvolutionWorkload::ClDepthwiseConvolutionWorkload( arm_compute::PadStrideInfo padStrideInfo = BuildArmComputePadStrideInfo(m_Data.m_Parameters); + const arm_compute::ActivationLayerInfo activationInfo = ConvertAdditionalInfoToAclActivationLayerInfo(descriptor); + m_DepthwiseConvolutionLayer = std::make_unique<arm_compute::CLDepthwiseConvolutionLayer>(); static_cast<arm_compute::CLDepthwiseConvolutionLayer*>(m_DepthwiseConvolutionLayer.get())->configure( &input, @@ -122,7 +130,7 @@ ClDepthwiseConvolutionWorkload::ClDepthwiseConvolutionWorkload( &output, padStrideInfo, depthMultiplier, - arm_compute::ActivationLayerInfo(), + activationInfo, aclDilationInfo); ARMNN_ASSERT(m_DepthwiseConvolutionLayer); |