aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAron Virginas-Tar <Aron.Virginas-Tar@arm.com>2019-11-14 16:21:38 +0000
committerAron Virginas-Tar <Aron.Virginas-Tar@arm.com>2019-11-14 16:41:45 +0000
commitf4c502f54cc978c1b34f3beaf6b9cc0cd1ecc7e8 (patch)
tree83b603bd477d0a67bce81a5e8722952376ff62e9
parent931389591fcf4f48745bec67bd7e59bb0319a403 (diff)
downloadarmnn-f4c502f54cc978c1b34f3beaf6b9cc0cd1ecc7e8.tar.gz
Fix redundancy in call to configure() in ACL DepthwiseConvolution workloads
Signed-off-by: Aron Virginas-Tar <Aron.Virginas-Tar@arm.com> Change-Id: I8f698c6ec9826ce1188bc43bd59fbf7b83455c1a
-rw-r--r--src/backends/cl/workloads/ClDepthwiseConvolutionWorkload.cpp39
-rw-r--r--src/backends/neon/workloads/NeonDepthwiseConvolutionWorkload.cpp52
2 files changed, 20 insertions, 71 deletions
diff --git a/src/backends/cl/workloads/ClDepthwiseConvolutionWorkload.cpp b/src/backends/cl/workloads/ClDepthwiseConvolutionWorkload.cpp
index eb837d74b9..858eab4e00 100644
--- a/src/backends/cl/workloads/ClDepthwiseConvolutionWorkload.cpp
+++ b/src/backends/cl/workloads/ClDepthwiseConvolutionWorkload.cpp
@@ -114,35 +114,16 @@ ClDepthwiseConvolutionWorkload::ClDepthwiseConvolutionWorkload(
arm_compute::PadStrideInfo padStrideInfo = BuildArmComputePadStrideInfo(m_Data.m_Parameters);
- // Check for optimisation opportunities.
- bool use3x3Optimisation = (weightInfo.GetShape()[2] == 3) && (weightInfo.GetShape()[3] == 3);
- if (use3x3Optimisation)
- {
- m_DepthwiseConvolutionLayer = std::make_unique<arm_compute::CLDepthwiseConvolutionLayer>();
- static_cast<arm_compute::CLDepthwiseConvolutionLayer*>(m_DepthwiseConvolutionLayer.get())->configure(
- &input,
- m_KernelTensor.get(),
- m_BiasTensor.get(),
- &output,
- padStrideInfo,
- depthMultiplier,
- arm_compute::ActivationLayerInfo(),
- aclDilationInfo);
- }
- else
- {
- m_DepthwiseConvolutionLayer = std::make_unique<arm_compute::CLDepthwiseConvolutionLayer>();
- static_cast<arm_compute::CLDepthwiseConvolutionLayer*>(m_DepthwiseConvolutionLayer.get())->configure(
- &input,
- m_KernelTensor.get(),
- m_BiasTensor.get(),
- &output,
- padStrideInfo,
- depthMultiplier,
- arm_compute::ActivationLayerInfo(),
- aclDilationInfo);
-
- }
+ m_DepthwiseConvolutionLayer = std::make_unique<arm_compute::CLDepthwiseConvolutionLayer>();
+ static_cast<arm_compute::CLDepthwiseConvolutionLayer*>(m_DepthwiseConvolutionLayer.get())->configure(
+ &input,
+ m_KernelTensor.get(),
+ m_BiasTensor.get(),
+ &output,
+ padStrideInfo,
+ depthMultiplier,
+ arm_compute::ActivationLayerInfo(),
+ aclDilationInfo);
BOOST_ASSERT(m_DepthwiseConvolutionLayer);
diff --git a/src/backends/neon/workloads/NeonDepthwiseConvolutionWorkload.cpp b/src/backends/neon/workloads/NeonDepthwiseConvolutionWorkload.cpp
index 2093613513..f039a6bdbe 100644
--- a/src/backends/neon/workloads/NeonDepthwiseConvolutionWorkload.cpp
+++ b/src/backends/neon/workloads/NeonDepthwiseConvolutionWorkload.cpp
@@ -113,48 +113,16 @@ NeonDepthwiseConvolutionWorkload::NeonDepthwiseConvolutionWorkload(
arm_compute::PadStrideInfo padStrideInfo = BuildArmComputePadStrideInfo(m_Data.m_Parameters);
- const arm_compute::ITensorInfo* inputInfo = input.info();
- const arm_compute::ITensorInfo* kernelInfo = m_KernelTensor->info();
- const arm_compute::ITensorInfo* biasInfo = m_BiasTensor ? m_BiasTensor->info() : nullptr;
- const arm_compute::ITensorInfo* outputInfo = output.info();
-
- // Check for optimisation opportunities
- arm_compute::Status optimizationStatus =
- arm_compute::NEDepthwiseConvolutionLayer::validate(inputInfo,
- kernelInfo,
- biasInfo,
- outputInfo,
- padStrideInfo,
- depthMultiplier,
- arm_compute::ActivationLayerInfo(),
- aclDilationInfo);
-
- if (optimizationStatus.error_code() == arm_compute::ErrorCode::OK)
- {
- m_pDepthwiseConvolutionLayer = std::make_unique<arm_compute::NEDepthwiseConvolutionLayer>();
- static_cast<arm_compute::NEDepthwiseConvolutionLayer*>(
- m_pDepthwiseConvolutionLayer.get())->configure(&input,
- m_KernelTensor.get(),
- m_BiasTensor.get(),
- &output,
- padStrideInfo,
- depthMultiplier,
- arm_compute::ActivationLayerInfo(),
- aclDilationInfo);
- }
- else
- {
- m_pDepthwiseConvolutionLayer = std::make_unique<arm_compute::NEDepthwiseConvolutionLayer>();
- static_cast<arm_compute::NEDepthwiseConvolutionLayer*>(
- m_pDepthwiseConvolutionLayer.get())->configure(&input,
- m_KernelTensor.get(),
- m_BiasTensor.get(),
- &output,
- padStrideInfo,
- depthMultiplier,
- arm_compute::ActivationLayerInfo(),
- aclDilationInfo);
- }
+ m_pDepthwiseConvolutionLayer = std::make_unique<arm_compute::NEDepthwiseConvolutionLayer>();
+ static_cast<arm_compute::NEDepthwiseConvolutionLayer*>(
+ m_pDepthwiseConvolutionLayer.get())->configure(&input,
+ m_KernelTensor.get(),
+ m_BiasTensor.get(),
+ &output,
+ padStrideInfo,
+ depthMultiplier,
+ arm_compute::ActivationLayerInfo(),
+ aclDilationInfo);
BOOST_ASSERT(m_pDepthwiseConvolutionLayer);