aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsaoste01 <saoirse.stewart@arm.com>2018-11-05 12:30:23 +0000
committersaoste01 <saoirse.stewart@arm.com>2018-11-05 12:30:23 +0000
commit9c6f3afdf7686d9804fd5bc04ea68fca4c49a0a8 (patch)
tree42468da4e1c831c0e59c74c981d9c4290a47e352
parentc9cc80455ff29fd2c8622c9487ec9c57ade6ea30 (diff)
downloadarmnn-9c6f3afdf7686d9804fd5bc04ea68fca4c49a0a8.tar.gz
IVGCVSW-2113: Update ClDepthWiseConvolutionWOrkload to suit NCHW/NHWC DataLayout (3*3 Optimization)
Change-Id: Icfc137201c52e2c856076b7795572cc4ba75cc95
-rw-r--r--src/backends/cl/workloads/ClDepthwiseConvolutionWorkload.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/backends/cl/workloads/ClDepthwiseConvolutionWorkload.cpp b/src/backends/cl/workloads/ClDepthwiseConvolutionWorkload.cpp
index aa5d5a1b0a..9cadbf09ac 100644
--- a/src/backends/cl/workloads/ClDepthwiseConvolutionWorkload.cpp
+++ b/src/backends/cl/workloads/ClDepthwiseConvolutionWorkload.cpp
@@ -88,8 +88,11 @@ ClDepthwiseConvolutionWorkload::ClDepthwiseConvolutionWorkload(
const unsigned int depthMultiplier = weightInfo.GetShape()[0];
+ const unsigned int widthIndex = (m_Data.m_Parameters.m_DataLayout == DataLayout::NCHW) ? 3 : 2;
+ const unsigned int heightIndex = (m_Data.m_Parameters.m_DataLayout == DataLayout::NCHW) ? 2 : 1;
+
//Check for optimisation opportunities.
- bool use3x3Optimisation = (weightInfo.GetShape()[3] == 3) && (weightInfo.GetShape()[2] == 3);
+ bool use3x3Optimisation = (weightInfo.GetShape()[widthIndex] == 3) && (weightInfo.GetShape()[heightIndex] == 3);
if (use3x3Optimisation)
{
m_DepthwiseConvolutionLayer = std::make_unique<arm_compute::CLDepthwiseConvolutionLayer3x3>();